源代码安装5.1./configure --prefix=/usr/local/mysql --with-extra-charsets=all --with-partition安装完了后:
运行 /usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --user=mysql

my.cnf 里datadir参数指定的路径内生成了两个数据库 mysql test,但是并没有任何数据表。这时启动mysql 
/usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf没成功,查看日志存在如下错误:
/usr/local/mysql/libexec/mysqld: Table 'mysql.plugin' doesn't exist
090810 11:02:56 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090810 11:02:56 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-innodb'
090810 11:02:56 [ERROR] Aborting
不知如何是好!

解决方案 »

  1.   

    我设置的安装路径 datadir=/usr/local/mysql/data/归属 mysql:root 0700 用root运行的 mysql_install_db
    觉得权限应该没有问题啊!
      

  2.   

    ll /usr/local/mysql/data/mysql 看一下这些表是否存在?
      

  3.   

    my.cnf中几个基本选项:basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data/
    user=mysql
    language=/usr/local/mysql/share/mysql/english
    tmpdir=/tmp
    log-error=/var/log/mysqld.log
    port            = 3307
    socket          = /tmp/mysql.sock
      

  4.   

    设置好这个my.cnf后我便运行 /usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --user=mysql运行后,/usr/local/mysql/data/ 出现了 mysql test两个目录,但里边都没有表!
      

  5.   

    /usr/local/mysql/data/mysql 看一下权限。
      

  6.   

    你把data目录下的所有东西删除
    把参数--defaults-file=/usr/local/mysql/my.cnf去掉,即改成下面的去试下看看:/usr/local/mysql/bin/mysql_install_db --user=mysql 
      

  7.   


    [root@localhost ~]# ls -ld /usr/local/mysql/data/mysql
    drwx------ 2 mysql root 4096 06-30 11:29 /usr/local/mysql/data/mysql
      

  8.   

    把权限都加上 chmod 777
      

  9.   


    不指定的话
    这次连 /usr/local/mysql/data/这一层目录都没生成, 但我也不知道它生成到哪了!
      

  10.   


    chmod 0777 /usr/local/mysql/data/ -R
    /usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --user=mysql可是 /usr/local/mysql/data/mysql/ 里还是没有表!
      

  11.   

    试下这个后再执行/usr/local/mysql/bin/mysql_install_db命令:chown -R mysql.mysql /usr/local/mysql/data/
      

  12.   


    试了,不过里边还是没东西!没生成相应的表!chown -R mysql.mysql /usr/local/mysql/data/
    ls /usr/local/mysql/data/ -l
    总计 8
    drwxrwxrwx 2 mysql mysql 4096 08-10 11:48 mysql
    drwxrwxrwx 2 mysql mysql 4096 08-10 11:48 testls /usr/local/mysql/data/* -l
    /usr/local/mysql/data/mysql:
    总计 0/usr/local/mysql/data/test:
    总计 0
      

  13.   

    父目录一级有没有给权限?/usr/local/mysql/data/
    /usr/local/mysql
    /usr/local
      

  14.   


    全改成mysql:mysql 0777了
      

  15.   

    my.cnf 里datadir参数指定的路径内生成了两个数据库 mysql test,但是并没有任何数据表。 这就是问题所在。
      

  16.   

    运行 /usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --user=mysql
    后的结果:/usr/local/mysql/libexec/mysqld: ignoring option '--character-set-client-handshake' due to invalid value 'gb2312'Installation of system tables failed!  Examine the logs in
    /usr/local/mysql/data/ for more information.You can try to start the mysqld daemon with:    shell> /usr/local/mysql/libexec/mysqld --skip-grant &and use the command line tool /usr/local/mysql/bin/mysql
    to connect to the mysql database and look at the grant tables:    shell> /usr/local/mysql/bin/mysql -u root mysql
        mysql> show tablesTry 'mysqld --help' if you have problems with paths.  Using --log
    gives you a log in /usr/local/mysql/data/ that may be helpful.The latest information about MySQL is available on the web at
    http://www.mysql.com/.  Please consult the MySQL manual section
    'Problems running mysql_install_db', and the manual section that
    describes problems on your OS.  Another information source are the
    MySQL email archives available at http://lists.mysql.com/.Please check all of the above before mailing us!  And remember, if
    you do mail us, you MUST use the /usr/local/mysql/scripts/mysqlbug script!
      

  17.   

    问题解决了,我系统中已经存在一个mysqld正在运行,并且占用了端口3306!我本想将新编译的例程端口设为3307,仅仅设置了[client]段中的port参数,忘了设置[mysqld]段的!应该是这个问题,我的系统里现在运行着两个mysql!
      

  18.   

    my.cnf 里datadir参数指定的路径内生成了两个数据库 mysql test,但是并没有任何数据表?
    果真如此?mysql库里面不可能没有表和数据的。另外,还要有 information_schema  数据库吧。
    你还是再安装一次吧。
      

  19.   

    只不过 information_schema 库并不形成一个单独的文件夹。