標籤:
1,yum 2,源碼 3,二進位 4,源碼+yum
不管哪種方式裝完成資料庫,都需要對資料庫做一些最佳化.
最佳化資料庫mysql> select host,user from mysql.user;+-----------+------+| host | user |+-----------+------+| 127.0.0.1 | root || ::1 | root || localhost | || localhost | root || www | || www | root |+-----------+------+6 rows in set (0.00 sec)#刪掉使用者名稱為null的mysql> delete from mysql.user where user=‘‘;Query OK, 2 rows affected (0.00 sec)mysql> select host,user from mysql.user;+-----------+------+| host | user |+-----------+------+| 127.0.0.1 | root || ::1 | root || localhost | root || www | root |+-----------+------+4 rows in set (0.00 sec)drop user ‘‘@‘localhost‘;drop user ‘‘@‘::1‘;drop user ‘root‘@‘lanny‘;drop user ‘‘@‘lanny‘;mysql> select user,host from mysql.user;mysql>#有時候drop刪不掉(可能包含特殊字元),才會用delete命令刪掉ipv6的:mysql> delete from mysql.user where host=‘::1‘;Query OK, 1 row affected (0.00 sec)mysql> select user,host from mysql.user;+------+-----------+| user | host |+------+-----------+| root | 127.0.0.1 || root | localhost || root | www |+------+-----------+3 rows in set (0.00 sec)刪掉www的mysql> delete from mysql.user where host=‘www‘;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)mysql>刪掉test庫mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || test |+--------------------+4 rows in set (0.00 sec)mysql> drop database test;Query OK, 0 rows affected (0.00 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema |+--------------------+3 rows in set (0.00 sec)
View Code
MySQL初始化簡單最佳化