Weird Problem Importing an SQL database


#1

Since I’ve had a ticket open for 15 hours without a response, and my site has been down for three days, I figured I would post my problem at the forum.

I am trying to import a mysql database that I uploaded to the root directory of my website. I created a mysql host name. I also created the “container” database where the sql file will be imported.

I can log into this database using PHPMYADMIN and also through shell access. So I know my user name and pass are working properly. However, when I try to import my DB using the following shell command (actual values have been replaced), I get the following error:

[grand]$ mysql -h mysql.mydomainame.com -u myusername -p dreamhostdb_name <
uploaded_db.sql
Enter password:
ERROR 1044 (42000) at line 12: Access denied for user
’myusername’@‘64.111.96.0/255.255.224.0’ to database ‘myusername_name’

For some reason, it tries to connect to a database ‘myusername_name’ which is an amalgamation of my user name and the last part of my database name. It is a database that does not and should not exsist.

I am really stumped. I have exported and imported DB’s using DH’s shell access on another account without any problems.

Anyone have any ideas or suggestions?


#2

Have you tried doing it like “-uusername -ppassword -h mysql.domain.com dbname”?

Check out Gordaen’s Knowledge, the blog, and the MR2 page.


#3

You can’t have a space between the -p and the password. In fact, you can leave out the -p flag and have it manually prompt you for the password if you’re paranoid.

-Scott