1

I have develop one web site in php.
I know how to upload it using ftp(filezilla).
But i dont know how to upload database and i can't do any thing without uploading this database.
please help me to upload my database.
Thank you.

2
  • What type of db are you using?
    – Mattias
    Mar 23, 2012 at 8:32
  • it depends on your host also, it should give you access to a panel where you can insert your sql file and create the database/tables
    – Alex
    Mar 23, 2012 at 8:33

3 Answers 3

3

tl;dr version

Ask your hosting provider what methods they support.

More detail

It all depends on your hosting. Do you have a simple hosting account with only FTP access (i.e. no command line or remote desktop access)? In these cases your host usually has phpMyAdmin installed or an alternative web based database management system.

It's unlikely, but you could also try connecting to your MySQL database from your computer. You can download the command line tools or simply get MySQL Workbench, and put in your hostname and test the connection.

If you do have shell access, you can dump your local database with mysqldump and upload the resulting SQL file, then import that on the server. A similar technique can be used with remote desktop.

0
0

Normally you could make a gzipped .tar.gz of your DB dump and upload it with a file client to your space... once done unzip it and restore from dump using a mysql commandline or some GUI provided by the site admin.. i'm assuming your DB is MySql as its the obvious choice and you have the privilege to access the DB.... this question seems more suited for serverfault as it seems to have less relation to programming in general. Anyhow

To Tar:

tar –cvzf tarfilename foldername

Untar:

tar –xvzf tarfilename

Example:

tar –cvzf abc.tar.gz abc

This will zip [tar] the abc folder with the name abc.tar.gz

tar –xvzf filename.tar.gz

This will unzip [untar] the file as abc folder.

To backup and restore from dump please refer this link as it has some brilliant illustration.

1
  • welcome, if the query is solved completely kindly mark it as solved by selecting an answer.. it will help the others seeking similar query. Mar 23, 2012 at 9:42
0

If you're using MySQL, just export the database from your localhost (phpmyadmin)(click on the database and then search for the export tab ). When you export it, you need to import it to your online host (your domain). And to do this, you have to have access to the cpanel of your host. After logging in to your cpanel , search for phpmyadmin (or whatever database you're using). Create a database and import your database.

2
  • Thanx a lot but I don't have access of cpanel. What to do..? Mar 23, 2012 at 8:53
  • If you baught the domain, they have to give you the credentials to login to cpanel. Contact them and tell them you need the username and password for your cpanel. Mar 23, 2012 at 9:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.