1,yum 2, source code 3, binary 4, source +yum
Either way, the database needs to be optimized for the database to be installed.
database MySQL optimization>Selecthost,user from Mysql.user;+-----------+------+| Host | User |+-----------+------+|127.0.0.1| Root | | ::1| Root | | localhost | || localhost | Root | | www | || www | Root |+-----------+------+6RowsinchSet (0.00sec) #删掉用户名为null的mysql> Delete from Mysql.user where user="'; Query OK,2Rows Affected (0.00sec) MySQL>Selecthost,user from Mysql.user;+-----------+------+| Host | User |+-----------+------+|127.0.0.1| Root | | ::1| Root | | localhost | Root | | www | Root |+-----------+------+4RowsinchSet (0.00sec) Drop user"'@'localhost';d ROP User"'@':: 1';d ROP User'Root'@'Lanny';d ROP User"'@'Lanny'; MySQL>SelectUser,host from Mysql.user;mysql>#有时候drop删不掉 (may contain special characters), the Delete command is used to delete ipv6: MySQL> Delete from Mysql.user where host=':: 1'; Query OK,1Row affected (0.00sec) MySQL>Selectuser,host from Mysql.user;+------+-----------+| user | Host |+------+-----------+| Root |127.0.0.1|| Root | localhost | | Root | www |+------+-----------+3RowsinchSet (0.00sec) erase MySQL from www> Delete from Mysql.user where host='www'; Query OK,1Row affected (0.00sec) MySQL>Selectuser,host from Mysql.user;+------+-----------+| user | Host |+------+-----------+| Root |127.0.0.1|| Root | localhost |+------+-----------+2RowsinchSet (0.00sec) MySQL>Delete the test library MySQL>show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Performance_schema | | Test |+--------------------+4RowsinchSet (0.00sec) MySQL>drop database test; Query OK,0Rows Affected (0.00sec) MySQL>show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Performance_schema |+--------------------+3RowsinchSet (0.00Sec
View Code
MySQL Initialization simple optimization