1. When installing apache, it has been checked that the mysql that comes with centos is not installed locally. If there is any, it must be uninstalled, otherwise it may occupy the port.
2. Prepare the mysql installation package ( note that when compiling, the compilation of mysql version 5.5 and above is different from the compilation of version 5.5 and below. 5.5 should be compiled with cake, but cake system 6.5 is not available, you need to download it yourself )
3. Prepare the installation package for xftp upload (before uploading, I recursively deleted the useless package after the apache installation, saving the trouble)
4. Uninstall the original 5.1 version
rpm -qa | grep -i mysql found that there is a built-in version of mysql 5.1 (too low, need to be uninstalled, now mainstream companies are all in version 5.5 and above: mainly conflicts with 5.5 package )
whereis mysql
rpm -qa | grep -i mysql
service mysql stop
find / -name mysql
rm -rf /usr/lib64/mysql
rm -rf /usr/share/mysql/
rpm -qa | grep -i mysql
rpm -ev mysql-libs-5.1.73-3.el6_5.x86_64 --nodeps
6. Start unzipping the package
http://blog.163.com/sz2273_pr/blog/static/41264296201361354426670/
#yum -y install ncurses-devel
- tar -zxvf cmake-2.8.10.2.tar.gz
- cd cmake-2.8.10.2
- ./bootstrap
- gmake
- gmake install
- cd ..
- cmake --help
- cmake --version
- cp -rf ./cmake-2.8.10.2 /usr/local/cmake
- rm -rf ./cmake-2.8.10.2
- ls
- cmake --version
- groupadd mysql
- useradd -r -g mysql mysql
- tar -zxvf mysql-5.5.30.tar.gz
- cd mysql-5.5.30
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/include/libxml2 --with-config-file-path=/usr/local/apache2/conf --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd --enable-gd-native-ttf --with-zlib --with-mcrypt --with-pdo-mysql=/usr/local/mysql --enable-shmop --enable-soap --enable-sockets --enable-wddx --enable-zip --with-xmlrpc --enable-fpm --enable-mbstring --with-zlib-dir --with-bz2 --with-curl --enable-exif --enable-ftp --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/lib/
make
make install
chown -R mysql.mysql /usr/local/mysql/
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql/
/usr/local/mysql/scripts/mysql_install_db --user=mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --level 345 mysqld on
Vim /etc/profile
#Don't worry about export PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
service mysqld start
service mysqld stop
refer to:
https://blog.csdn.net/zhu_hua_jie/article/details/27077611
https://blog.csdn.net/along602/article/details/42695779
http://blog.163.com/sz2273_pr/blog/static/41264296201361354426670/