Recently listening to the old boy teacher video lessons, the operation of the process made notes, convenient for later use.
1. Preparation of installation Environment
wget -o/etc/Yumrepos.d/centos-base.repo http://mirrors.aliyun.com/repo/ Centos-6.repoYuminstall cmake-yuminstall ncurses-devel- -s/sbin/nologin-m MySQL
2. Compile and install MySQL 5.5.32
#mkdir/usr/local/mysql#mkdir/software# CD/software/# Tar-ZXVF mysql-5.5. +.Tar. GZ #上传文件: mysql-5.5. +.Tar. GZ to:/Software Directory # cd MySQL-5.5. +# CMake.-dcmake_install_prefix=/usr/local/MySQL-dmysql_datadir=/usr/local/mysql/Data-dmysql_unix_addr=/usr/local/mysql/tmp/Mysql.sock-ddefault_charset=UTF8-ddefault_collation=Utf8_general_ci-dextra_charsets=Gbk,gb2312,utf8,ascii-denabled_local_infile= on-dwith_innobase_storage_engine=1 -dwith_federated_storage_engine=1 -dwith_blackhole_storage_engine=1 -dwithout_example_storage_engine=1 -dwithout_partition_storage_engine=1 -dwith_fast_mutexes=1 -dwith_zlib=bundled-denabled_local_infile=1 -dwith_readline=1 -dwith_embedded_server=1 -dwith_debug=0# Make&& Make Install
3. Initialize MySQL database
#/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/Data--user=MySQL #初始化数据库 #CP/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld#====================*****========================== #修改文件:/etc/my.cnf, because my MySQL is installed in/usr/local/MySQL directory under #[mysqld]# datadir=/usr/local/mysql/data# Socket=/usr/local/mysql/tmp/Mysql.sock#===================================================# Chown-R mysql.mysql/usr/local/mysql#/etc/init.d/mysqld start #启动数据库服务 #/usr/local/mysql/bin/mysql#CP/usr/local/mysql/bin/mysql/usr/local/sbin/#把mysql客户端程序复制到/usr/local/sbin/Directory below #/usr/local/mysql/bin/mysqladmin-u Root Password'123456'#更改root用户密码 # mysql-uroot-p123456>drop User""@Lab-srv- Geneva; >drop User"Root"@":: 1"; >drop User""@"localhost";
MySQL 5.5.32 Compilation Installation