CentOS 6下编译安装mySQL5

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 17:47 点击:

一,准备工作
     1,快速安装安装 CentOS6,安装时选择最小化安装.
     2,安装mysql编译时需要的库文件,这时可以选择做光盘yum
       [root@admin share] # cd /media/
       [root@admin media] # mkdir CentOS
       [root@admin media] # mount /dev/cdrom /media/CentOS
       [root@admin media]# cd /etc/yum.repos.d/
       [root@admin yum.repos.d] # mv CentOS-Base.repo      CentOS-Base.repo.bak
       [root@admin yum.repos.d] # mv CentOS-Debuginfo.repo    CentOS-Debuginfo.repo.bak
        至此,用光盘做的yum就可用了;
      [root@admin ~]#yum --enablerepo=c6-media install ncurses*  gcc* perl* -y
      3,准备好安装包. (这里以 mysql-5.0.56.tar.gz举例)
      4,添加mysql 用户
     [root@admin ~]#groupadd mysql
     [root@admin ~]#useradd -g mysql mysql -s /bin/nologin
 
二,正式安装
      1. [root@admin software]#tar zxvf mysql-5.0.56.tar.gz   
      2. [root@admin software]# cd mysql-5.0.56
      3. [root@admin mysql-5.0.56]# ./configure  --prefix=/usr/local/mysql  --localstatedir=/data/mysql --enable-assembler --                  enable-static --with-mysqld-user=mysql --with-big-tables --enable-thread-safe-client --                enable-local-infile --with-charset-utf8 --with-extra-charsets=all
      4. [root@admin mysql-5.0.56]# make && make install
      5. [root@admin mysql-5.0.56]# cp support-files/my-medium.cnf /etc/my.cnf
      6. [root@adim share]# cd /usr/local/mysql/
      7. [root@admin mysql]# bin/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
 
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
 
Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation
 
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
 
See the manual for more instructions.
 
You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
 
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
 
Please report any problems with the /usr/local/mysql/bin/mysqlbug script!
 
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
 
 
   8. [root@admin mysql]# chown -R mysql.mysql /data/mysql/
   9. [root@admin mysql]#  share/mysql/mysql.server start
Starting MySQL SUCCESS!     &nbs

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • mysql-mmm
      • mysqldump命令——MySQL数据库备份还原
      • Oracle数据导入MySQL的快捷工具:MySQL Migration Toolkit
      • 简简单单储存过程——循环一个select结果集
      • MySQL数据库十大优化技巧
      • Mysql主主复制架构配置
      • Mysql安装笔记
      • MySQL Stmt预处理提高效率问题的小研究
      • Mysql的Procedure 参数为NULL问题分析
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1