Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql password is messing up my dump

Tags:

ok so i need to do a mysqldump of a database and this is what i have

mysqldump -uroot -psdfas@N$pr!nT --databases app_pro > /srv/DUMPFILE.SQL 

but i am getting this error

 -bash: !nT: event not found 

seems to be having a hard time with the password...any other way to mysql dump

like image 983
Matt Elhotiby Avatar asked Jan 05 '11 22:01

Matt Elhotiby


People also ask

Why does MySQL not accept my password?

Recover MySQL root passwordStop the MySQL server process. Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for a password. Connect to the MySQL server as the root user. Set a new root password.

How do I know if my MySQL password is valid?

To check if the password matches, create your hash for the password the user put in. Then perform a query against the database for the username and just check if the two password hashes are identical. If they are, give the user an authentication token.


1 Answers

Put -psdfas@N$pr!nT in single quotes:

mysqldump -uroot '-psdfas@N$pr!nT' --databases app_pro > /srv/DUMPFILE.SQL 

The problem is that bash is interpreting the !. Strings in single quotes aren't interpreted.

like image 120
moinudin Avatar answered Oct 05 '22 16:10

moinudin