wordpressインストール時に下記エラーが発生した

180513 12:21:34 [ERROR] mysqld: Incorrect information in file: ‘./mysql/tables_priv.frm’

少し調べて原因が不明だったのでmysqlを初期化した



初期化方法としては/var/lib/mysql以下を全て削除し、mysql_install_dbを実行

[root@test ~]# cd /var/lib/mysql/
[root@test mysql]# rm -fR *
[root@test mysql]# su – mysql
最終ログイン: 2018/05/13 (日) 12:26:09 JST日時 pts/0
-bash-4.2$ mysql_install_db –datadir=/var/lib/mysql
Installing MariaDB/MySQL system tables in ‘/var/lib/mysql’ …
180513 12:27:59 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 6692 …
OK
Filling help tables…
180513 12:27:59 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 6701 …
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

‘/usr/bin/mysqladmin’ -u root password ‘new-password’
‘/usr/bin/mysqladmin’ -u root -h test.testserver.jp password ‘new-password’

Alternatively you can run:
‘/usr/bin/mysql_secure_installation’

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd ‘/usr’ ; /usr/bin/mysqld_safe –datadir=’/var/lib/mysql’

You can test the MariaDB daemon with mysql-test-run.pl
cd ‘/usr/mysql-test’ ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB’s strong and vibrant community:

Get Involved

尚、サービスが起動せずに上記手順を実施した場合、mysql.sockがなくて下記エラーが発生する

180513 12:29:48 [Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.5.56-MariaDB’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MariaDB Server