2012-04-15 15 views
6

私はhomebrewを使ってmysqlをインストールしました。mysql-python:権限テーブルを開くことができません:テーブル 'mysql.host'は存在しません

私は今、mysql-pythonをインストールしようとしています。mysqlを実行すると、以下のエラーが表示され続けます。

私はプログラミングが初めてで、問題を特定するのに十分ではありません。

ご協力いただければ幸いです。ありがとう。

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 

答えて

12

私はそれを理解しました。私は、ターミナルの自作のインストールノートの上部にある指示に従うことを忘れていました。

希望は、同じ間違いをする他の人に時間を節約します。

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

あなた自身の答えを受け入れることができます(そして、すべきです): –

+0

これは私のために働いていました。お返事ありがとうございます。 – Akshey

+0

ありがとうございます。私はITに20年勤めていて、RTFMを忘れています... – noogrub

関連する問題