支付宝小程序踩坑经验——WebSocket的连接与关闭

栈的基本操作

  返回  

linux安装mysql教程

2021/7/20 17:05:30 浏览:

1.下载mysql源安装包
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
2.安装mysql源
shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm
3.检查mysql源是否安装成功
shell> yum repolist enabled | grep "mysql.-community."
4.修改 vim /etc/yum.repos.d/mysql-community.repo源
改变默认安装的mysql版本:比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源的enabled=0改成enabled=1即可。
5.安装MySQL
shell> yum install mysql-community-server

6.启动MySQL服务
shell> systemctl start mysqld

7.开机启动
shell> systemctl enable mysqld
shell> systemctl daemon-reload

8.修改root本地登录密码
1)查看mysql密码
shell> grep 'temporary password' /var/log/mysqld.log
2)连接mysql
shell> mysql -uroot -p
3)修改密码[注意:后面的分号一定要跟上]
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass2!';
或者:
mysql> set password for 'root'@'localhost(远程连接用%)'=password('MyNewPass2!');
(mysql8.0需要修改加密规则 ALTER USER ‘root’@‘localhost(远程连接用%)’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;
#修改加密规则 ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’; #更新一下用户的密码 )

mysql> show variables like '%password%';
9.开启远程访问权限
改表法
mysql -u root -p
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号