watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

1. Database setting password

[[email protected] scripts]# mysqladmin -uroot password 123

2. Log in with password

#1. The right way ( No specification )
[[email protected] scripts]# mysql -uroot -p123
[[email protected] scripts]# mysql -u root -p123
#2. Wrong way
[[email protected] scripts]# mysql -uroot -p 123
# Said on the official website -p perhaps --password There must be no space or more than characters between parameters and passwords
#3. The right and standard way
[[email protected] scripts]# mysql -u root -p
Enter password:

3. Query the user

mysql> select user,host from mysql.user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1       |
|      | db02      |
| root | db02      |
|      | localhost |
| root | localhost |
+------+-----------+
6 rows in set (0.00 sec)

4. Delete user ( Optimize )

Delete irrelevant users , One of the safety baselines .

mysql> drop user [email protected]'::1';
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host from user;
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
|      | db02      |
| root | db02      |
|      | localhost |
| root | localhost |
+------+-----------+
5 rows in set (0.00 sec)