###前提・実現したいこと
Raspberry Pi3 (model B)にCentOS7をインストールし,
MariaDB+Apache+WordPressでWebサーバを構築しようとしています.
一通りCentOSの設定(yumの有効化,Wi-Fiの有効化など)を行い,
MariaDBをインストールして起動しようとしたところでエラーが発生し起動できません.
###発生している問題・エラーメッセージ
systemctl start mariadb
と実行すると,
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
と返ってきます.
なお,systemctl enable mariadbを実行すると
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
と,正しく実行されます.
###試したこと
yum erase mariadb mariadb-server
で一旦削除し,
yum install mariadb mariadb-server
でインストールし直してみましたが,解消されませんでした.
###補足
LAN内のMacより,rootユーザーにSSHでログインしています.
systemctl status mariadb.serviceを実行すると以下のようになりました.
● mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since 土 2018-01-13 17:34:13 JST; 3min 22s ago Process: 780 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=1/FAILURE) 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: /var/lib/mysql for more information. 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: The problem could be conflicting information in an external 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: my.cnf files. You can ignore these by doing: 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: shell> /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: You can also try to start the mysqld daemon with: 1月 13 17:34:13 centos-rpi3 mariadb-prepare-db-dir[780]: shell> /usr/libexec/mysqld --skip-grant --general-log & 1月 13 17:34:13 centos-rpi3 systemd[1]: mariadb.service: control process exited, code=exited status=1 1月 13 17:34:13 centos-rpi3 systemd[1]: Failed to start MariaDB database server. 1月 13 17:34:13 centos-rpi3 systemd[1]: Unit mariadb.service entered failed state. 1月 13 17:34:13 centos-rpi3 systemd[1]: mariadb.service failed.
journalctl -u mariadb.serviceを実行すると以下のようになりました。
Last login: Sun Jan 14 09:20:32 2018 from 192.168.0.161 [root@centos-rpi3 ~]# journalctl -u mariadb.service --no-pager -- Logs begin at 木 1970-01-01 09:00:03 JST, end at 日 2018-01-14 10:21:46 JST. -- 1月 01 09:00:17 centos-rpi3 systemd[1]: Starting MariaDB database server... 1月 01 09:00:17 centos-rpi3 mariadb-prepare-db-dir[414]: Initializing MariaDB database 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: 700101 9:00:19 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 582 ... 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: [146B blob data] 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: 700101 9:00:19 [ERROR] Aborting 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: 700101 9:00:19 [Note] /usr/libexec/mysqld: Shutdown complete 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: Installation of system tables failed! Examine the logs in 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: /var/lib/mysql for more information. 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: The problem could be conflicting information in an external 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: my.cnf files. You can ignore these by doing: 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: shell> /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: You can also try to start the mysqld daemon with: 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: shell> /usr/libexec/mysqld --skip-grant --general-log & 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: and use the command line tool /usr/bin/mysql 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: to connect to the mysql database and look at the grant tables: 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: shell> /usr/bin/mysql -u root mysql 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: mysql> show tables; 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: Try 'mysqld --help' if you have problems with paths. Using 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: --general-log gives you a log in /var/lib/mysql that may be helpful. 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: The latest information about mysql_install_db is available at 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: https://mariadb.com/kb/en/installing-system-tables-mysql_install_db 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: MariaDB is hosted on launchpad; You can find the latest source and 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: email lists at http://launchpad.net/maria 1月 01 09:00:19 centos-rpi3 mariadb-prepare-db-dir[414]: Please check all of the above before submitting a bug report 1月 01 09:00:19 centos-rpi3 systemd[1]: mariadb.service: control process exited, code=exited status=1 1月 01 09:00:19 centos-rpi3 systemd[1]: Failed to start MariaDB database server. 1月 01 09:00:19 centos-rpi3 systemd[1]: Unit mariadb.service entered failed state. 1月 01 09:00:19 centos-rpi3 systemd[1]: mariadb.service failed. [root@centos-rpi3 ~]#
dfコマンドを実行するとこうなりました。
[root@centos-rpi3 ~]# df ファイルシス 1K-ブロック 使用 使用可 使用% マウント位置 /dev/root 29723628 1191688 27284044 5% / devtmpfs 470168 0 470168 0% /dev tmpfs 474776 0 474776 0% /dev/shm tmpfs 474776 12180 462596 3% /run tmpfs 474776 0 474776 0% /sys/fs/cgroup /dev/mmcblk0p1 511720 50672 461048 10% /boot tmpfs 94956 0 94956 0% /run/user/0
以下、/var/log/messagesの該当箇所です。
Jan 14 17:43:16 centos-rpi3 systemd: Starting MariaDB database server... Jan 14 17:43:16 centos-rpi3 mariadb-prepare-db-dir: Initializing MariaDB database Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: 180114 17:43:17 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 9775 ... Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: #007/usr/libexec/mysqld: Character set 'utf-8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: 180114 17:43:17 [ERROR] Aborting Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: 180114 17:43:17 [Note] /usr/libexec/mysqld: Shutdown complete Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Installation of system tables failed! Examine the logs in Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: /var/lib/mysql for more information. Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: The problem could be conflicting information in an external Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: my.cnf files. You can ignore these by doing: Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: shell> /usr/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: You can also try to start the mysqld daemon with: Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: shell> /usr/libexec/mysqld --skip-grant --general-log & Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: and use the command line tool /usr/bin/mysql Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: to connect to the mysql database and look at the grant tables: Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: shell> /usr/bin/mysql -u root mysql Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: mysql> show tables; Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Try 'mysqld --help' if you have problems with paths. Using Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: --general-log gives you a log in /var/lib/mysql that may be helpful. Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: The latest information about mysql_install_db is available at Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: https://mariadb.com/kb/en/installing-system-tables-mysql_install_db Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: MariaDB is hosted on launchpad; You can find the latest source and Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: email lists at http://launchpad.net/maria Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Please check all of the above before submitting a bug report Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: at http://mariadb.org/jira Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Initialization of MariaDB database failed. Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Perhaps @sysconfdir@/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql. Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Initialization of MariaDB database was not finished successfully. Jan 14 17:43:17 centos-rpi3 mariadb-prepare-db-dir: Files created so far will be removed. Jan 14 17:43:17 centos-rpi3 systemd: mariadb.service: control process exited, code=exited status=1 Jan 14 17:43:17 centos-rpi3 systemd: Failed to start MariaDB database server. Jan 14 17:43:17 centos-rpi3 systemd: Unit mariadb.service entered failed state. Jan 14 17:43:17 centos-rpi3 systemd: mariadb.service failed.
回答2件
あなたの回答
tips
プレビュー