Copy Prod DB to Dev
Right now i have a prod and dev site and I've used GIT to keep them in working order via branches, which works great for files, however with the DB its sort of a pain, what im doing right now is
1) From CPanel go to mysql databases and drop the Dev DB
2) go to phpmyadmin and go to the db, operation, copy DB (leaving all its settings to the defaults)
3) go back to mysql databases and assign the user permissions.
this seems like it would be something fairly easy to script but i've run in co a couple of problems
1) most of the scripts assume you have the root password for mysql (i dont think i have that, HostGator shared account)
2) mysqldump vs using SQL script, its a small DB but i've seen a good deal of opinions for both.
and suggested methods for doing this via a script?
-
] 1) most of the scripts assume you have the root password for mysql (i dont think i have that, HostGator shared account)?
Try to use your cpanel user name and password in your script and test that for your work.0 -
Hello :) The following document explains how to authenticate in MySQL with just the MySQL username and password: [url=http://dev.mysql.com/doc/refman/5.5/en/connecting-disconnecting.html]MySQL :: MySQL 5.5 Reference Manual :: 3.1 Connecting to and Disconnecting from the Server I'd go with "mysqldump" if you want something that's easy to use. Thank you. 0 -
Thanks for the responses guys. I was able to get most of it working but im unable to set the DB permissions due to limitations by the provider. It looks like i'll have to work some web magic to get the permissions automated. Probably something similar to the DB Backup script i've seen floating around. 0
Please sign in to leave a comment.
Comments
3 comments