The question on uploading databases to hosting!

They have: 23 posts

Joined: Mar 2007

Hello guys! The situation is the following - I have some databases on local host and now I am going to upload website to hosting! My friend provided me with some place on his hosting account and now I am going to test a website! Could you please explain how should I act with my ready databases if I have Cpanel 11 installed? I don't wish to rewrite them again and just would like to move them from local host to hosting!

SEO services - SEO services and tools!
Graphic design and web programming - affordable website updates!

He has: 629 posts

Joined: May 2007

It depends on what is in your database. Any configuration data referring to your localhost setup is likely to fail, but application data will likely survive. Just fire up phpMyAdmin, select the database, and use the export tab. Export as SQL - only use compression if the tables are huge - and FTP the result to your host, putting the file somewhere off the document root where you can find it again.

On your new host, fire up phpMyAdmin from your cpanel, create an empty database, then use the import tab and look for your uploaded SQL file by pressing the 'Choose file' button.

Note that you can easily erase the tables and repeat the process if something goes wrong. And you can take a look at the table entries after importing to check things before trying to access them from a program.

You will likely have to change the database password and a few other details in your programs, but hopefully you have an INCLUDE file with configuration data like this in it, so you can change it in one place.

There's a lot more help on Apache and PHP forums with more detail than I can give here. But I hope I encouraged you, anyway.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

AndrewCF's picture

They have: 3 posts

Joined: Jan 2009

You can use phpMyAdmin, export from your localhost, and then import to your server.

Also, you can try Mysql command - mysqldump. Launch following command on your local machine:

mysqldump -h localhost -u root -pPASSWORD LOCAL_DATABASE_NAME -c | mysql -h REMOTE_HOST_IP -u root -pPASSWORD REMOTE_DATABASE_NAME

Please make sure you can connect to remote mysql server in your local machine.

They have: 9 posts

Joined: Feb 2009

You export the database.
Upload it to your host and import it at PHPMyAdmin.
Simple as that!

They have: 83 posts

Joined: Apr 2009

you can import the database easier via ssh if you have it:

mysql -u username -pyourpassword db_name < yourdb_youareinstalling.sql
Reply With Quote

#The -pyourpassword is correct! Normally you do -p, but you can do -pyourpassword to pass the password on so you don't have to type it in.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.