[email protected] ~]# Yum install libaio-devel-y #安装共享库
[Email protected] ~]# wget http://mirrors.sohu.com/mysql/My ... ux2.6-x86_64.tar.gz #下载MySQL二进制包
[Email protected] ~]# tar xf mysql-5.5.48-linux2.6-x86_64.tar.gz #解压二进制包
[Email protected] ~]# mv Mysql-5.5.48-linux2.6-x86_64/usr/local/mysql #将二进制包移动到安装目录
[Email protected] ~]# useradd mysql-s/sbin/nologin-m #新建MySQL用户
[Email protected] ~]# chown-r mysql.mysql/usr/local/mysql/data/ #授权MySQL用户属主
initialize MySQL
[[email protected] ~]# cd/usr/local/mysql
[[email protected] mysql]#./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/ local/mysql/data/
[Email protected] mysql]# \CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF#拷贝MySQL配置文件
[Email protected] mysql]# cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld #拷贝MySQL启动文件
[Email protected] mysql]#/etc/init.d/mysqld start #启动MySQL
[Email protected] mysql]# chkconfig mysqld on #设置开机启动
[Email protected] mysql]# vi/etc/profile.d/mysql.sh #设置mysql环境变量. Add the following content
Export path= $PATH:/usr/local/mysql/bin
[Email protected] mysql]# source/etc/profile.d/mysql.sh #执行命令使用其生效
[Email protected] mysql]#/usr/lcoal/mysql/bin/mysql_secure_installation #安全配置向导
[[email protected] mysql]# netstat-lntup|grep MySQL
TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1545/mysqld
[Email protected] mysql]# mysql-uroot-p #登录MySQL
Click copy code, Paste to command line execute.
Yum Install Libaio-devel wget-y
wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-x86_64.tar.gz
Tar XF mysql-5.5.48-linux2.6-x86_64.tar.gz
MV Mysql-5.5.48-linux2.6-x86_64/usr/local/mysql
Useradd mysql-s/sbin/nologin-m
Chown-r mysql.mysql/usr/local/mysql/data/
Cd/usr/local/mysql
./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data/
\cp/usr/local/mysql/support-files/my-small.cnf/etc/my.cnf
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
Cp-a/usr/local/mysql/bin/*/usr/local/sbin/
chmod +x/etc/init.d/mysqld
/etc/init.d/mysqld start
Chkconfig mysqld on
Mysqladmin-uroot password "AbC123456"
Mysql-uroot-p "AbC123456"
centos6.5 binary installation MySQL