MySql troubles

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 and uploaded the SQL file and attempted to import it using the following command (where info is changed to my details): mysql -h -uusername -ppassword newdbname < outfile.sql

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

So I tried using my account name and account password and got:
ERROR 1045 (28000): Access denied for user ‘myusername’@‘’ (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?

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 “” may be named entirely differently - it should be the hostname assigned to the database as indicated in the Control Panel under Goodies -> Manage MySQL.


This, as listed in the wiki migration article the wiki, did not work:
mysql -h -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.

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