如何安装mysql6.0_CentOS 6.0 安装mysql-5.1.73过程

一、安装环境

CentOS-6.0-i386-minimal.iso

内核:2.6.32-71.el6.i686

mysql版本:5.1.73

二、安装步骤

useradd -M -s /sbin/nologin mysql

mkdir -p /app/tools

cd /app/tools/

tar zxf mysql-5.1.73.tar.gz

cd mysql-5.1.73

1> 开始configure

./configure \

--prefix=/usr/local/mysql \

--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \

--localstatedir=/usr/local/mysql/data \

--enable-assembler \

--enable-thread-safe-client \

--with-mysqld-user=mysql \

--with-big-tables \

--without-debug \

--with-pthread \

--enable-assembler \

--with-extra-charsets=complex \

--with-readline \

--with-ssl \

--with-embedded-server \

--enable-local-infile \

--with-plugin-PLUGIN \

--with-mysqld-ldflags=-all-static \

--with-client-ldflags=-all-static

(1)出现如:configure: error: no acceptable C compiler found in $PATH

缺少gcc

yum -y install gcc

(2)出现如:checking for termcap functions library... configure: error: No curses/termcap library found

缺少ncurses-devel

yum -y install ncurses-devel

Thank you for choosing MySQL! 结束

2> make

(1)出现如:

../depcomp: line 571: exec: g++: not found

make[1]: *** [my_new.o] 错误 127

缺少gcc-c++

yum -y install gcc-c++

重新configure在make

3>make install

三、配置mysql

[[email protected] mysql-5.1.73]# ll support-files/*.cnf

-rw-r--r--. 1 root root  4714 8月  27 16:27 support-files/my-huge.cnf

-rw-r--r--. 1 root root 19763 8月  27 16:27 support-files/my-innodb-heavy-4G.cnf

-rw-r--r--. 1 root root  4688 8月  27 16:27 support-files/my-large.cnf

-rw-r--r--. 1 root root  4699 8月  27 16:27 support-files/my-medium.cnf

-rw-r--r--. 1 root root  2467 8月  27 16:27 support-files/my-small.cnf

[[email protected] mysql-5.1.73]# /bin/cp support-files/my-small.cnf /etc/my.cnf

[[email protected] mysql-5.1.73]# mkdir -p /usr/local/mysql/data

[[email protected] mysql-5.1.73]# chown -R mysql /usr/local/mysql

[[email protected] mysql-5.1.73]# /usr/local/mysql/bin/mysql_install_db --user=mysql

四、启动mysql

/usr/local/mysql/bin/mysqld_safe &

五、配置mysql全局使用路径

[[email protected] mysql-5.1.73]# echo ‘export PATH=$PATH:/usr/local/mysql/bin‘ >>/etc/profile

[[email protected] mysql-5.1.73]# source /etc/profile

六、配置init.d启动服务

[[email protected] mysql-5.1.73]# cp support-files/mysql.server /etc/init.d/mysqld

[[email protected] mysql-5.1.73]# chmod 700 /etc/init.d/mysqld

七、设置开机启动

[[email protected] mysql-5.1.73]# chkconfig --add mysqld

[[email protected] mysql-5.1.73]# chkconfig mysqld on

[[email protected] mysql-5.1.73]# chkconfig --list mysqld

mysqld          0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

八、设置mysql密码

[[email protected] mysql-5.1.73]# mysqladmin -u root password ‘123456‘

[[email protected] mysql-5.1.73]# mysql

ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

[[email protected] mysql-5.1.73]# mysql -uroot -p

Enter password:

原文:http://liuk1303.blog.51cto.com/10449284/1688982

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值