紧急求助:我是哪个步骤错了?MySql老是启动不了!
MySql源码编译安装过程如下:    1、下载源码包: mysql-5.1.28-rc.tar.gz 
                    http://mirror.provenscaling.com/mysql/community/source/
        2、移掉老版本:
           yum -y remove mysql-server
           yum -y remove mysql
    3、解压编译安装gzip -d mysql-5.1.28-rc.tar.gz释放tar源文件到目录:mysql
tar xvf mysql-5.1.28-rc.tar// 进入源码目录
cd mysql-5.1.28-rc// 配置,指定安装到/usr/local/mysql目录下
./configure --prefix=/usr/local/mysql// 开始编译
make// 安装
make install// 加一个数据库组
groupadd mysql// 添加数据库用户 并指定到数据库组中
useradd -g mysql mysql// 复制mysql配置文件
cp support-files/my-medium.cnf /etc/my.cnf// 进入安装目录
cd /usr/local/mysql使用mysql用户 初始化数据库
bin/mysql_install_db --user=mysql// 改变当前目录的所有属主为root 
chown -R root .// 改变var的属主为mysql
chown -R mysql var
        
// 改变当前目录的属组为mysql
chgrp -R mysql .// 后台启动mysql服务 &为后台启动
bin/mysqld_safe --user=mysql &
启动mysql服务时不正常,提示如下:[root@host2 mysql]# 100322 01:12:58 mysqld_safe Logging to '/usr/local/mysql/var/host2.localdomain.err'.
100322 01:12:58 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
100322 01:12:58 mysqld_safe mysqld from pid file /usr/local/mysql/var/host2.localdomain.pid ended
[1]+  Done                    bin/mysqld_safe --user=mysql回车,跳出来, 执行mysql又出错?[root@host2 mysql]# /usr/local/mysql/bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)查了一下,/tmp/mysql.sock文件根本不存在
前面到底是哪个步骤有问题?造成后面的命令工作不正常呢?谢了。

解决方案 »

  1.   

    看看/usr/local/mysql/var/host2.localdomain.err里面的信息。
      

  2.   

    谢谢大家!我又重装了一次, 发现在初始化数据库这一步就已经出错了:[root@host2 mysql-5.1.28-rc]# scripts/mysql_install_db --user=mysql 
    Installing MySQL system tables...
    100322 18:28:30 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
    100322 18:28:30 [ERROR] Aborting100322 18:28:30 [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!因为是新手, 面对这问题不知如何解决???thanks
      

  3.   

    100322 18:28:30 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
    100322 18:28:30 [ERROR] Aborting象上面这两行错误, 如何纠正呢?
      

  4.   

    错误日志里主要是下面一些内容:100322 17:30:40 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete100322 17:30:40 mysqld_safe mysqld from pid file /usr/local/mysql/var/host2.localdomain.pid ended
    100322 17:41:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
    /usr/local/mysql/libexec/mysqld: Table 'mysql.plugin' doesn't exist
    100322 17:41:36 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    100322 17:41:36 [ERROR] /usr/local/mysql/libexec/mysqld: unknown option '--skip-federated'
    100322 17:41:36 [ERROR] Aborting