2012-04-15 14 views
6

Ho installato mysql utilizzando homebrew.mysql-python: impossibile aprire e bloccare le tabelle dei privilegi: la tabella 'mysql.host' non esiste

Sto cercando di installare mysql-python e continuo a ricevere l'errore di seguito quando eseguo mysql.

Sono nuovo alla programmazione e non conosco abbastanza per identificare il problema.

Qualsiasi aiuto sarà apprezzato. Grazie.

TDNS-Mac-mini:~ TDNS$ easy_install mysql-python 
    /Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install:5: UserWarning: Module pkg_resources was already imported from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.pyc, but /Library/Python/2.7/site-packages/distribute-0.6.24-py2.7.egg is being added to sys.path 
     from pkg_resources import load_entry_point 
    /Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install:5: UserWarning: Module site was already imported from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc, but /Library/Python/2.7/site-packages/distribute-0.6.24-py2.7.egg is being added to sys.path 
     from pkg_resources import load_entry_point 
    Searching for mysql-python 
    Reading http://pypi.python.org/simple/mysql-python/ 
    Reading http://sourceforge.net/projects/mysql-python/ 
    Reading http://sourceforge.net/projects/mysql-python 
    Best match: MySQL-python 1.2.3 
    Downloading http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz 
    Processing MySQL-python-1.2.3.tar.gz 
    Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /var/folders/c9/xzv35t2n3ld9lgjrtl0vd0xr0000gn/T/easy_install-LsUpDW/MySQL-python-1.2.3/egg-dist-tmp-vzGMr9 
    warning: no files found matching 'MANIFEST' 
    warning: no files found matching 'ChangeLog' 
    warning: no files found matching 'GPL' 
    unable to execute gcc-4.2: No such file or directory 
    error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1 

TDNS-Mac-mini:~ TDNS$ mysqld 
     120414 22:02:41 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive 
     mysqld: Table 'mysql.plugin' doesn't exist 
     120414 22:02:41 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
     120414 22:02:41 InnoDB: The InnoDB memory heap is disabled 
     120414 22:02:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
     120414 22:02:41 InnoDB: Compressed tables use zlib 1.2.5 
     120414 22:02:41 InnoDB: Initializing buffer pool, size = 128.0M 
     120414 22:02:41 InnoDB: Completed initialization of buffer pool 
     120414 22:02:41 InnoDB: highest supported file format is Barracuda. 
     InnoDB: The log sequence number in ibdata files does not match 
     InnoDB: the log sequence number in the ib_logfiles! 
     120414 22:02:41 InnoDB: Database was not shut down normally! 
     InnoDB: Starting crash recovery. 
     InnoDB: Reading tablespace information from the .ibd files... 
     InnoDB: Restoring possible half-written data pages from the doublewrite 
     InnoDB: buffer... 
     120414 22:02:41 InnoDB: Waiting for the background threads to start 
     120414 22:02:42 InnoDB: 1.1.8 started; log sequence number 1595675 
     120414 22:02:42 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 

risposta

12

L'ho capito. Ho dimenticato di seguire le istruzioni nella parte superiore delle note di installazione homebrew nel terminale.

Hope risparmia tempo per gli altri che commettono lo stesso errore.

Set up databases to run AS YOUR USER ACCOUNT with: 
    unset TMPDIR 
    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp 

To set up base tables in another folder, or use a different user to run 
mysqld, view the help for mysqld_install_db: 
    mysql_install_db --help 

and view the MySQL documentation: 
    * http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html 
    * http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html 

To run as, for instance, user "mysql", you may need to `sudo`: 
    sudo mysql_install_db ...options... 

Start mysqld manually with: 
    mysql.server start 

    Note: if this fails, you probably forgot to run the first two steps up above 
+0

È possibile (e dovrebbe) accettare la propria risposta :) –

+0

Questo ha funzionato per me. Grazie – Akshey

+0

Grazie. Sono stato in IT per 20 anni e ancora dimentico di RTFM ... – noogrub

Problemi correlati