在ubuntu 8.04中首次用源码安装mysql-5.1.34,安装步骤为:shell> groupadd mysqlshell> useradd -g mysql mysqlshell> tar -zxvf mysql-5.1.34.tar.gzshell> cd mysql-5.1.34shell> ./configure --prefix=/usr/local/mysqlshell> makeshell> make install shell> cp support-files/my-medium.cnf /etc/my.cnfshell> cd /usr/local/mysqlshell> bin/mysql_install_db --user=mysql安装到这步出错,错误信息为:Installing MySQL system tables...
090514 15:36:52 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
090514 15:36:52 [ERROR] Aborting090514 15:36:52 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
Installation of system tables failed!  Examine the logs in
/usr/local/mysql/var 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/var 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/bin/mysqlbug script!
查了好多资料,仍不知道什么原因,请高手不吝赐教!

解决方案 »

  1.   

    /etc/my.cnf 内容是什么?datadir 所对应的目录有没有写的授权?
      

  2.   

    以前安装过其它版本的MYSQL没有?是否在安装包中有升级程序?
      

  3.   

    一般先建立库后,然后才更改权限的,所以,应该,不是“权限写”的问题“Examine the logs in 
    /usr/local/mysql/var for more information.”看看这个东东有什么说法吧
      

  4.   

    //mysql源文件:
    mysql-5.0.77-linux-i686-glibc23.tar.gz//存放路径
    存放路径:/usr/local/下//解压缩mysql源文件包
    [root@localhost local]# tar zxvf mysql-5.0.45-linux-i686-glibc23.tar.gz//修改mysql-5.0.45-linux-i686-glibc23.tar.gz目录名mysql
    [root@ localhost local]# mv mysql-5.0.45-linux-i686-glibc23 mysql//增加用户组及用户,在这一步之前,最好先执行#userdel mysql命令,确保系统中没有mysql用户。
    [root@localhost local]# groupadd mysql
    [root@localhost local]# useradd -g mysql mysql//更新/etc/my.cnf
    [root@localhost local]# cd mysql
    [root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf  
    cp: overwrite `/etc/my.cnf'? y//以mysql用户初始化数据库,创建Mysql授权表,必须以mysql用户
    [root@localhost mysql]# ./scripts/mysql_install_db --user=mysql//设置目录权限
    [root@localhost mysql]# chown -R root .
    [root@localhost mysql]# chown -R mysql data
    [root@localhost mysql]# chgrp -R mysql .//后台启动mysql
    [root@localhost mysql]# bin/mysqld_safe --user=root &
    此时如果没有出现“……ended”字样,安装完成!//查看mysql启动情况
    [root@yyxx mysql]# netstat –ant
    查看系统是否在监听3306端口!
    或直接输入mysql检查是否可以连接进行mysql。这样安装以后,重启系统,要在/usr/local/mysql目录下手动通过./bin/mysqld --user=root
    命令来启动mysql,如果想开机后就启动mysql,可以通过下面的命令进行设置,
    cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
    chkconfig --add mysql 
    chkconfig --level 2345 mysql on
    chown mysql:mysql -R /usr/local/mysql
    service mysql start
    这样,以后开机时,系统会自动启动mysql。