zoukankan      html  css  js  c++  java
  • mysql源码安装(5.1)

    1. 下载mysql源码包并解压。
      wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
      tar -zxvf mysql-5.1.73
      cd mysql-5.1.73
    2. 创建用户、basedir datadir
      useradd -s /sbin/nologin  mysql
      mkdir -p /usr/local/mysql
      mkdir -p /data/mysql
      chown mysql /data/mysql
    3. 编译前的参数配置
      ./configure --prefix=/usr/local/mysql
      其中有报错信息,需要安装相对应的库文件> yum install -y gcc  yum install -y  gcc-c++   yum -y install ncurses*    yum install -y  libtermcap*
    4. 编译 make
    5. 安装 make install
    6. 复制mysql配置文件 cp support-files/my-medium.cnf /etc/my.cnf 
    7. 初始化数据库   ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql/
    8. 拷贝启动脚本 cp support-files/mysql.server /etc/init.d/mysqld
    9. 修改权限,并设置开机启动。
      chmod 755 /etc/init.d/mysqld
      chkconfig --add mysqld
      chkconfig mysqld on
    10. 启动mysql服务  /etc/init.d/mysqld start
    11. 设置mysql密码 mysqladmin -uroot password '123456'
    12. 更新环境变量
      vim /etc/profile/
      PATH=$PATH:/usr/local/mysql/bin/
      source /etc/profile/

    二,安装过程报错信息

    hecking for termcap functions library... configure: error: No curses/termcap library found
    安装:
    ncurses-devel.***.rpm 包解决
    #cd /media/CentOS_5.5_Final/CentOS/
    #ls ncurses-devel*
    找到这个包并用rpm安装。
    # rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
    (或者去下载一个ncurses-5.6.tar.gz,
    wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz 解压并安装)

    (二)
    make时出错
    ../depcomp: line 571: exec: g++: not found
    make[1]: *** [my_new.o] 错误 127
    make[1]: Leaving directory `/usr/local/src/mysql/mysql-5.1.73/mysys`
    make: *** [all-recursive] 错误 1
    解决:
    #yum install gcc-c++ 可解决问题。
    重新指定安装路径:
    #./configure --prefix=/usr/local/mysql
    make
    make install

    (三)
    初始化数据库时出错:
    # scripts/mysql_install_db --user=mysql

    #bin/mysql_install_db --basedir=/usr/local/mysql-5.1.54 --datadir=/usr/local/mysql-5.1.54/data --user=mysql
    [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-
    external-locking' instead.
    (解决方法:将my.cnf 中的'--skip-locking' 换成'--skip-external-locking' 就可以了。)

  • 相关阅读:
    手动创建分区以及软硬raid的问题
    实用小工具:VNC的安装
    安装使用xen虚拟化工具
    使用vsftp与shell实现对进程与服务状态的监控
    windows server2008下搭建ftp服务
    业界虚拟化技术分析
    Android命名规范(自定义)
    Android Paint和Color类
    Android 应用中十大常见 UX 错误
    漫谈互联网产品设计之人性的弱点,你躺枪了木有?
  • 原文地址:https://www.cnblogs.com/lin1/p/5645434.html
Copyright © 2011-2022 走看看