Copying mySQL tables to remote host

  HighTower 00:06 10 Jun 04
Locked

Anyone any opinions on the best way to copy tables from a mySQL database (not the whole database) from the localhost to a database on a remote server hosted by a third party?

  Taran 08:19 10 Jun 04

Use phpMyAdmin and export the tables.

phpMyAdmin allows individual tables or the entire database to be exported and you can choose between table/database structure or structure and data, so if you already have the tables populated with information yuo don't need to lose it.

The export results in an SQL dump which will create an identical structure on the target database.

Most hosts offer phpMyAdmin or some sort of control panel to assist in working with your MySQL database as a standard feature.

I was surprised with 1&1 last year though, when I had to download my own copy of phpMyAdmin click here then extract the files, configure the necessary settings, upload the files and then protect the directory myself.

I think this sort of thing should really be included and perhaps it is now, but unless you know what you are doing with directory protection it can be dangerous uploading a tool that allows absolute access to your site database. I don't really see the point in offering people a MySQL database without the tools to manage one, especially considering many people will just be starting out with MySQL and may or may not be comfortable in configuring scripts and directory protection.

Anyway, I've gone off on one again. Try phpMyAdmin which gives you a web browser interface to manage your databases. The resulting export SQL file is a very fast way of transferring from your development PC to your live online database. Just remember to make sure that any connection scripts reflect your online database username and password. I don't mean to state the obvious or insult you with that comment, but it has to be one of the most common mistakes I encounter with students who forget that the username/password on their development machine is not normally the same as that on their web host account.

  Taran 08:27 10 Jun 04

I should have also said that if you don't already have or don't want to wrestle with phpMyAdmin on your own computer you can run a command line dump of one or more tables or the entire database.

click here for an overview, but even if you use this method you will still probably have to use phpMyAdmin on your web host space to control your database and import the resulting SQL file.

  HighTower 09:04 10 Jun 04

Thanks Taran,

If you are not on the new year honour list for the work you do on this forum then it is a grave ommission indeed!

This thread is now locked and can not be replied to.

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

These are the Best Christmas Ads and Studio Projects of 2016

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…