When we want to log into the MySQL database via mysql-client under the Shell, we always need to enter the password again and again in a very troublesome time.
Usually when we log in to the database, this is the way to log in, as follows
[Email protected]:~# mysql-uroot-penter Password:
How to use input: MySQL just log in directly?
Use. MY.CNF Quick Login
Create a new. my.cnf file in the ~/directory. Of course, if you already have this file, you can modify this file directly!
I personally like to use Vim Dafa, so we can
Vim ~/.MY.CNF
Then write the following information in the file
[Client]password=passworduser=username
Note: because your password is written in the. my.cnf file, be aware of the file permissions to set this file
[Email protected]:~# chmod ~/.my.cnf
Once saved, we can log in to MySQL database directly using MySQL command.
This article is from the "Night" blog, please be sure to keep this source http://liuqun.blog.51cto.com/3544993/1984022
How do I quickly log in to MySQL database by password-free?