服务器PHP+MySQL开发环境搭建 — MySQL5.7 安装

1.安装mysql源

yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"

2.安装mysql

yum -y install mysql-community-server install mysql-community-devel

3.启动mysql

service mysqld start

附:重启:

service mysqld restart

4.添加免密登录

路径:/etc/my.cnf
任意行添加:skip-grant-tables (跳过验证)

5.重启登录

service mysqld restart
mysql -u root(用户名)

6.设置临时密码

update user set authentication_string=password('root123') where user='root';  

7.删除免密登录

8.重启mysql

9.用密码登录

mysql -u root -p

10.设置新密码

注:密码格式:大写小写特殊字符

alter user 'root'@'localhost' identified by 'Admin.123';

 

你可能感兴趣的:(MySQL,MySQL5.7,数据库)