1、下载MySQL5.6二进制安装包
cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.26-linux-glibc2.5-i686.tar.gz
2、添加用户和组
groupadd mysql
useradd -g mysql mysql
3、安装MySQL到/usr/local/mysql下
cd /usr/local tar -zxvf mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.26-linux-glibc2.5-x86_64 mysql cd /usr/local/mysql chown -R mysql . chgrp -R mysql .
开始安装:
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
设置系统服务
cp support-files/mysql.server /etc/init.d/mysqld
启动MySQL
service mysqld start
命令行显示”Starting MySQL.. SUCCESS!“ ,就说明MySQL安装成功并且启动成功了
4、设置root密码
mysqladmin -u root -p password "my_password"
5、设置root用户远程登陆
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'my_password' WITH GRANT OPTION;