centos7安装mysql
作者:互联网
检查:
yum list | grep mysql
(PS:据说Centos7.0的源中暂时还没有mysql,但是相同版本的Centos在阿里云是可以直接使用yum install mysql-server 来直接安装mysql的)
下载mysql的repo源:
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql-community-release-el7-5.noarch.rpm包:
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql:
yum install mysql-server
重置密码:(重置密码前,首先要登录)
mysql -u root
mysql > use mysql;
mysql > update user set password=password('密码') where user='root';
mysql > exit;
修改权限可以使其他机器登录:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION //赋予任何主机访问数据的权限
mysql>FLUSH PRIVILEGES //修改生效
mysql>EXIT //退出MySQL服务器
(腾讯云yum安装mysql_腾讯云CentOS7.0使用yum安装mysql_MySQL_雨诺寒雪的博客-CSDN博客)
标签:rpm,community,noarch,centos7,yum,mysql,安装 来源: https://www.cnblogs.com/Forelsket/p/16194379.html