MySQL Dump file troubles, a dashes dilema

I really hate looking (or being) stupid. Nevertheless it happens from time to time. Most (if not all) times they are avoidable events. Had my observation of what the MySQL command line response was trying to tell me been a little better, perhaps my Google searching Kung-Fu failure would not have added additional salt to the wound.

When attempting to import data from a SQL dump I was getting the following error(s):

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

or

mysql: unknown option

As it turned out, it was a simple matter of syntax minutia I was overlooking.  Since Google couldn’t help me save myself, I’m hoping that I can list a few of the deviations of syntax for importing a dump file and it will help somebody whom comes across it to save a little face.

RIGHT:
mysql -uroot -ppassword test < test.dmp
mysql -uroot –password=password test < test.dmp
mysql –user=root –password=password test < test.dmp
mysql -uroot –password=password test < test.dmp

WRONG:
mysql -uroot -password=password test < test.dmp
mysql -uroot –ppassword test < test.dmp
mysql –uroot -password=password test < test.dmp
mysql -user=root –password=password test < test.dmp

May the Computer gods (Google?) shine upon those of you having a dashes dilema with MySQL dump files and bring you here for salvation.  🙂

Leave a Reply

Post Navigation