0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MySQLdが動かないので修正

Posted at

以下のmysqlのログ見るに、/var/lib/mysql

$ sudo vim /var/log/mysql/error.log
2022-07-24T10:46:07.641883Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.29-0ubuntu0.22.04.2) initializing of server in progress as process 1069697
2022-07-24T10:46:07.646856Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2022-07-24T10:46:07.646994Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2022-07-24T10:46:07.647182Z 0 [ERROR] [MY-010119] [Server] Aborting

なので、 /var/lib/mysql の中身全部消して作り直した。

$ sudo rm -rf /var/lib/mysql
$ sudo mkdir /var/lib/mysql
$ sudo chown mysql:mysql /var/lib/mysql/
$ sudo chmod 777 /var/lib/mysql
$ sudo mysqld --initialize

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?