Hobbyist_PHPer Posted May 17, 2011 Share Posted May 17, 2011 MySQL Version --> 5.0.76-standard Hi everyone, I have my first MySQL dedicated server and I'm finding some things to be a bit more challenging than I had expected... I have figured out how to create databases and even how to create a user for that database... But what I need to try to figure out is how to create a dump file of a database, so that I can then use that dump file to recreate all of the tables inside of newly created databases... Here's what I tried for creating a dump file... attorney is the name of the user and the database... mysqldump -u attorney -p password attorney > acsdumpfile.sql; Here's the error I get... 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 -u attorney -p password attorney > acsdumpfile.sql' at line 1 Then I tried doing this instead, copying the contents from one database to a newly created one, that didn't work either... mysqldump -u attorney -p password -d attorney | mysql -u attorney -p password -d staging; Here's the error I get... 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 -u attorney -p password -d attorney | mysql -u attorney -p passw' at line 1 <-- (I noticed here that it had cut off my password) Quote Link to comment https://forums.phpfreaks.com/topic/236673-how-to-create-a-dump-file/ Share on other sites More sharing options...
Maq Posted May 17, 2011 Share Posted May 17, 2011 You should be doing that in the command line not the mysql> prompt. Quote Link to comment https://forums.phpfreaks.com/topic/236673-how-to-create-a-dump-file/#findComment-1216661 Share on other sites More sharing options...
Hobbyist_PHPer Posted May 17, 2011 Author Share Posted May 17, 2011 You should be doing that in the command line not the mysql> prompt. That worked... Thank You. Quote Link to comment https://forums.phpfreaks.com/topic/236673-how-to-create-a-dump-file/#findComment-1216698 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.