一、下载需要的软件:
https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.36-1.el6.x86_64.rpm-bundle.tar
二、解压
tar -xvf MySQL-5.6.36-1.el6.x86_64.rpm-bundle.tar
三、进入安装和创建指定数据库账号
1、查看并卸载自带lib
yum list installed | grep mysql
yum -y remove mysql-libs.x86_64
2、安装插件包
yum install -y libaio perl numactl
3、安装服务端和客户端(实际只需要安装这两个包)
rpm -ivh MySQL-server-5.6.36-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.36-1.el6.x86_64.rpm
4、查看密码
cat /root/.mysql_secret
5、启动mysql
service mysql start
6、加入开机启动
chkconfig mysql on
7、登录mysql
mysql -u root -p
8、修改root密码
SET PASSWORD = PASSWORD('123456');
9、创建数据库
show databases;
create database abc;
grant all privileges on abc.* to aaa@localhost identified by '123456';
flush privileges;