security considerations include the $ special symbol when setting up the MySQL password, which causes the following error to run when writing the script:
After some toss found the original is $ led to the decisive change password, as for the reasons themselves Baidu to find me here does not explain the method of changing the password as follows:
Method 1: Use the Set password command
First log in to MySQL.
Format:mysql> set password for user name @localhost = password (' new password ');
Example:mysql> set password for [email protected] = password (' 123 ');
Method 2: Use Mysqladmin
Format: Mysqladmin-u username-P Old password password new password
Example: mysqladmin-uroot-p123456 password 123
Method 3: Edit the user table directly with update
First log in to MySQL.
mysql> use MySQL;
mysql> Update user set Password=password (' 123 ') where user= ' root ' and host= ' localhost ';
mysql> flush Privileges;
MySQL setting complex password with $ special symbol causes command line logon not possible