基于Mysql5.7版本
- 修改密码
# 首次安装:
1. 获取密码:grep 'temporary password' /var/log/mysqld.log
2.执行:ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
#查看密码策略
show variables like '%validate_password_policy%';
show variables like '%validate_password_length%';
# 修改密码策略
set global validate_password_policy=0;
set global validate_password_length=1;
- start request repeated too quickly for mysqld.service
vim /var/log/mysqld.log
2021-07-16T14:19:19.495221Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2021-07-16T14:19:19.495245Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2021-07-16T14:19:19.495252Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2021-07-16T14:19:19.496212Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-07-16T14:19:19.496223Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-07-16T14:19:19.496228Z 0 [ERROR] Failed to initialize builtin plugins.
Cannot allocate memory for the buffer pool :无法为mysql分配需要的内存
解决方案: 修改my.conf文件,添加如下参数,调节 内存大小
[mysqld]
innodb_buffer_pool_size = 128M
key_buffer_size =120M
- mysql配置信息
配置文件:/etc/my.cnf
日志文件:/var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid