O MySQL não funciona no MacBook Pro após a restauração do Time Machine

2

Acabei de usar o Time Machine para restaurar meu disco rígido. No entanto, não consigo me conectar ao MySQL.

Eu recebo o seguinte erro quando digito mysql -u root -p .

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

E obtenho o seguinte quando digito mysqld .

Agradeço sua opinião. Agradecemos antecipadamente.

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
    
por shinokada 02.04.2014 / 02:10

2 respostas

0

Eu instalei o mysql seguindo isto e instale-o usando o seguinte comando.

bash <(curl -Ls http://git.io/eUx7rg)
    
por 02.04.2014 / 15:17
0

Eu tive exatamente o mesmo problema após a restauração de um backup do Time Machine. Eu tive que reinstalar completamente o MySQL para corrigi-lo, pois meu diretório /usr/local/mysql/data/mysql estava corrompido. Eu segui estes passos:

  1. Movido com.mysql.mysql.plist de / Library / LaunchDaemons
  2. Transferiu minha instalação antiga do mysql de / usr / local para / tmp
  3. Baixou a última versão do código-fonte do MySQL e instalou:

     $ 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
    

Atualizar /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

Siga as instruções de pós-instalação da execução do comando mysql_install_db .

Neste ponto, tentei copiar meus diretórios de dados antigos para minha nova configuração, mas como os diretórios de dados antigos não faziam parte do ibdata1, recebi um erro dizendo que as tabelas dos meus bancos de dados antigos não existiam. Existem soluções para corrigir o arquivo ibdata1, como link , mas eles envolviam uma ação para cada mesa que demoraria muito tempo para mim. Consegui recriar os bancos de dados e importar os dados de um dump anterior.

    
por 07.04.2015 / 23:08