[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# mkdir l
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo l
[root@localhost yum.repos.d]# mv C* l
[root@localhost yum.repos.d]# ls
l
[root@localhost yum.repos.d]# vim l.repo
[root@localhost yum.repos.d]# mount /dev/sr0 /media
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# ls
anaconda-ks.cfg initial-setup-ks.cfg 公共 视频 文档 音乐
cmake-2.8.6.tar.gz mysql-5.5.22.tar.gz 模板 图片 下载 桌面
[root@localhost ~]# yum -y install ncurses-devel
[root@localhost ~]# tar zxf cmake-2.8.6.tar.gz -C /usr/src/
[root@localhost ~]# tar zxf mysql-5.5.22.tar.gz -C /usr/src/
[root@localhost ~]# cd /usr/src
[root@localhost src]# ls
cmake-2.8.6 debug kernels mysql-5.5.22
[root@localhost cmake-2.8.6]# ./configure
[root@localhost cmake-2.8.6]# gmake && gmake install
[root@localhost cmake-2.8.6]# cd -
/usr/src
[root@localhost src]# ls
cmake-2.8.6 debug kernels mysql-5.5.22
[root@localhost mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all
[root@localhost mysql-5.5.22]# make && make install
[root@localhost mysql-5.5.22]# useradd -M -s /sbin/nologin mysql
[root@localhost mysql-5.5.22]# chown -R mysql.mysql /usr/local/mysql/
[root@localhost mysql-5.5.22]# cp support-files/my-medium.cnf /etc/my.cnf
cp:是否覆盖"/etc/my.cnf"? y
[root@localhost mysql-5.5.22]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
Installing MySQL system tables...
OK
Filling help tables...
OK
[root@localhost mysql-5.5.22]# echo "PATH=$PATH:/usr/local/mysql/bin/" >> /etc/profile
[root@localhost mysql-5.5.22]# . /etc/profile
[root@localhost mysql-5.5.22]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.5.22]# chmod +x /etc/init.d/mysqld
[root@localhost mysql-5.5.22]# chkconfig --add mysqld
[root@localhost mysql-5.5.22]# systemctl restart mysqld
[root@localhost mysql-5.5.22]# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.22-log Source distribution
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
成功