Brew Install mysql@5.7 kann über Socket keine Verbindung zum lokalen MySQL Server herstellen

3941
EcomEvo

Ich musste MySQL 5.7 auf Mac OS High Sierra installieren, damit ich lief brew install mysql@5.7.

Wenn ich sehe, brew services listsehe ich mysql@5.7 started admin /Users/admin/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist.

Ausgabe von ps -A | grep *mysql*:

66836 ttys002 0:00.01 grep *mysql* 

Die Ausgabe von find / -name *mysql*ist in diesem Kern enthalten .

Um das Problem zu beheben, habe ich Folgendes ausgeführt:

ln -sfv /usr/local/opt/mysql@5.7/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist 

Dann habe ich Folgendes hinzugefügt .bash_profileund neu geladen:

export MYSQL_PATH=/usr/local/Cellar/mysql@5.7/5.7.22 export PATH=$PATH:$MYSQL_PATH/bin 

Ich erhalte jedoch diese Fehlermeldung, wenn ich tippe mysql -uroot:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) 

Dies geschah nicht, als ich einfach lief, brew install mysqlaber das führt natürlich zu einer falschen Versionsnummer.

Wenn ich renne, mysqldbekomme ich diese Ausgabe:

2018-06-22T17:56:45.699316Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2018-06-22T17:56:45.699670Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2018-06-22T17:56:45.699751Z 0 [Note] mysqld (mysqld 5.7.22) starting as process 40311 ... 2018-06-22T17:56:45.704301Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive 2018-06-22T17:56:45.706364Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-06-22T17:56:45.706389Z 0 [Note] InnoDB: Uses event mutexes 2018-06-22T17:56:45.706396Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2018-06-22T17:56:45.706402Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-06-22T17:56:45.706834Z 0 [Note] InnoDB: Number of pools: 1 2018-06-22T17:56:45.706983Z 0 [Note] InnoDB: Using CPU crc32 instructions 2018-06-22T17:56:45.708737Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2018-06-22T17:56:45.723231Z 0 [Note] InnoDB: Completed initialization of buffer pool 2018-06-22T17:56:45.739467Z 0 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800! 2018-06-22 10:56:45 0x7fffa8587380 InnoDB: Assertion failure in thread 140736017757056 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. 17:56:45 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 0x000000010d3b710a my_print_stacktrace + 58 1 mysqld 0x000000010d337059 handle_fatal_signal + 700 2 libsystem_platform.dylib 0x00007fff70076f5a _sigtramp + 26 3 ??? 0x0000000000000000 0x0 + 0 4 libsystem_c.dylib 0x00007fff6fe141ae abort + 127 5 mysqld 0x000000010d5a3059 _Z23ut_dbg_assertion_failedPKcS0_m + 161 6 mysqld 0x000000010d5a5b2a _ZN2ib5fatalD2Ev + 88 7 mysqld 0x000000010d5a5b63 _ZN2ib5fatalD1Ev + 9 8 mysqld 0x000000010d44f13b _ZL18fil_node_open_fileP10fil_node_t + 2446 9 mysqld 0x000000010d4588ef _ZL23fil_node_prepare_for_ioP10fil_node_tP12fil_system_tP11fil_space_t + 191 10 mysqld 0x000000010d458fd3 _Z6fil_ioRK9IORequestbRK9page_id_tRK11page_size_tmmPvS8_ + 794 11 mysqld 0x000000010d41fed6 _ZL17buf_read_page_lowP7dberr_tbmmRK9page_id_tRK11page_size_tb + 384 12 mysqld 0x000000010d420026 _Z13buf_read_pageRK9page_id_tRK11page_size_t + 59 13 mysqld 0x000000010d40bfc8 _Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_tmPKcmP5mtr_tb + 953 14 mysqld 0x000000010d593357 _Z31trx_rseg_get_n_undo_tablespacesPm + 262 15 mysqld 0x000000010d576eca _Z34innobase_start_or_create_for_mysqlv + 7007 16 mysqld 0x000000010d4a8e0b _ZL13innobase_initPv + 3700 17 mysqld 0x000000010ce1d86b _Z24ha_initialize_handlertonP13st_plugin_int + 79 18 mysqld 0x000000010d288763 _ZL17plugin_initializeP13st_plugin_int + 79 19 mysqld 0x000000010d28826b _Z40plugin_register_builtin_and_init_core_sePiPPc + 653 20 mysqld 0x000000010d32cb56 _Z11mysqld_mainiPPc + 2929 21 libdyld.dylib 0x00007fff6fd68015 start + 1 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. 
4

1 Antwort auf die Frage

9
ppires

Wahrscheinlich haben Sie noch einige Verzeichnisse aus einer anderen MySQL-Installation, die nicht entfernt wurden.

Ich habe dieses Problem gelöst, indem ich Folgendes getan habe:

Deinstallieren Sie zuerst MySQL

brew uninstall mysql@5.7 

Löschen Sie die Ordner / Dateien, die nicht entfernt wurden

rm -rf /usr/local/var/mysql rm /usr/local/etc/my.cnf 

Installieren Sie mysql neu und verknüpfen Sie es

brew install mysql@5.7 brew link --force mysql@5.7 

Aktivieren Sie den Dienst und starten Sie ihn

brew services start mysql@5.7 
Vielen Dank! Das Entfernen von Ordnern / Dateien löst ein ähnliches Problem für mich mit mysql@5.5, wo `brew services list` mir sagt, dass MySQL läuft, aber ich kann keine Verbindung über Socket oder Hostnamen herstellen, wahrscheinlich weil ich zuerst eine andere MySQL-Version installiert habe. Blaise vor 5 Jahren 0
Welches Benutzerkonto soll dies sein? Ich habe versucht, es als mein Administratorkonto auszuführen (ich habe zwei - ein normales Benutzerkonto für den täglichen Gebrauch und einen Admin-Benutzer mit vollem Zugriff), aber es gibt folgende Fehlermeldung: `[admin: ~] $ brew services start` error: `mysql@5.7 Domain konnte nicht gefunden werden für Fehler: Fehler beim Ausführen; `/ bin / launchctl enable gui / 501 / homebrew.mxcl.mysql @ 5.7` wurde mit 112 beendet.` FooBar vor 5 Jahren 0
Wie auch immer, es wurde erfolgreich mit meinem normalen Benutzerkonto gestartet, aber der folgende Fehler tritt auf, wenn ich versuche, in die Datenbank zu mysql zu gelangen: `ERROR 2002 (HY000): Verbindung zum lokalen MySQL-Server über Socket '/tmp/mysql.sock' nicht möglich ( 2) ` FooBar vor 5 Jahren 0