大佬教程收集整理的这篇文章主要介绍了centos安装mysql5.7,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
本文为大家分享了centOS下安装MysqL5.7详细步骤,供大家参考,具体内容如下
原文链接:https://www.code.net/article/129348.htm
第一步:
第一句检测系统是否自带安装MysqL,若有执行第二句删除系统自带的MysqL及其依赖。
第二步:
给CentOS添加rpm源,并且选择较新的源,下面代码逐句执行
1
2
3
4
5
6
7
|
yum localinstall MysqL-community-release-el6-5.noarch.rpm
yum-config-manager --disable MysqL55-community
yum-config-manager --disable MysqL56-community
|
第三步:
安装MysqL 服务器
1
|
|
第四步:
1
|
service MysqLd start
|
第五步:
查看MysqL是否自启动,并且设置开启自启动
1
2
|
chkconfig MysqLd on
|
第六步:
这一步很重要!!!
不知道从MysqL哪个版本开始,MysqL的root默认密码就不为空了,在安装的过程中默认密码保存在安装日志中了。我们要通过安装日志找到默认密码,用默认密码登陆MysqL成功后会强行让你修改密码,修改的密码还要够复杂(复合MysqL默认的密码策略)才能修改成功,一般带大小写字母特殊字符和数字超过8个字符就可以。
首先找到安装日志
1
|
find
/ -name MysqLd.log
|
然后发现该日志文件路径在 /var/log/MysqLd.log。然后用下面命令打开,按‘i‘键上翻
1
|
vim
/var/log/MysqLd
.log
|
上图红色地方就是root密码所在地
第七步:
1
|
@H_897_28@mysqL_secure_installation
|
输入上面命令进行下面步骤
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@H_995_403@
21
|
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MysqL to secure it,we‘ll need the current
so you should just press enter here.
root user without the proper authorisation.
Re-enter new password: <– 再输入一次你设置的密码
Reloading privilege tables..
… success!
By default,a MysqL installation has an anonymous user,allowing anyone
to log into MysqL without having to have a user account created
for
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous
users
? [Y
/n
] <– 是否删除匿名用户,生产环境建议删除,所以直接回车
… success!
Normally,root should only be allowed to connect from
‘localhost‘
. This
Disallow root login remotely? [Y
/n
] <–是否禁止root远程登录,根据自己的需求选择Y
/n
并回车,建议禁止
… success!
By default,MysqL comes with a database named
‘test‘
that anyone can
before moving into a production environment.
Remove
test
database and access to it? [Y
/n
] <– 是否删除
test
数据库,直接回车
- Dropping
test
database…
… success!
- Removing privileges on
test
database…
以上是大佬教程为你收集整理的centos安装mysql5.7全部内容,希望文章能够帮你解决centos安装mysql5.7所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。