mysql 消除 "[Warning] Using a password on the command line interface can be insecure"

If mysql password is expressly written into the time, the system will print the front desk:

[Warning] Using a password on the command line interface can be insecure

His point is that passwords exposed and unsafe.

When we execute the script, the best you can to get rid of this thing, or has been Bouncing bombs, tired to death.

So we can:

 

1. Create a file to store user names, passwords

touch /etc/my.password

Then write the following:

[client]
user=root
password=密码

 

2. When logged in, do not use the -u -p to specify the use of --defaults-extra-file = / etc / my.password to assign a profile to log in, you can eliminate that line the warning.

mysql --defaults-extra-file=/etc/my.password

Guess you like

Origin www.cnblogs.com/young233/p/12149996.html