[root@mysql scripts]# mysqladmin -uroot password "000000"
[root@mysql scripts]# mysql -uroot -p000000
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis2
Server version: 5.5.32 Source distribution
Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
7.简单优化
7.1清楚非管理员用户
mysql> select user,host from mysql.user;
+------+-----------+| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
| | mysql |
| root | mysql |
+------+-----------+
mysql> mysql> delete from mysql.user wher"";
Query OK, 2 rows affected (0.00 sec)
mysql> delete from mysql.user where host="::1";
Query OK, 1 row affected (0.00 sec)
mysql> delete from mysql.user where host="mysql";
Query OK, 1 row affected (0.00 sec)
mysql> select user,host from mysql.user;
+------+-----------+| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
2 rows in set (0.00 sec)
[root@mysql ~]# mysqladmin -uroot password "000000" -S /data/3306/mysql.sock
[root@mysql ~]# mysqladmin -uroot password "000000" -S /data/3307/mysql.soc
[root@mysql ~]# mysql -uroot -p000000 -S /data/3306/mysql.sock
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis3
Server version: 5.5.32-log Source distribution
Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
[root@mysql ~]# mysql -uroot -p000000 -S /data/3307/mysql.sock
Welcome tothe MySQL monitor. Commands endwith ; or \g.
Your MySQL connection idis2
Server version: 5.5.32-log Source distribution
Copyright (c) 2000, 2013, Oracle and/orits affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/orits
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye