GG找了很多,测试了估计要十来次吧。很麻烦。问题很复杂。
以前直接用apt-get install mysql的方式很好。但想尝试一种新的安装方法。

解决方案 »

  1.   

    tar zxvf mysql-5.1.45.tar.gz
    cd mysql-5.1.45
    ./configure --prefix=/var/lib/mysql --without-debug --with-charset=utf8 --with-extra-charsets=all  --with-plugins=all
    make
    make install
    cp support-files/my-medium.cnf /etc/my.cnf
    cd /var/lib/mysql/bin
    ./mysql_install_db --user=mysql
    chown -R root .
    cd ..
    chown -R mysql /var/
    chgrp -R mysql .
    cd ../mysql/bin/
    ./mysqld_safe --user=mysql &  ----查看err.log
    cd /var/lib/mysql/share/mysql/
    cp mysql.server /etc/init.d/mysql
    ./mysql.server start
    ./mysqld_safe --defaults-file =/etc/my.cnf
    /etc/init.d/mysql restart
    cd /var/lib/mysql/bin/
    cp mysql /usr/bin/
    我的步骤,不知道楼主看的明白不;
      

  2.   


    又杯具了……server:/var/lib/mysql/bin# ./mysql_install_db --user=mysqlFATAL ERROR: Could not find mysqldThe following directories were searched:    /usr/libexec
        /usr/sbin
        /usr/binIf you compiled from source, you need to run 'make install' to
    copy the software into the correct location ready for operation.If you are using a binary release, you must either be at the top
    level of the extracted archive, or pass the --basedir option
    pointing to that location.
      

  3.   

    我怀疑是不是和我下载的源码有关呢?
    我下的版本是:
    mysql-5.1.48.tar.gz
      

  4.   

    mysql 用户和用户组建了吗?是到:
    cd /var/lib/mysql/bin
    ./mysql_install_db --user=mysql
    这一步吗?
      

  5.   

    楼主可以把mysql的安装日志里面最后的部分贴下,这样可以判断是卡在哪一步的,mysql的安装很方便的,一点都不复杂
      

  6.   


    嗯server:/var/lib/mysql/bin# groupadd mysql
    server:/var/lib/mysql/bin# useradd -g mysql mysql
    server:/var/lib/mysql/bin# ./mysql_install_db --user=mysqlFATAL ERROR: Could not find mysqldThe following directories were searched:    /usr/libexec
        /usr/sbin
        /usr/binIf you compiled from source, you need to run 'make install' to
    copy the software into the correct location ready for operation.If you are using a binary release, you must either be at the top
    level of the extracted archive, or pass the --basedir option
    pointing to that location.
      

  7.   

    bin/mysql_install_db --user=mysql --basedir=/var/lib/mysql/ 
    这样呢?
      

  8.   


    server:/var/lib/mysql/bin# ./mysql_install_db --user=mysql --basedir=/var/lib/mysql/
    Installing MySQL system tables...
    110124 12:21:11 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
    110124 12:21:11 [ERROR] /var/lib/mysql//libexec/mysqld: unknown option '--skip-bdb'
    110124 12:21:11 [ERROR] Aborting110124 12:21:11 [Note] /var/lib/mysql//libexec/mysqld: Shutdown complete
    Installation of system tables failed!  Examine the logs in
    /var/lib/mysql for more information.You can try to start the mysqld daemon with:    shell> /var/lib/mysql//libexec/mysqld --skip-grant &and use the command line tool /var/lib/mysql//bin/mysql
    to connect to the mysql database and look at the grant tables:    shell> /var/lib/mysql//bin/mysql -u root mysql
        mysql> show tablesTry 'mysqld --help' if you have problems with paths.  Using --log
    gives you a log in /var/lib/mysql that may be helpful.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 /var/lib/mysql//scripts/mysqlbug script!
      

  9.   

    刚话了半个小时又重新编译了下,按照1楼的来,没问题..
    mysql> select version();
    +------------+
    | version()  |
    +------------+
    | 5.1.45-log |
    +------------+
    1 row in set (0.00 sec)
      

  10.   

    明天我传到csdn上吧,现在电脑上没有mysql-5.1.45.tar.gz这个包,不过不太可能是安装包的问题,楼主再仔细检查下;
      

  11.   

    我是按照你的操作一步步来的,不会有错。而且我也找了网上的一些教程操作。也不行。我还怀疑,会不会是我的VPS的问题呢?
      

  12.   

    你10楼这样的提示,应该是vps没关系.
      

  13.   

    源码包基本上不会有问题。实在不行,你完全可以在用户目录下build并install.
    这样不用创建新用户,一样可以运行。
      

  14.   


    无需root权限http://blog.csdn.net/ldb2741/archive/2010/08/20/5827571.aspx