1)我们拿到一个新的centos系统是先安装 ;
yum install -y wget
2)然后安装wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm (这里我们安装的是mysql7.5)
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
3)然后执行rpm -Uvh mysql-community-release-el7-5.noarch.rpm 安装完成后
rpm -Uvh mysql-community-release-el7-5.noarch.rpm
4)然后启动 systemctl start mysqld
systemctl start mysqld
5)然后查看状态systemctl ststus mysqld
systemctl ststus mysqld
6)执行 mysql -uroot 进入mysql当中
mysql -uroot
7)执行 use mysql
use mysql
8)然后配置用户和密码update user set password=password('root') where user='root';
update user set password=password('root') where user='root'
9)授权GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root'
10)然后跟新数据库flush privileges
flush privileges