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

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

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

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

Q&A

解決済

1回答

805閲覧

MySQLが起動しない

ruby_0ct

総合スコア57

MySQL

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

0グッド

0クリップ

投稿2018/10/10 19:15

編集2018/10/11 10:54

brewでmysql@5.7を利用しています。

起動mysql.server startしようとすると、以下のエラーが表示され、起動できません。

. ERROR! The server quit without updating PID file (/usr/local/var/mysql/mac名.pid).

/var/log/mysqld.log/mysqld.log でログを確認しましたが、特に原因になるようなものは見つからず。。。

2018-10-11T10:44:13.6NZ mysqld_safe Logging to '/var/log/mysqld.log'. 2018-10-11T10:44:13.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql 2018-10-11T10:44:13.355504Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2018-10-11T10:44:13.356074Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path. 2018-10-11T10:44:13.356148Z 0 [Note] /usr/local/Cellar/mysql@5.7/5.7.23/bin/mysqld (mysqld 5.7.23) starting as process 9404 ... 2018-10-11T10:44:13.359806Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive 2018-10-11T10:44:13.362055Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-10-11T10:44:13.362144Z 0 [Note] InnoDB: Uses event mutexes 2018-10-11T10:44:13.362354Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2018-10-11T10:44:13.362414Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-10-11T10:44:13.362898Z 0 [Note] InnoDB: Number of pools: 1 2018-10-11T10:44:13.363033Z 0 [Note] InnoDB: Using CPU crc32 instructions 2018-10-11T10:44:13.365052Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2018-10-11T10:44:13.383451Z 0 [Note] InnoDB: Completed initialization of buffer pool 2018-10-11T10:44:13.402392Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800! 2018-10-11 19:44:13 0x7fff8f9f5340 InnoDB: Assertion failure in thread 140735602971456 in file ut0ut.cc line 942 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 10:44:13 UTC - mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. Attempting to collect some information that could help diagnose the problem. As this is a crash and something is definitely wrong, the information collection process might fail. key_buffer_size=8388608 read_buffer_size=131072 max_used_connections=0 max_threads=151 thread_count=0 connection_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68220 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0 thread_stack 0x40000 0 mysqld 0x00000001010e2d8e my_print_stacktrace + 58 1 mysqld 0x00000001010620b9 handle_fatal_signal + 700 2 libsystem_platform.dylib 0x00007fff56c32f5a _sigtramp + 26 3 mysqld 0x000000010192b32d _ZZL18innodb_show_statusP10handlertonP3THDPFbS2_PKcmS4_mS4_mEE13truncated_msg + 123453 4 libsystem_c.dylib 0x00007fff56a5d312 abort + 127 5 mysqld 0x00000001012d1019 _Z23ut_dbg_assertion_failedPKcS0_m + 161 6 mysqld 0x00000001012d3aea _ZN2ib5fatalD2Ev + 88 7 mysqld 0x00000001012d3b23 _ZN2ib5fatalD1Ev + 9 8 mysqld 0x000000010117bc6b _ZL18fil_node_open_fileP10fil_node_t + 2446 9 mysqld 0x00000001011853e7 _ZL23fil_node_prepare_for_ioP10fil_node_tP12fil_system_tP11fil_space_t + 191 10 mysqld 0x0000000101185acb _Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_ + 794 11 mysqld 0x000000010114c186 _ZL17buf_read_page_lowP7dberr_tbmmRK9page_id_tRK11page_size_tb + 384 12 mysqld 0x000000010114c2d6 _Z13buf_read_pageRK9page_id_tRK11page_size_t + 59 13 mysqld 0x00000001011381c8 _Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb + 953 14 mysqld 0x00000001012c0bf7 _Z31trx_rseg_get_n_undo_tablespacesPm + 262 15 mysqld 0x00000001012a487a _Z34innobase_start_or_create_for_mysqlv + 7007 16 mysqld 0x00000001011d5b7f _ZL13innobase_initPv + 3700 17 mysqld 0x0000000100b4836b _Z24ha_initialize_handlertonP13st_plugin_int + 79 18 mysqld 0x0000000100fb3503 _ZL17plugin_initializeP13st_plugin_int + 79 19 mysqld 0x0000000100fb300b _Z40plugin_register_builtin_and_init_core_sePiPPc + 653 20 mysqld 0x0000000101057b36 _Z11mysqld_mainiPPc + 2929 21 libdyld.dylib 0x00007fff569b1115 start + 1 22 ??? 0x0000000000000007 0x0 + 7 The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 2018-10-11T10:44:13.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/mac名 ended

/usr/local/etc/my.cnf

# Default Homebrew MySQL server config [mysqld] # Only allow connections from localhost bind-address = 127.0.0.1 secure-file-priv = "" socket = /tmp/mysql.sock # エラーログ log-error=/var/log/mysqld.log

以下のことは試しましたが、起動できません。
解決策を教えていただければ、幸いです。

mac 10.13.3

試したこと

  1. /private/tmp/mysql.sockの作成、権限の変更
  2. セーフ起動mysqld_safeできません。
  3. brew uninstall mysql@5.7でアンインストール。

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

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

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

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

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

guest

回答1

0

ベストアンサー

/var/log/mysql/error.logは確認しましたか?
もしログファイルがないようならば作成し、mysqlディレクトリとerror.logの所有権をsudo chown _mysql:_mysql <変更対象>で変えておいてください。
その後一旦sudo mysql server restartとしてみるとよいです。それでも起動しないなら、error.logの内容を確かめてください。

投稿2018/10/10 23:32

Udomomo

総合スコア1524

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

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

ruby_0ct

2018/10/11 15:57

ログを見ながら試行錯誤した結果、ibdata1が破損している可能性大とわかりましたので、DBを初期化してシステムデータベースを生成したことで解決しました。 ご回答ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問