编译安装MySQL


1.安装cmake
1)下载cmake 源码
cmake-2.8.5.tar.gz
2)解压cmake
#tar -zvxf cmake-2.8.5.tar.gz
3)配置编译
#cd cmake-2.8.5
#./configure
#make
#make install

 

0.下载RPM源码包
MySQL-5.5.15-1.rhel5.src.rpm

1.安装RPM源码包
cd /opt/software/MySQL/
ls -la
rpm -ivh MySQL-5.5.15-1.rhel5.src.rpm


2.查看打包后的包
cd /usr/src/redhat/SOURCES/
ls -la


3.编译和制作RPM包
cd /usr/src/redhat/SPECS/
ls -la
rpmbuild -ba mysql.5.5.15.spec


4.查编译结果
cd /usr/src/redhat/RPMS/i386/
ls -la

5.安装编译后的RPM包
rpm -ivh  MySQL-client-5.5.15-1.linux2.6.i386.rpm
rpm -ivh  MySQL-devel-5.5.15-1.linux2.6.i386.rpm
rpm -ivh  MySQL-shared-5.5.15-1.linux2.6.i386.rpm
rpm -ivh  MySQL-test-5.5.15-1.linux2.6.i386.rpm
rpm -ivh  MySQL-server-5.5.15-1.linux2.6.i386.rpm


6.更改密码
/usr/bin/mysqladmin -u root password 'zyx'
/usr/bin/mysqladmin -u root -h CentOS.smartmap password 'zyx'
/usr/bin/mysql_secure_installation

cp /usr/src/redhat/BUILD/mysql-5.5.15/release/support-files/my-medium.cnf /etc/my.cnf

cp /usr/src/redhat/BUILD/mysql-5.5.15/release/support-files/mysql.server /etc/init.d/mysql.server

 

 

update table user set Host='%';

posted @ 2013-02-04 15:27  ParamousGIS  阅读(214)  评论(0编辑  收藏  举报