Centos7 compilation and installation of MySQL5.5
Disable Firewall
Systemctlstopfirewall
Setenforce0
Check whether MySQL is installed
rpm-qa|grepmysql
[Root @ localhost ~] # Rpm-qa | grepmariadbcentos7 default database
mariadb-libs-5.5.44-1.el7_1.x86_64
[Root @ localhost ~] # Rpm-e -- nodepsmariadb-libs-5.5.44-1.el7_1 force uninstall
Install the package required for compiling code
[root@localhost~]#yum-yinstallmakegcc-c++cmakebison-develncurses-devellibaiolibaio-develperl-Data-Dumpernet-tools
Decompress and install
[root@localhost~]#tarzxfmysql-5.5.17.tar.gz
[root@localhost~]#cdmysql-5.5.17/
[root@localhostmysql-5.5.17]#cmake\
>-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\
>-DMYSQL_DATADIR=/usr/local/mysql/data\
>-DSYSCONFDIR=/etc\
>-DWITH_MYISAM_STORAGE_ENGINE=1\
>-DWITH_INNOBASE_STORAGE_ENGINE=1\
>-DWITH_MEMORY_STORAGE_ENGINE=1\
>-DWITH_READLINE=1\
>-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock\
>-DMYSQL_TCP_PORT=3306\
>-DENABLED_LOCAL_INFILE=1\
>-DWITH_PARTITION_STORAGE_ENGINE=1\
>-DEXTRA_CHARSETS=all\
>-DDEFAULT_CHARSET=utf8\
>-DDEFAULT_COLLATION=utf8_general_ci
[root@localhostmysql-5.5.17]#make&&makeinstall
Create a MySQL user group and user
[root@localhostmysql-5.5.17]#groupaddmysql
[root@localhostmysql-5.5.17]#useradd-gmysqlmysql
Modify mysql Directory Permissions
[root@localhostmysql-5.5.17]#chown-Rmysql:mysql/usr/local/mysql
Start mysql
Copy an object
[root@localhostmysql-5.5.17]#cpsupport-files/mysql.server/etc/init.d/mysql
[Root@localhostmysql-5.5.17] # chkconfigmysqlon # boot
[Root@localhostmysql-5.5.17] # servicemysqlstart # Start mysql
StartingMySQL...SUCCESS!
Netstat-lnp | grep3306 # Check Port