时间:2021-07-01 10:21:17 帮助过:59人阅读
一、安装环境
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/
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
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
[root@localhost 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
[root@localhost mysql-5.1.73]# /bin/cp support-files/my-small.cnf /etc/my.cnf
[root@localhost mysql-5.1.73]# mkdir -p /usr/local/mysql/data
[root@localhost mysql-5.1.73]# chown -R mysql /usr/local/mysql
[root@localhost mysql-5.1.73]# /usr/local/mysql/bin/mysql_install_db --user=mysql
四、启动mysql
/usr/local/mysql/bin/mysqld_safe &
五、配置mysql全局使用路径
[root@localhost mysql-5.1.73]# echo ‘export PATH=$PATH:/usr/local/mysql/bin‘ >>/etc/profile
[root@localhost mysql-5.1.73]# source /etc/profile
六、配置init.d启动服务
[root@localhost mysql-5.1.73]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.1.73]# chmod 700 /etc/init.d/mysqld
七、设置开机启动
[root@localhost mysql-5.1.73]# chkconfig --add mysqld
[root@localhost mysql-5.1.73]# chkconfig mysqld on
[root@localhost mysql-5.1.73]# chkconfig --list mysqld
mysqld 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
八、设置mysql密码
[root@localhost mysql-5.1.73]# mysqladmin -u root password ‘123456‘
[root@localhost mysql-5.1.73]# mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
[root@localhost mysql-5.1.73]# mysql -uroot -p
Enter password:
本文出自 “liuk的问题解决办法” 博客,请务必保留此出处http://liuk1303.blog.51cto.com/10449284/1688982
CentOS 6.0 安装mysql-5.1.73过程
标签:mysql centos6