Quote:
Originally Posted by rahulvishwakarma
dear friends' i've centos6.4 as both server and client. i am trying to export database "inventory"
i tried following commands but failed :-
Code:
mysqldump -u [user] -p [db_name] | gzip > [filename_to_compress.sql.gz]
For Import:
gunzip < [compressed_filename.sql.gz] | mysql -u [user] -p[password] [databasename]
Note: There is no space between the keyword '-p' and your password
giving followeing output:-
Code:
mysql> mysqldump --databases --user=root -p inventory > /software/inv.sql
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump --databases --user=root -p inventory > /software/inv.sql' at line 1
please tell me how to expert and imoprt databases
|
Since you say you've 'found' these commands (ostensibly on other websites/forums/documentation), you really then need to read the documentation on their use. There is a HUGE volume of sites that can tell you how to export a MySQL database. Read the "Question Guidelines" link in my posting signature, and do basic research first before posting.
You're typing the mysqldump command in to the MySQL console...that will not work. You do it on the command-line. It's even telling you the syntax is wrong in the error...can't get more clear than that. Read the man page on the mysqldump command, and *THINK* about what you're typing in. Do you require a root password for MySQL access? If not, why are you putting the -p (for a PASSWORD???) Read up on those other options as well, to see what you need and don't need.
You've been asking about MySQL for FOUR YEARS now....have you made no progress at all???