Forum Moderators: open

Message Too Old, No Replies

Recreating a MySQL database

proper SSH commands?

         

Gomez

7:42 pm on Nov 18, 2005 (gmt 0)

10+ Year Member



I am trying to recreate a MySQL database on a new domain. To do this, I am importing several .SQL text files into a new database. These files consist of SQL statements & they were created with a mysqldump type of function. (They consist of CREATE TABLE and INSERT statements). I am trying to accomplish this via SSH. Can someone help me with the proper SSH commands?

I tried

DBSERVER dbname < localhost/directory/filename.sql

but it says that the file doesn't exist. Any help with this would be greatly appreciated!

Thanks

surfin2u

8:03 pm on Nov 18, 2005 (gmt 0)

10+ Year Member



Here's the command:

mysql -hhostname -uusername -ppassword -Ddatabasename < inputfile.sql

substitute your own info for:
hostname
username
password
databasename
inputfile

Gomez

10:58 pm on Nov 18, 2005 (gmt 0)

10+ Year Member



Thank You! Worked perfect once I used -hlocalhost instead of my webhost URL. This will make life a little easier for now.