启动MySQL时报错:
[root@CentOS ~]# service mysql restart
Redirecting to /bin/systemctl restart mysql.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@CentOS ~]# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2021-09-02 22:12:25 CST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 6630 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)
9月 02 22:12:23 CentOS.7.64 systemd[1]: Starting LSB: start and stop MySQL...
9月 02 22:12:25 CentOS.7.64 mysqld[6630]: Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mys....pid).
9月 02 22:12:25 CentOS.7.64 systemd[1]: mysqld.service: control process exited, code=exited status=1
9月 02 22:12:25 CentOS.7.64 systemd[1]: Failed to start LSB: start and stop MySQL.
9月 02 22:12:25 CentOS.7.64 systemd[1]: Unit mysqld.service entered failed state.
9月 02 22:12:25 CentOS.7.64 systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
整了半天,突然在以前的笔记里找到了解决办法
进入mysql目录,/usr/local/mysql/data
[root@CentOS data]# ls
apolloconfigdb base_business dtsmart_dev himis_test ib_logfile0 park_client test_db
apolloportaldb CentOS.7.64.err dtsmart_zs ib_buffer_pool ib_logfile1 performance_schema
auto.cnf dtsmart_bjsg dymaster_test ibdata1 mysql sys
删除ib_logfile*
删除ibdata*
[root@CentOS data]# rm ib_logfile*
rm:是否删除普通文件 "ib_logfile0"?y
rm:是否删除普通文件 "ib_logfile1"?y
[root@CentOS data]# rm ibdata*
rm:是否删除普通文件 "ibdata1"?y
然后启动mysql,终于成功了
[root@CentOS data]# service mysql restart
Redirecting to /bin/systemctl restart mysql.service
舒服
不知道是什么原因导致的,
是因为我在my.cnf里面加了这个配置导致的吗,求大神解惑
tmp_table_size = 256M
max_heap_table_size = 256M