mysql back-up question - *.sql files?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Newbie question...

We have an online catalogue running off a mysql database, which we can back
up.  When we back it up, it creates a file online called "database.sql"
which, when opened in Notepad starts...
DROP TABLE IF EXISTS store_category;
CREATE TABLE store_category (
 category text NOT NULL,....etc

If we want to transfer our database to a different host, how would we upload
this .sql file into our new mysql database (on the new server)?


Re: mysql back-up question - *.sql files? wrote:
Quoted text here. Click to load it

First create the database:

mysqladmin create [database]

mysql -u [user] -p [database] < [filename.sql]

* [user] is the username with the proper rights to create and import
databases, for instance the root account
* -p is added to prompt for a password
* [database] is the name of the (just) created database
* [filename.sql] is the filename of the SQL dump file.

Good luck!


Re: mysql back-up question - *.sql files?

Thank you Jonathan.

Please excuse my ignorance of MySQL, but our host company simply creates the
database for us, and sends us the access details.

I guess I'm therefore wondering how I upload the .sql dump file into it?
<embarrassed face>  :o)  !

Much appreciated

Quoted text here. Click to load it

Re: mysql back-up question - *.sql files?

Quoted text here. Click to load it

How do you upload any other file to the hosting company's servers?  FTP?

Once the .sql file is there, the hosting company probably has some web-based
MySQL administration application, and the most popular one for this kind of
situation is phpmyadmin.  You need to confirm this with the hosting company.

You should really be talking to your hosting company with these questions,
since so much of the answer depends on how they set it up.  Don't worry
about appearing ignorant.  It's no negative reflection on you that you don't
know software that is new to you.  You just don't know it _yet_.

Bill K.

Re: mysql back-up question - *.sql files? wrote:

Quoted text here. Click to load it

The same way you normally transfer files to a server. We use WinSCP for
secure transfers if server supports ssh, but if that isn't available,
there usually is FTP service (For example Filezilla can be used to
transfer via FTP).

Site Timeline