数据库失败后如何恢复InnoDB?

时间:2016-03-06 04:38:23

标签: mysql database mariadb

我正在尝试安装mysqlgovernor,最后我得到了这个烂摊子,现在我的所有网站都关闭了。

root@panel [~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Sun 2016-03-06 06:35:31 CET; 5s ago
  Process: 6244 ExecStartPost=/usr/sbin/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)
  Process: 6243 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
  Process: 6205 ExecStartPre=/usr/sbin/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
  Process: 6179 ExecStartPre=/usr/sbin/mariadb-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 6243 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mariadb.service

Mar 06 06:35:28 panel.uhlhosting.ch mariadb-prepare-db-dir[6205]: touch: cannot touch 'panel.uhlhosting.ch.err': Permission denied
Mar 06 06:35:28 panel.uhlhosting.ch mariadb-prepare-db-dir[6205]: chown: cannot access 'panel.uhlhosting.ch.err': No such file or directory
Mar 06 06:35:28 panel.uhlhosting.ch mariadb-prepare-db-dir[6205]: chmod: cannot access 'panel.uhlhosting.ch.err': No such file or directory
Mar 06 06:35:29 panel.uhlhosting.ch mysqld_safe[6243]: 160306 06:35:29 mysqld_safe Logging to '/var/lib/mysql/panel.uhlhosting.ch.err'.
Mar 06 06:35:29 panel.uhlhosting.ch mysqld_safe[6243]: 160306 06:35:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Mar 06 06:35:30 panel.uhlhosting.ch mysqld_safe[6243]: 160306 06:35:30 mysqld_safe mysqld from pid file /var/lib/mysql/panel.uhlhosting.ch.pid ended
Mar 06 06:35:31 panel.uhlhosting.ch systemd[1]: mariadb.service: control process exited, code=exited status=1
Mar 06 06:35:31 panel.uhlhosting.ch systemd[1]: Failed to start MariaDB database server.
Mar 06 06:35:31 panel.uhlhosting.ch systemd[1]: Unit mariadb.service entered failed state.
Mar 06 06:35:31 panel.uhlhosting.ch systemd[1]: mariadb.service failed.
root@panel [~]#

这是我的错误列表:

  

InnoDB:文件buf0buf.cc第2850行中的主题140010623854336中的断言失败

以下是重新安装后正在运行的MariaDB,并禁用InnoDB数据库,但我们不想没有它们。

root@panel [~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Sun 2016-03-06 10:16:12 CET; 29min ago
 Main PID: 16551 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─16551 /usr/sbin/mysqld

Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128996632704 [Note] /usr/sbin/mysqld (mysqld 10.1.12-MariaDB) starting as process 16551 ...
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128996632704 [Note] Plugin 'InnoDB' is disabled.
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128996632704 [Note] Plugin 'FEEDBACK' is disabled.
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128996632704 [Note] Server socket created on IP: '::'.
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128995883776 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1286: Unknown storage engine 'InnoDB'
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: 2016-03-06 10:16:12 140128996632704 [Note] /usr/sbin/mysqld: ready for connections.
Mar 06 10:16:12 panel.uhlhosting.ch mysqld[16551]: Version: '10.1.12-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
Mar 06 10:16:12 panel.uhlhosting.ch systemd[1]: Started MariaDB database server.
Mar 06 10:16:54 panel.uhlhosting.ch systemd[1]: Started MariaDB database server.
Mar 06 10:17:00 panel.uhlhosting.ch systemd[1]: Started MariaDB database server.

Server.err

my.cnf file

1 个答案:

答案 0 :(得分:0)

请查看错误日志的前三行: MariaDB无权写入panel.uhlhosting.ch.err所在的目录

您可以通过将此目录的所有者/组更改为mysql:mysql chown -R mysql:mysql /path/to/directory/(如果它位于Linux上)来解决此问题。