1. Installing the gcc-c++ gcc make CMake compiler
2. Installing ncurses
3. Add a user group
Groupadd MySQL useradd-r-g MySQL MySQL
4. Installation
TAR-ZXVF mysql-5.5.12.tar.gz cd mysql-5.5.12 cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_ Addr=/data/mysql/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_extra_charsets: String=utf8,gbk-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_memory_storage_engine=1- dwith_readline=1-denabled_local_infile=1-dmysql_datadir=/data/mysql-dmysql_user=mysql-dmysql_tcp_port=3306 Make make install
5. Configuration
CP support-files/my-medium.cnf/etc/my.cnf #如果你的机器的内存教大, can copy myhuge.cnf file chmod 755 Scripts/mysql_install_ dbscripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql--datadir=/data/mysql/ # # Initialize database cp support-files/mysql.server/etc/init.d/mysql #设置开机启动mysqlchmod 755/etc/init.d/mysqlchkconfig MySQL on #开机启动echo ' export path=/usr/local/mysql/bin: $PATH ' >>/etc/profile #将mysql的安装路径加入PATH中, Easy to start MySQL (restart in effect)/etc/init.d/mysql start #启动mysql
6. You can see if MySQL is started in the process
Ps-le | grep mysqld
NETSTAT-TUNPL | grep:3306
7. Set the MySQL password
/usr/local/mysql/bin/mysql-u Rootset PASSWORD for ' root ' @ ' localhost ' =password (' 123456 ');
Reference Document: http://blog.csdn.net/westmaniac/article/details/6535000
Http://www.linuxidc.com/Linux/2011-12/49046.htm