1
2
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

优化mysql占用的内存

1
vim /etc/mysql/mysql.conf.d/mysqld.cnf
1
2
3
4
5
[mysqld]
performance_schema_max_table_instances=400
table_definition_cache=400
table_open_cache=256
performance_schema = off

重启mysql

1
systemctl restart mysql