CentOs5.2安装Mysql5.1.32
下载mysql安装文件到/usr/local/src
groupadd mysql
useradd -g mysql -s /bin/false -M mysql
cd /usr/local/src
tar -xzvf mysql-5.1.32.tar.gz
cd mysql-5.1.32
./configure \
--prefix=/usr/local/mysql \
--enable-thread-safe-client \
--enable-local-infile \
--with-charset=gbk \
--with-extra-charsets=all \
--with-low-memory
make
make install
cp /usr/local/src/mysql-5.1.32/support-files/my-medium.cnf /etc/my.cnf
vi /etc/my.cnf
/skip-federated 找到skip-federated 前面加个#
cd /usr/local/mysql
mkdir var
chown -R mysql.mysql .
bin/mysql_install_db --user=mysql
chown -R root.root .
chown -R mysql.mysql var
bin/mysqld_safe &
netstat -ntl 查看有没有3306端口,如果有说明mysql安装成功然后再继续.
bin/mysqladmin -uroot password 新密码 mysql设置密码
cd ~
vi .bash_profile
在PATH=这行的最后加上 :/usr/local/mysql/bin 设置环境变量
cp /usr/local/src/mysql-5.1.32/support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 345 on
echo "/usr/local/mysql/lib/mysql" >> ld.so.conf
ldconfig -v
至此mysql安装结束
阅读(1477) | 评论(0) | 转发(0) |