CentOS7 安装 mysql

一、下载myslq repo源mysql

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

二、安装mysql-community-release-el7-5.noarch.rpm包sql

rpm -ivh mysql-community-release-el7-5.noarch.rpm

三、安装mysqlide

yum install mysql-server

四、重启mysql服务rest

systemctl restart  mysqld.service

五、修改mysql的root默认无密码code

[root@localhost ~]# mysql -uroot
mysql> use mysql

mysql> update user set password=password('admin') where user='root';
mysql>flush privileges;

六、开机启动server

[root@localhost ~]# systemctl enable mysqld

七、设置远程访问mysqlget

mysql>  grant all privileges on *.* to 'root'@'%' identified by 'admin';
mysql> flush privileges;

以上步骤完成后再关闭防火墙it

systemctl start firewalld.service#启动firewall
systemctl stop firewalld.service#中止firewall
systemctl disable firewalld.service#禁止firewall开机启动date

相关文章
相关标签/搜索