忘记密码
在/etc/mysql/下的配置文件里添加
skip-grant-tables
保存后重启:
systemctl restart mysql
注:登录修改密码后,最好再将配置改回来,然后重启服务
最大连接数失效
my.cnf文件中设置最大连接数量为2048
max_connections = 2048
查询数据库当前设置的最大连接数
show variables like '%max_connections%';
如果修改后生效,但被限制在214,无法再大
1、修改/etc/security/limits.conf,添加
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535
2、修改/lib/systemd/system/mysql.service,添加
LimitNOFILE=65535
LimitNPROC=65535
保存后,执行以下命令
systemctl daemon-reload
systemctl restart mysql.service
再次查看