重新启动 VServer 后,MariaDB 拒绝启动。
这是错误信息:
# systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Thu 2016-02-18 11:02:39 UTC; 2min 56s ago
Process: 5921 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 6931 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Feb 18 11:02:09 server mysqld[7119]: InnoDB: If you are installing InnoDB, remember that you must create
Feb 18 11:02:09 server mysqld[7119]: InnoDB: directories yourself, InnoDB does not create them.
Feb 18 11:02:09 server mysqld[7119]: 160218 11:02:09 [ERROR] InnoDB: File (unknown): 'read' returned OS error 71. Cannot continue operation
Feb 18 11:02:09 server mysqld_safe[7133]: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: [61B blob data]
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")'
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Feb 18 11:02:39 server /etc/init.d/mysql[7412]:
Feb 18 11:02:39 server mysql[6931]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
和
# journalctl -xn
-- Logs begin at Thu 2016-02-18 10:10:43 UTC, end at Thu 2016-02-18 11:02:39 UTC. --
Feb 18 11:02:09 server mysqld[7119]: InnoDB: If you are installing InnoDB, remember that you must create
Feb 18 11:02:09 server mysqld[7119]: InnoDB: directories yourself, InnoDB does not create them.
Feb 18 11:02:09 server mysqld[7119]: 160218 11:02:09 [ERROR] InnoDB: File (unknown): 'read' returned OS error 71. Cannot continue operation
Feb 18 11:02:09 server mysqld_safe[7133]: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: [61B blob data]
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")'
Feb 18 11:02:39 server /etc/init.d/mysql[7412]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Feb 18 11:02:39 server /etc/init.d/mysql[7412]:
Feb 18 11:02:39 server mysql[6931]: Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
我的 my.cnf 可以在这里找到:https://debianforum.de/forum/pastebin.php?mode=view&s=39158
经过一番搜索,我发现配置选项“innodb_force_recovery”如果我将其设置为“6”,数据库服务器就会启动,但数据库仍然损坏。
知道这里有什么问题吗?我该如何解决它?
多谢!
答案1
我解决了这个问题。我不确定我是否完全理解了,但它似乎与这里描述的类似https://mariadb.com/blog/get-rid-orphaned-innodb-temporary-tables-right-way我删除了所有 #sql*.idb 和 #sql*.frm 文件,数据库服务器重新启动。不确定这是否是完美的解决方案,但它确实有效。