brew install [email protected] risulta in mysql bin mancante

5

Avevo bisogno di MySQL 5.7 installato, quindi ho eseguito brew install [email protected] .

Quando faccio brew services list vedo [email protected] started .

Quando provo mysql -uroot , ricevo un errore che non è stato possibile trovare il cestino.

Questo non è accaduto quando ho eseguito semplicemente brew install mysql , ma ovviamente il risultato è il numero di versione errato.

Output di ps -A | grep *mysql* come richiesto:

66836 ttys002    0:00.01 grep *mysql*

L'output di find / -name *mysql* è contenuto in questo elenco .

Per provare a risolvere questo problema ho eseguito questo:

ln -sfv /usr/local/opt/[email protected]/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/[email protected]

Poi l'ho aggiunto a .bash_profile e ricaricato:

export MYSQL_PATH=/usr/local/Cellar/[email protected]/5.7.22
export PATH=$PATH:$MYSQL_PATH/bin

Tuttavia, ora ricevo questo errore quando digito mysql -uroot :

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

Quando eseguo mysqld ottengo questo risultato:

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.
    
posta ShrewdSimian 22.06.2018 - 06:37
fonte

2 risposte

4

Sembra che l'installazione precedente di mysql8 abbia creato file DB non validi, che devono essere cancellati manualmente:

rm -rf /usr/local/var/mysql  # WARNING: this deletes all your data!

brew uninstall [email protected]
brew install [email protected]

Nota: questa soluzione è destinata esclusivamente alla riparazione di nuove installazioni. Risulta potenzialmente in perdita di dati.

    
risposta data 01.08.2018 - 14:17
fonte
3

Roba buona, sembra che abbiamo trovato la posizione del binario e impostato di conseguenza un percorso. Sembra che la lista dei servizi di brew non fornisca un output completamente affidabile: lo stato attuale del server.

L'errore del socket che si sta verificando dovrebbe essere dovuto al fatto che il server mysql non è in esecuzione.

L'errore sembra essere correlato alla linea di registro:

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!

Esistono alcune possibili soluzioni a questo particolare errore: Errore del server , Github , Github 2

Il suggerimento serverfault sembra ben scritto e promettente, se non funziona potresti provare le soluzioni di github.

    
risposta data 22.06.2018 - 22:48
fonte

Leggi altre domande sui tag