質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.31%
MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Q&A

解決済

2回答

5250閲覧

era-rogu tuikaMySQLが起動しません。

scrollman

総合スコア83

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

0グッド

0クリップ

投稿2017/07/08 02:13

編集2017/07/08 03:17

MySQLが起動しなくなりました。

ある日、MySQLが機能しなくなっていたのを確認した為に、./mysql stop →./mysql start
をしましたがエラーが発生して起動されず。
その時のエラーも今回と同じようなものだったと思います。

とりあえずアンインストールして再インストールを図るも同じエラーが、、

なんででしょうか、、、

mysql

1mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

OS:Linux Mint 32bit
MySQL: mysql-server 5.7.18-0ubuntu0.16.04.1

やってみた事
テラテイルの過去の質問に同じトラブルがあり
そこの回答には

1.解消方法教えてくださいm(__)m

mysql.sockは自動で作成されるのでこちらを削除してください。
*pidファイルも作られてたら削除してください。

と書いてありました。
見てみたところ、mysql.sockもpidも生成されていないんです。←これは間違いでした。/var/lib/mysqlにちゃんとありました。→mysql.sockを消去。改めて./mysql start をするも同じエラーが発生

systemctl status mysql.service を実行していみる。

mysql

1/etc/init.d$ systemctl status mysql.service 2● mysql.service - MySQL Community Server 3 Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en 4 Active: activating (start-post) (Result: exit-code) since 土 2017-07-08 11:31 5 Process: 21779 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) 6 Process: 21771 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi 7 Main PID: 21779 (code=exited, status=1/FAILURE); : 21780 (mysql-systemd 8 CGroup: /system.slice/mysql.service 9 └─control 10 ├─21780 /bin/bash /usr/share/mysql/mysql-systemd-start post 11 └─21880 sleep 1 12 13 7月 08 11:31:43 DOG2 systemd[1]: Starting MySQL Community Server... 14 7月 08 11:31:43 DOG2 systemd[1]: mysql.service: Main process exited, code=exite 15lines 1-13/13 (END)

mysql

1InnoDB: Progress in percent: 2017-07-07T22:36:22.397197Z 0 [ERROR] InnoDB: Trying to access page number 278272 in space 145, space name coreprotect/wgc_block, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server. 22017-07-07T22:36:22.397210Z 0 [ERROR] InnoDB: Server exits. 32017-07-07T22:36:52.597292Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) 42017-07-07T22:36:52.597384Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000) 52017-07-07T22:36:52.798351Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 62017-07-07T22:36:52.801916Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 7733 ... 72017-07-07T22:36:52.808342Z 0 [Note] InnoDB: PUNCH HOLE support available 82017-07-07T22:36:52.808408Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 92017-07-07T22:36:52.808420Z 0 [Note] InnoDB: Uses event mutexes 102017-07-07T22:36:52.808432Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 112017-07-07T22:36:52.808443Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8 122017-07-07T22:36:52.808454Z 0 [Note] InnoDB: Using Linux native AIO 132017-07-07T22:36:52.808874Z 0 [Note] InnoDB: Number of pools: 1 142017-07-07T22:36:52.809016Z 0 [Note] InnoDB: Not using CPU crc32 instructions 152017-07-07T22:36:52.811104Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 162017-07-07T22:36:52.827113Z 0 [Note] InnoDB: Completed initialization of buffer pool 172017-07-07T22:36:52.829523Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 182017-07-07T22:36:52.843674Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 192017-07-07T22:36:52.845334Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 22488436582 202017-07-07T22:36:52.845444Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 22488445105 212017-07-07T22:36:52.846946Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 22488445105 222017-07-07T22:36:52.848503Z 0 [Note] InnoDB: Database was not shutdown normally! 232017-07-07T22:36:52.848555Z 0 [Note] InnoDB: Starting crash recovery. 242017-07-07T22:36:52.848836Z 0 [Warning] InnoDB: Page 4 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=183176] 252017-07-07T22:36:52.848853Z 0 [Warning] InnoDB: Page 5 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=254575] 262017-07-07T22:36:52.848866Z 0 [Warning] InnoDB: Page 6 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=231687] 272017-07-07T22:36:52.849812Z 0 [Warning] InnoDB: Page 34 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=196927] 282017-07-07T22:36:52.849848Z 0 [Warning] InnoDB: Page 35 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=214280] 292017-07-07T22:36:52.849860Z 0 [Warning] InnoDB: Page 36 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=233064] 302017-07-07T22:36:52.903722Z 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 34 row operations to undo 312017-07-07T22:36:52.903773Z 0 [Note] InnoDB: Trx id counter is 3117056 322017-07-07T22:36:52.903807Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

データベースが壊れてしまっているのかもしれないので、たぶんログが/var/log/mysqld.logにあるので参照してみてください。
予想通りなら、何らかの理由を吐き出した後、exitした感じのログになっていると思います。

投稿2017/07/08 03:02

yoorwm

総合スコア1305

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

scrollman

2017/07/08 03:03

ちょっと調べてみます
scrollman

2017/07/08 03:09

/var/log/mysqld.logはありませんでしたが /var/log/mysqlはありました。
scrollman

2017/07/08 03:18

InnoDB: Progress in percent: 2017-07-07T22:36:22.397197Z 0 [ERROR] InnoDB: Trying to access page number 278272 in space 145, space name coreprotect/wgc_block, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server. 2017-07-07T22:36:22.397210Z 0 [ERROR] InnoDB: Server exits. 2017-07-07T22:36:52.597292Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) 2017-07-07T22:36:52.597384Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000) 2017-07-07T22:36:52.798351Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-07-07T22:36:52.801916Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 7733 ... 2017-07-07T22:36:52.808342Z 0 [Note] InnoDB: PUNCH HOLE support available 2017-07-07T22:36:52.808408Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-07-07T22:36:52.808420Z 0 [Note] InnoDB: Uses event mutexes 2017-07-07T22:36:52.808432Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2017-07-07T22:36:52.808443Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8 2017-07-07T22:36:52.808454Z 0 [Note] InnoDB: Using Linux native AIO 2017-07-07T22:36:52.808874Z 0 [Note] InnoDB: Number of pools: 1 2017-07-07T22:36:52.809016Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2017-07-07T22:36:52.811104Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2017-07-07T22:36:52.827113Z 0 [Note] InnoDB: Completed initialization of buffer pool 2017-07-07T22:36:52.829523Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2017-07-07T22:36:52.843674Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2017-07-07T22:36:52.845334Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 22488436582 2017-07-07T22:36:52.845444Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 22488445105 2017-07-07T22:36:52.846946Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 22488445105 2017-07-07T22:36:52.848503Z 0 [Note] InnoDB: Database was not shutdown normally! 2017-07-07T22:36:52.848555Z 0 [Note] InnoDB: Starting crash recovery. 2017-07-07T22:36:52.848836Z 0 [Warning] InnoDB: Page 4 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=183176] 2017-07-07T22:36:52.848853Z 0 [Warning] InnoDB: Page 5 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=254575] 2017-07-07T22:36:52.848866Z 0 [Warning] InnoDB: Page 6 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=231687] 2017-07-07T22:36:52.849812Z 0 [Warning] InnoDB: Page 34 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=196927] 2017-07-07T22:36:52.849848Z 0 [Warning] InnoDB: Page 35 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=214280] 2017-07-07T22:36:52.849860Z 0 [Warning] InnoDB: Page 36 in the doublewrite buffer is not within space bounds: page [page id: space=145, page number=233064] 2017-07-07T22:36:52.903722Z 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 34 row operations to undo 2017-07-07T22:36:52.903773Z 0 [Note] InnoDB: Trx id counter is 3117056 2017-07-07T22:36:52.903807Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...
scrollman

2017/07/08 03:19

というログでした
yoorwm

2017/07/08 03:53

InnoDBが壊れているみたいですね。そのまま 「If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.」で検索してみた感じ、 http://artisan.hatenablog.com/entry/2014/11/22/224337 ここらへん参考にすると良いかと思います。
scrollman

2017/07/08 04:36 編集

参考にしてみました。 最初は値を1にして、MySQLの起動を行う。ダメだったら、この値を1ずつ足していき、6までMySQLが起動するまで試す。 sudo vim /etc/mysql/my.cnf [mysqld] innodb_force_recovery = 3 という記述があったのですが、 my.cnfの中にそのような部分は見当たりませんでした。 my.cnfの中はこのようになってました # # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html # # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mysql.conf.d/
yoorwm

2017/07/08 09:12

あまり見ない形式ですね。ひょっとして、書かれている/etc/mysql/conf.d /etc/mysql/mysql.conf.d/の内容を読み込むようになっているのでしょうか?
scrollman

2017/07/09 10:54

読み込むようになっていたようです。 my.cnfの設定をリカバリーモードにして起動。 破損箇所が大きかったのか、少ししかエクスポートできませんでした。 データベースのあるフォルダ諸共アンインストール→インストール→インポートで無事MySQL復旧しました ありがとうございます。
guest

0

過去の質問 を参考にされては?

投稿2017/07/08 02:17

Orlofsky

総合スコア16417

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

scrollman

2017/07/08 02:20

>1.解消方法教えてくださいm(__)m mysql.sockは自動で作成されるのでこちらを削除してください。 *pidファイルも作られてたら削除してください。 が、過去の質問の回答だと思うのですが、 .sockもpidも作られいないのです。
scrollman

2017/07/08 02:25

と思っていたのは勘違いで、 /var/lib/mysqlにちゃんとありました。
scrollman

2017/07/08 02:28

mysql.sockを発見したので消去。 ./mysql start しても同じエラーが発生しました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.31%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問