MySQL Initialization simple optimization

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.