在上一篇文章中,讲到mysql的卸载,这里谈谈mysql基于源码的安装。
1、myql下载
[root@linux download]# wget -c http://mirror.provenscaling.com/mysql/community/source/5.1/mysql-5.1.28-rc.tar.gz2、解压缩
[root@linux download]# tar mysql-5.1.28-rc
3、编译安装
[root@linux mysql-5.1.28-rc]# make && make install4、添加用户 [root@linux mysql-5.1.28-rc]# groupadd mysql
[root@linux mysql-5.1.28-rc]# useradd -s /sbin/nologin -M -g mysql mysql
5、编辑配置文件my.cnf
[root@linux ~]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[root@linux ~]# sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf
[root@linux ~]# chgrp -R mysql /usr/local/mysql/.
8、设置服务 [root@linux ~]# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql [root@linux ~]# chmod 755 /etc/init.d/mysql
[root@linux ~]# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql [root@linux ~]# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
9、启动服务 [root@linux ~]# /etc/init.d/mysql start
10.设置密码
[root@linux ~]# /usr/local/mysql/bin/mysqladmin -u root password 12345
[root@linux ~]# /etc/init.d/mysql restart