8

I have a local MYSQL DB running under WAMP that I need to move up to my production DB server. New to MySQL and need to know the best way to get this DB moved up.

3 Answers 3

15

you can run this on your current server:

mysqldump -u user -p database_name > dump.txt

and then do this on your new server:

mysql -u user -p database_name < dump.txt

Replace "user" with your username and "database_name" with a name of your database. You'll be prompted for a password in both cases

Note that second command will replace old tables in your new database

Sign up to request clarification or add additional context in comments.

Comments

5

Open up your database in phpMyAdmin and then select Export from the menu. Scroll down and select the Save as file checkbox and then press Go.

Now open up the database in phpMyAdmin on the production server (Note: you will need to create the database first) and then select Import from the menu. Browser to the file you saved and press Go.

If everything goes well you should now have a mirror image of your database on the production server! :)

2 Comments

easy enough! this was quick and easy.
this is easy for small db, but is db is big enough you will have to use mysql commands
1

Do you have phpmyadmin? (If you're not sure, type "http://localhost/phpmyadmin"). If you do, go to "Export on your local computer, and then upload that file on the "Import" section of the remote server. This is the absolute easiest way, and 90% of hosts have phpmyadmin installed.

If you don't, use the command line method suggested by ZeppLock.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.