Woodburn2006 Posted September 13, 2006 Share Posted September 13, 2006 when i build sites i use the testing apache server i have on my machine and then upload once i have completed the project.is there any way of replicating my mysql database from my machine to the server without having to re-build the mysql database on the server? Quote Link to comment Share on other sites More sharing options...
orion2004 Posted September 13, 2006 Share Posted September 13, 2006 not 100% sure but cant you just export the database to a text file and import it onto your other database? Quote Link to comment Share on other sites More sharing options...
redRemedy Posted September 13, 2006 Share Posted September 13, 2006 If you use the phpMyAdmin on both your local test machine and your production server, you will find that there is several exporting options for you to choose from. phpMyAdmin also offers an online documentation. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 Why don't you just connect remotely? Quote Link to comment Share on other sites More sharing options...
Woodburn2006 Posted September 14, 2006 Author Share Posted September 14, 2006 ok will have a look, if i connect remotely then it is harder to make changes to a working site. i will have to keep uploading everytime i make a slight change in code and if i am doing a tricky bit i always do a bit at a time and test, it will take to long if i have to upload it all of the time Quote Link to comment Share on other sites More sharing options...
fenway Posted September 14, 2006 Share Posted September 14, 2006 I don't know what you mean by "upload it all"... I'm talking about a remote DB connection. Quote Link to comment Share on other sites More sharing options...
Woodburn2006 Posted September 14, 2006 Author Share Posted September 14, 2006 ah right sorry i thought you were talking about the site itself. i sometimes do the work on my laptop, therefore i cant always have access to the DB as im not near an internet connection Quote Link to comment Share on other sites More sharing options...
fenway Posted September 14, 2006 Share Posted September 14, 2006 Well, if you don't really care about how "up-to-date" it is, you can always since have a daily dump, and pull it down via whatever, blow away your local copy, and start fresh. Quote Link to comment Share on other sites More sharing options...
shoz Posted September 14, 2006 Share Posted September 14, 2006 It looks like he just wants to be able to copy the local db to the remote db once. By "without having to re-build", I think he means without having to recreate all the tables by hand and enter all the information as he did on his local server.If that's the case then using PhpMyadmin's export option as mentioned earlier in the thread should be what you're looking for. I'm not very familiar with PhpMyadmin, but it should be a straight forward process.Instead of using Phpmyadmin, you can do it by hand using "mysqldump" and "mysql" to do the copy.Backup on test server[code]mysqldump --opt dbname > file.sql[/code]Restore on production server[code]mysql dbname < file.sql//or as a querySOURCE /path/to/file.sql[/code]You can compress the sql file to make it much smaller and upload the compressed file. There should also be a similar option in Phpmyadmin.In linux[code]mysqldump --opt dbname | gzip -c > file.sql.gz[/code] Quote Link to comment 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.