1. When installing apache, it has been checked that there is no mysql native to centos installed locally. If there is any, it must be uninstalled, or the port may be occupied
2. Prepare mysql installation package (note that when compiling, the compilation of mysql 5.5 and above is different from that of mysql 5.5 and below. 5.5 needs to be compiled with cake, but the cake system does not have 6.5, so you need to download it yourself)
3. Prepare to upload the installation package xftp (before uploading, I recursively delete the useless packages of apache after installation, which saves troubles)
4. Uninstall the original version 5.1
Rpm-qa | grep-i MySQL found that it has its own version of mysql 5.1 (it is too low and needs to be uninstalled. Now the mainstream companies are all at or above version 5.5: it 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 unpacking
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 #Regardless of export path = $path: $home / bin: / usr / local / MySQL / bin: / usr / local / MySQL / Lib service mysqld start service mysqld stop
Reference resources:
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/