operating Environment:CentOS 7
Database:mariadb
Problem Description: run the/var/lib/mysql_install_db command after the Yum installation mariadb database runs, which causes the MARIADB database to fail to start or restart.
Fault resolution:
[[email protected] mysql]$ sudo systemctl start mariadb.service
Job for Mariadb.service failed because the control process exited with error code. See "Systemctl Status Mariadb.service" and "Journalctl-xe" for details.
Through the problem description, the first thought is to run sudo journalctl-xe to see the following problem details, but the view and no more detailed error description, so I think of /var/log/mariadb/error.log , the following error message was obtained,mysqld:file './mysql-bin.000013 ' not Found (errcode:13), as prompted, Check to see if the mysql-bin.000013 binary log file is missing,ls-l/var/lib/mysql/ has seen this file exists, but found that the owner of this file and the owner and other files belong to the main and the group permissions are not the same, change the owner and the group sudo Chown mysql.mysql mysql-bin.000013, restarting mariadb problem is resolved.
Summarize:
Most failures in Linux have log file records, do not panic when encountering problems, first review the problem description, and then through the log file description to solve the problem. Don't blindly search the answers online.
[email protected] mysql]$ sudo journalctl-xe
--
--Unit Mariadb.service have begun shutting down.
November 18:22:46 CentOS systemd[1]: Stopped MariaDB database server.
--Subject:unit Mariadb.service have finished shutting down
--DEFINED-BY:SYSTEMD
--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
--Unit Mariadb.service have finished shutting down.
November 18:22:46 CentOS polkitd[636]: Unregistered authentication Agent for unix-process:13180:865667 (System bus name:1.1 97,
November 18:22:57 CentOS sudo[13209]: CENTOS:TTY=PTS/1; Pwd=/var/lib/mysql; User=root; Command=/bin/systemctl start Mari
November 18:22:57 CentOS polkitd[636]: Registered authentication Agent for unix-process:13210:866892 (System bus name:1.198 [/
November 18:22:57 CentOS systemd[1]: Starting MariaDB database server ...
--Subject:unit Mariadb.service has begun start-up
--DEFINED-BY:SYSTEMD
--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
--Unit Mariadb.service have begun starting up.
November 18:22:57 CentOS mariadb-prepare-db-dir[13217]: Database mariadb is probably initialized In/var/lib/mysql already, Not
November 18:22:57 CentOS mariadb-prepare-db-dir[13217]: If This isn't the case, make sure The/var/lib/mysql is empty befor E r
November 18:22:57 CentOS mysqld_safe[13252]: 171104 18:22:57 mysqld_safe Logging to '/var/log/mariadb/mariadb.log '.
November 18:22:57 CentOS mysqld_safe[13252]: 171104 18:22:57 mysqld_safe starting mysqld daemon with databases From/var/lib /my
November 18:23:03 CentOS systemd[1]: Mariadb.service:control process exited, code=exited Status=1
November 18:23:03 CentOS systemd[1]: Failed to start MariaDB database server.
--Subject:unit Mariadb.service has failed
--DEFINED-BY:SYSTEMD
--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
--Unit Mariadb.service has failed.
--
--the result is failed.
November 18:23:03 CentOS systemd[1]: Unit Mariadb.service entered failed state.
November 18:23:03 CentOS systemd[1]: Mariadb.service failed.
November 18:23:03 CentOS polkitd[636]: Unregistered authentication Agent for unix-process:13210:866892 (System bus name:1.1 98,
November 18:23:16 CentOS sudo[13683]: CENTOS:TTY=PTS/1; Pwd=/var/lib/mysql; User=root; Command=/bin/journalctl-xe
[email protected] mysql]$ sudo tail-n 30/var/log/mariadb/error.log
171104 18:22:59 Percona XtraDB (http://www.percona.com) 5.5.52-mariadb-38.3 started; Log sequence Number 1597964
171104 18:22:59 [Note] Plugin ' FEEDBACK ' is disabled.
171104 18:22:59 [ERROR] mysqld:file './mysql-bin.000013 ' not Found (errcode:13)
171104 18:22:59 [ERROR] Failed to open log (file './mysql-bin.000013 ', errno 13)
171104 18:22:59 [ERROR] Could not open log file
171104 18:22:59 [ERROR] Can ' t init TC Log
171104 18:22:59 [ERROR] Aborting
This article is from the "Sunset Lamb" blog, please be sure to keep this source http://corallus.blog.51cto.com/7169241/1979013
About running the mysql_install_db command causing sudo systemctl Start/restart Mariadb.service startup failure issues