Jump to content

How to create a dump file


Hobbyist_PHPer

Recommended Posts

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)

Link to comment
https://forums.phpfreaks.com/topic/236673-how-to-create-a-dump-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.