MySQL non funziona su MacBook Pro dopo il ripristino da Time Machine


3

Ho appena usato Time Machine per ripristinare il mio disco rigido. Tuttavia, non riesco a collegarmi a MySQL.

Ottengo il seguente errore durante la digitazione mysql -u root -p.

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

E ottengo quanto segue quando scrivo mysqld.

Apprezzo il tuo contributo. Grazie in anticipo.

2014-04-02 11:27:56 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. 
Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-04-02 11:27:56 10635 [Warning] Can't create test file /usr/local/mysql-5.6.10-osx10.7-x86_64/data/sokada-macbook.lower-test
2014-04-02 11:27:56 10635 [Warning] Can't create test file /usr/local/mysql-5.6.10-osx10.7-x86_64/data/sokada-macbook.lower-test
2014-04-02 11:27:56 10635 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2014-04-02 11:27:56 10635 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2014-04-02 11:27:56 10635 [Note] InnoDB: The InnoDB memory heap is disabled
2014-04-02 11:27:56 10635 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-04-02 11:27:56 10635 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-04-02 11:27:56 10635 [Note] InnoDB: CPU does not support crc32 instructions
2014-04-02 11:27:56 10635 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-04-02 11:27:56 10635 [Note] InnoDB: Completed initialization of buffer pool
2014-04-02 11:27:56 10635 [ERROR] InnoDB: read can't be opened in ./ibdata1 mode
2014-04-02 11:27:56 10635 [ERROR] InnoDB: The system tablespace must be writable!
2014-04-02 11:27:56 10635 [ERROR] Plugin 'InnoDB' init function returned error.
2014-04-02 11:27:56 10635 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-04-02 11:27:56 10635 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-04-02 11:27:56 10635 [ERROR] Aborting

2014-04-02 11:27:56 10635 [Note] Binlog end
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'partition'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_INSERTED'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_METRICS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_CMP'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'INNODB_TRX'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'BLACKHOLE'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'ARCHIVE'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'MRG_MYISAM'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'MyISAM'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'MEMORY'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'CSV'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'sha256_password'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'mysql_old_password'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'mysql_native_password'
2014-04-02 11:27:56 10635 [Note] Shutting down plugin 'binlog'
2014-04-02 11:27:56 10635 [Note] mysqld: Shutdown complete

Ho scaricato e installato una versione aggiornata di MySQL dalla sezione download.
Joshua Pinter,

Risposte:



0

Ho avuto lo stesso identico problema dopo il ripristino da un backup di Time Machine. Ho dovuto reinstallare completamente MySQL per risolverlo poiché la mia /usr/local/mysql/data/mysqldirectory era corrotta. Ho seguito questi passaggi:

  1. Spostato com.mysql.mysql.plistda / Library / LaunchDaemons
  2. Ho spostato la mia vecchia installazione mysql da / usr / local in / tmp
  3. Ultima versione scaricata del sorgente MySQL e installata:

     $ cd /usr/local/src
     $ sudo wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24.tar.gz
     $ sudo tar -xzvf mysql-5.6.24.tar.gz
     $ sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.23 \ 
       -DWITH_INNOBASE_STORAGE_ENGINE=1 \
       -DDEFAULT_CHARSET=utf8 \ 
       -DDEFAULT_COLLATION=utf8_general_ci \
       -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
       -DENABLED_LOCAL_INFILE=1 .
    $ sudo make
    $ sudo install
    $ sudo ln -s /usr/local/mysql-5.6.24 /usr/local/mysql
    $ cd /usr/local/mysql
    $ sudo chown -R root .
    $ sudo chgrp -R mysql .
    $ sudo chown -R mysql data
    $ sudo scripts/mysql_install_db --user=mysql
    

Aggiornamento /usr/local/mysql/my.cnf:

    [mysqld]
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    character-set-server=utf8
    collation-server=utf8_general_ci
    character-set-client-handshake=false

Seguire le istruzioni post-installazione dall'esecuzione del mysql_install_dbcomando.

A questo punto, ho provato a copiare le mie vecchie directory dei dati nella mia nuova configurazione, ma poiché le vecchie directory dei dati non facevano parte di ibdata1, ho riscontrato un errore che le tabelle dei miei vecchi database non esistevano. Esistono soluzioni per correggere il file ibdata1, come http://www.ipserverone.info/database/how-to-recover-an-orphan-innodb-database-from-ibd-file/ , ma hanno coinvolto un azione per ogni tavolo che avrebbe impiegato troppo tempo per me. Sono stato in grado di ricreare i database e importare i dati da un dump precedente.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.