当前位置:网站首页>centos 7.5安装mysql 8.0.27----yum
centos 7.5安装mysql 8.0.27----yum
2022-06-29 18:04:00 【Albert__Einstein】
一、创建安装目录
mkdir /usr/local/mysql二、下载mysql8.0
切换mysql目录
cd /usr/local/mysql
下载
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
三、安装mysql
执行安装
yum -y localinstall mysql80-community-release-el7-1.noarch.rpm

yum install mysql-community-server
四、启动mysql服务
systemctl start mysqld五、mysql服务开机自启
systemctl enable mysqld
systemctl daemon-reload六、密码设置
获取默认密码
grep 'temporary password' /var/log/mysqld.log修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码(包含大小写、数字和特殊字符)';这里密码设置要求严格,否则会报错;
如果觉得密码过于复杂,可以修改限制参数,查看限制参数命令
SHOW VARIABLES LIKE 'validate_password%';修改命令
set global validate_password.length=4;
set global validate_password.policy=LOW;
等等,具体要修改哪些,根据自己的需求来定
validate_password_length 固定密码的总长度;
validate_password_dictionary_file 指定密码验证的文件路径;
validate_password_mixed_case_count 整个密码中至少要包含大/小写字母的总个数;
validate_password_number_count 整个密码中至少要包含阿拉伯数字的个数;
validate_password_policy 指定密码的强度验证等级,默认为 MEDIUM;七、授权远程登陆
创建用户
CREATE USER 'root'@'%' IDENTIFIED BY '上面设置的密码';授权
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;8、更新root密码
这里需要更新root密码,否则连接数据库时会报2058错误;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '上面设置的密码';9、端口设置
查看端口
show global variables like 'port';修改端口
1、编辑/etc/my.cnf文件 [[email protected] ~]# vi /etc/my.cnf 2、添加port=2032; 3、重启mysql [[email protected] ~]# /etc/init.d/mysqld restart
边栏推荐
- /usr/bin/ld: warning: **libmysqlclient.so.20**, needed by //usr/
- Relationship among controller, service and Dao
- EasyCVR部署服务器集群时,出现一台在线一台不在线是什么原因?
- Detailed introduction and Simulation of bitmap
- Adobe Premiere foundation - time remapping (10)
- Adobe Premiere基础-不透明度(蒙版)(十一)
- Servlet student management system (Mengxin hands-on version)
- Does rapid software delivery really need to be at the cost of security?
- Adobe Premiere基础-时间重映射(十)
- jdbc_相關代碼
猜你喜欢

Adobe Premiere foundation - time remapping (10)

Wechat applet development reserve knowledge

jdbc_ Related codes

C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad

Proxmox VE Install 7.2

NVIDIA installs the latest graphics card driver

国内酒店交易DDD应用与实践——理论篇

Adobe Premiere基础-不透明度(混合模式)(十二)

Adobe Premiere foundation - opacity (mixed mode) (XII)

Adobe Premiere基础-常用的视频特效(边角定位,马赛克,模糊,锐化,手写工具,效果控件层级顺序)(十六)
随机推荐
源码安装MAVROS
How do I add SmartArt to slides in PowerPoint?
Servlet student management system (Mengxin hands-on version)
QQ如何开通在线客服
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
MySQL -connector/j driver download
Adobe Premiere基礎-聲音調整(音量矯正,降噪,電話音,音高換擋器,參數均衡器)(十八)
markdown知识轻轻来袭
Top 30 open source software
Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)
markdown常用字体
Goldfish rhca memoirs: do447 building advanced job workflow -- using fact cache to improve performance
Goldfish rhca memoirs: do447 build advanced job workflow -- create job template survey to set work variables
Adobe Premiere foundation - cool text flash (14)
SD6.23集训总结
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
ABC253 D FizzBuzz Sum Hard(容斥定理)
POJ 1975 (transitive closure)
Request header field XXXX is not allowed by access control allow headers in preflight response
Adobe Premiere foundation - batch material import sequence - variable speed and rewind (recall) - continuous action shot switching - subtitle requirements (13)