又一次安装mysql出问题。。
用apt装的 命令是 sudo apt-get install mysql-server
然后安装到一半 配置mysql-server的时候报错
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since 四 2019-04-18 17:12:03 CST; 97ms ago
Process: 30187 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
Process: 30186 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 30179 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 30186 (code=exited, status=1/FAILURE)
然后去看了mysql的错误日志 /var/log/mysql/error.log
看了一下好像是内存的问题
后来查了一下 扩展了swap分区 参见:https://baijiahao.baidu.com/s?id=1613632138497857674&wfr=spider&for=pc
扩展完分区 还是启动不了 再看log
error变了。。至少说明上一步有效
在stackoverflow上看到了一个回答https://stackoverflow.com/questions/44859428/log-file-ib-logfile0-size-50331649-is-not-a-multiple-of-innodb-page-size
把/var/lib/mysql 的ib_logfile0 ib_logfile1文件删掉了
再重装 成功