shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> cd /opt/
     shell> gunzip < mysql-standard-5.0.24a-linux-i686.tar.gz | tar xvf -
     shell> ln -s mysql-standard-5.0.24a-linux-i686 mysql
     shell> cd mysql
     shell> scripts/mysql_install_db --user=mysql
     shell> chown -R root  .
     shell> chown -R mysql data
     shell> chgrp -R mysql .
     shell> bin/mysqld_safe --user=mysql &

解决方案 »

  1.   

    可能是你mysql启动运行配置是/etc/my.cnf(系统本身有的,这个是rpm安装包的配置文件,里面的路径与你编译安装的路径不一样),你要用你要安装的版本的*.cnf去覆盖它,再试试.如果你想知道是什么错误,你可以到data目录打开hostname.err文件,查看一下.
    下面是我的安装过程:
    groupadd mysql
    useradd –g mysql mysql
    tar zxvf mysql-5.0.24.tar.gz
    cd mysql-5.0.24
    ./configure –prefix=/usr/local/mysql –with-charset=gb2312
    make
    make install
    cp support-files/my-medium.cnf /etc/my.cnf
    cd /usr/local/mysql
    bin/mysql_install_db –user=mysql
    chown –R mysql .
    chown –R mysql var(这里,你要到安装目录下看看生成的目录名是data,还是var)
    chgrp –R mysql .
      

  2.   

    cp support-files/my-medium.cnf /etc/my.cnf
    还是有问题:
    [root@localhost mysql]# ./bin/safe_mysqld user=mysql&
    [3] 13353
    [root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data
    STOPPING server from pid file /usr/local/mysql/data/localhost.localdomain.pid
    061013 17:31:25  mysqld ended