MySql troubles


#1

Ok, so I just moved to this hosting and I’m trying to transfer my data on over from another server. I’ve got a sql export from my previous host to install on this server. Unfortunately it’s too big for PHP MyAdmin.

So I followed the directions from here http://wiki.dreamhost.com/Migrate_MySQL and uploaded the SQL file and attempted to import it using the following command (where info is changed to my details): mysql -h mysql.example.com -uusername -ppassword newdbname < outfile.sql

I got an error: Access denied for user ‘mydatabaseuser’@‘ipaddress/255.255.224.0’ to database ‘mydatabase’.

So I tried using my account name and account password and got:
ERROR 1045 (28000): Access denied for user ‘myusername’@‘gorgon.dreamhost.com’ (using password: YES)

The SQL file doesn’t have a “Create database” line in it. I just want to shove the data in the new database. What’s the correct command line? What am I missing?


#2

Your first attempt looks correct. Are you using the same mysqlusername and mysqluserpassword that you used to get at the database via phpMyAdmin?

Note that the “mysql.example.com” may be named entirely differently - it should be the hostname assigned to the database as indicated in the Control Panel under Goodies -> Manage MySQL.

–rlparker


#3

This, as listed in the wiki migration article the wiki, did not work:
mysql -h mysql.example.com -uusername -ppassword newdbname < outfile.sql

This, which is listed in the panel, did:
mysql -u username -ppassword -h hostname databasename < outfile.sql

Asside from the order of the stuff in the line, I see the command from the wiki lacking a space between “u” and “username”. That’s probably the problem, but I’m no MySql expert so I can’t say.


#4

Well, that’s certianly useful to know! Thanks for sharing that, and I’ll go update the wiki. :wink:

–rlparker