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)
时间: 2024-10-10 20:33:45