MySQL初始化簡單最佳化

來源:互聯網
上載者:User

標籤:

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初始化簡單最佳化

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.