centos7 安装 mysql

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhanghanlun/article/details/79254056

1.获取mysql安装包

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

2.安装mysql

yum install mysql mysql-server

3.数据库启动,并访问

systemctl start mysqld
mysql -u root

4.授权远程访问

use mysql;
grant all privileges  on *.* to root@'%' identified by "root";
FLUSH PRIVILEGES;

5.修改登录密码

use mysql;  
update user set password=password('123') where user='root' and host='localhost';  
flush privileges;  
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页