MySQL 优化

1.修改初始密码

  • 获取初始密码登录
    grep "temporary password" /usr/local/mysql/mysql-err.log

  • 修改初始密码

    mysql> 
    mysql>
    mysql> set password=password("$YourPasswordHere");
    Query OK, 0 rows affected, 1 warning (0.00 sec)
    mysql>
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    mysql>
    mysql>

2.强制重置密码

  • 修改配置文件: /etc/my.cnf

    [mysql]添加: skip_grant_tables

重启MySQL: systemctl restart mysqld