腾讯云服务器mysql
添加规则
[root@VM-4-8-centos ~]# cd /usr/local/src/
[root@VM-4-8-centos src]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
[root@VM-4-8-centos src]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
警告:mysql57-community-release-el7-8.noarch.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
[root@VM-4-8-centos src]# yum -y install mysql-server
失败的软件包是:mysql-community-client-5.7.39-1.el7.x86_64
GPG 密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[root@VM-4-8-centos src]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
[root@VM-4-8-centos src]# yum -y install mysql-community-server
[root@VM-4-8-centos src]# systemctl start mysqld.service
[root@VM-4-8-centos src]# grep "password" /var/log/mysqld.log
[root@VM-4-8-centos src]# mysql -u root -p
Enter password:
mysql> alter user 'root'@'localhost' identified by 'Hh123456';
Query OK, 0 rows affected (0.00 sec)
mysql> create user 'root'@'%' identified by 'Hh123456';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'%' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[root@VM-4-8-centos src]# firewall-cmd --zone=public --add-port=3306/tcp --permanent
success
[root@VM-4-8-centos src]# firewall-cmd --list-port
20/tcp 21/tcp 22/tcp 80/tcp 443/tcp 8888/tcp 39000-40000/tcp
[root@VM-4-8-centos src]# firewall-cmd --reload
success
[root@VM-4-8-centos src]# firewall-cmd --list-port
20/tcp 21/tcp 22/tcp 80/tcp 443/tcp 8888/tcp 39000-40000/tcp 3306/tcp
本文作者:ajajaz
本文链接:https://www.cnblogs.com/guozhiqiang/p/16882606.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)