Home > Back-end >  how can i fix the password to read in mysql
how can i fix the password to read in mysql

Time:05-15

I have a problem .I have the code that needs to connect to a MySQL database in the TERMINAL. but i can not open because this password does not support %pK]-K8FgAM,HS8$7}uY

mysql -N -h 127.0.0.1 -P 3306 -u test -p%pK]-K8FgAM,HS8$7}uY -D read 

CodePudding user response:

Put mysql -h localhost -u username -p It will ask for password in terminal

CodePudding user response:

You can put single quotes around the password

mysql -N -h 127.0.0.1 -P 3306 -u test -p'%pK]-K8FgAM,HS8$7}uY' -D read 

CodePudding user response:

The problem is that the $ character is interpreted specially by the shell. See following illustration

$ echo %pK]-K8FgAM,HS8$7}uY
%pK]-K8FgAM,HS8}uY
$ echo '%pK]-K8FgAM,HS8$7}uY'
%pK]-K8FgAM,HS8$7}uY

So, please enclose the password in single quote.

  • Related