Environment: CentOS 6.0_x64
Open port: Edit/etc/sysconfig/iptables Add the following record and restart the firewall after saving
-A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT
One, method one: Yum installs
1. Install # yum-y install mysql-server mysql-devel mysql
Two, method two: Source code compiles installs
Create users, directories, and Modify permissions
# mkdir-p/usr/local/mysql/data
# Groupadd MySQL
# useradd-g MySQL MySQL
# Chown-r mysql.mysql/usr/local/mysql/data/
Install the required related library files
# yum install-y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cm Ake
Decompression mysql-5.5.27.tar.gz
# cd/home/software/
# TAR-ZXV Mysql-5.5.27.tar.gz
Compiling the installation
# CD mysql-5.5.27
# Cmake-dcmake_install_prefix=/usr/local/mysql
# Make && make install
# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
Initializing the database
# cd/usr/local/mysql/
# scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/
Setting up Boot
# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
# Chkconfig Mysqld on
Adding environment variables
# echo ' Export path=/usr/local/mysql/bin: $PATH ' >>/etc/profile
# Source/etc/profile
Start the MySQL service
#/etc/init.d/mysqld Start