MySQL ne fonctionne pas sur MacBook Pro après la restauration à partir de Time Machine

2

Je viens d'utiliser Time Machine pour restaurer mon disque dur. Cependant, je ne parviens pas à me connecter à MySQL.

Je reçois l'erreur suivante quand je tape mysql -u root -p.

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

Et je reçois ce qui suit quand je tape mysqld.

J'apprécie votre contribution. Merci d'avance.

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
shinokada
la source
J'ai téléchargé et installé une version mise à jour de MySQL à partir de la section des téléchargements.
Joshua Pinter

Réponses:

0

J'ai eu exactement le même problème après la restauration à partir d'une sauvegarde Time Machine. Je devais complètement réinstaller MySQL pour le réparer car mon /usr/local/mysql/data/mysql le répertoire était corrompu. J'ai suivi ces étapes:

  1. Déplacé com.mysql.mysql.plist sur / Bibliothèque / LaunchDaemons
  2. J'ai déplacé mon ancienne installation mysql de / usr / local vers / tmp
  3. Dernière version téléchargée de la source MySQL et installée:

     $ 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
    

Mettre à jour /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

Suivez les instructions de post-installation pour exécuter le mysql_install_db commander.

À ce stade, j'ai essayé de copier mes anciens répertoires de données dans ma nouvelle configuration, mais comme les anciens répertoires de données ne faisaient pas partie d'ibdata1, j'ai obtenu une erreur indiquant que les tables de mes anciennes bases de données n'existent pas. Il existe des solutions pour corriger le fichier ibdata1, telles que http://www.ipserverone.info/database/how-to-recover-an-orphan-innodb-database-from-ibd-file/ , mais ils impliquaient une action pour chaque table qui allait prendre trop de temps pour moi. J'ai pu recréer les bases de données et importer les données d'un vidage précédent.

littleforest
la source