当前位置: 首页> 健康> 科研 > 浙江注册公司网站_龙岩市官方网站_在线刷seo_优质外链平台

浙江注册公司网站_龙岩市官方网站_在线刷seo_优质外链平台

时间:2025/9/10 2:13:01来源:https://blog.csdn.net/posetr/article/details/147231313 浏览次数:0次
浙江注册公司网站_龙岩市官方网站_在线刷seo_优质外链平台

yum安装方式

优点:操作简单易用。不用单独下载,服务器可以联网且yum源没有问题即可(可以选择国内的163/阿里源)

安装步骤:

1.关闭防火墙和selinux:

systemctl stop firewalld                 ##关闭防火墙
systemctl disable firewalld          ##禁止防火墙开机自启
setenforce  0                    ##关闭selinux
getenforce                     ##查看selinux状态

2.下载MySQL数据库的yum仓库

mysql的官方网站: www.mysql.com

[root@mysql-server ~]# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

或者下载到本地上传到服务器

3,安装MySQL的yum仓库

[root@mysql-server ~]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
[root@mysql-server ~]# yum -y install yum-utils    #安装yum工具包

4,配置yum厂库

vi /etc/yum.repos.d/mysql-community.repo 

在这里插入图片描述
1表示开启,0表示关闭

或者

yum-config-manager --enable mysql57-community   将禁用的yum源库启用
yum-config-manager --disable mysql80-community   将启用的yum源库禁用

5,安装MySQL数据库

[root@mysql-server ~]# yum install -y mysql-community-server
启动服务
[root@mysql-server ~]# systemctl start mysqld
设置开机启动
[root@mysql-server ~]# systemctl enable mysqld

6,查看系统设置的数据库密码并修改

密码保存在日志文件中
是root@localhost:后面的字符串

[root@mysql-server ~]# grep password /var/log/mysqld.log
2019-08-18T14:03:51.991454Z 1 [Note] A temporary password is generated for root@localhost: woHtkMgau9,w
修改密码:

两种方式:

第一种:
[root@mysql-server ~]# mysql -uroot -p'woHtkMgau9,w'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27
....
mysql> alter user 'root'@'localhost' identified by 'QianFeng@123';
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
[root@mysql-server ~]# mysql -uroot -p'QianFeng@123'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.27 MySQL Community Server (GPL)
...
mysql> exit
Bye
第二种:
mysqladmin -u root -p'旧密码' password '新密码'
注:修改密码必须大小写数字和特殊符号都有。

7,修改弱密码

[root@mysql-server ~]# vim /etc/my.cnf   #在最后添加如下内容
validate_password=off
[root@mysql-server ~]# systemctl restart mysqld   #重启mysql生效
可以用第二种方式修改为简单的密码:
[root@mysql-server ~]# mysqladmin -uroot -p'QianFeng@123' password 'qf123'
关键字:浙江注册公司网站_龙岩市官方网站_在线刷seo_优质外链平台

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: