centos 7 安装 Mysql5.7步骤汇总

1.安装步骤:

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

如果没有wget工具,则需要运行命令进行安装:

yum -y install wget

然后继续运行以上命令进行安装。

rpm -ivh mysql57-community-release-el7-8.noarch.rpm
#如果想指定安装位置,则可以添加参数:--prefix=/usr/local/mysql
yum -y install mysql-server 

2.设置没有密码登陆。

systemctl stop mysqld
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
systemctl start mysqld
mysql -u root

此时测试下,应该可以在无密码情况下登陆mysql了。

3.修改密码

update user set authentication_string=password('***'),host='%' where user='root';
flush privileges; 
exit
systemctl unset-environment MYSQLD_OPTS

然后使用Mysql客户端工具,远程连接即可。

posted @ 2019-05-26 16:25  Shapley  阅读(198)  评论(0编辑  收藏  举报