当前位置:网站首页>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
边栏推荐
- Maxcompute string replacement function -replace
- Serial port experiment based on stm32f103zet6 library function
- Adobe Premiere foundation - time remapping (10)
- 牛客小Bai月赛52 D 环上食虫(尺取+st表)
- 3H proficient in opencv (V) - perspective transformation
- SD6.22集训总结
- 软件测试——基础理论知识你都不一定看得懂
- Relationship among controller, service and Dao
- ABC253 D FizzBuzz Sum Hard(容斥定理)
- WBF:检测任务NMS后虑框新方式?
猜你喜欢

Adobe Premiere基础-不透明度(蒙版)(十一)

jdbc_相關代碼

idea怎么使用?

Codeworks 5 questions per day (1700 for each) - the next day

Adobe Premiere基础-常用的视频特效(裁剪,黑白,剪辑速度,镜像,镜头光晕)(十五)

How QQ opens online customer service

小白月赛51 补题 E G F

Relationship among controller, service and Dao

踩坑记:JSON.parse和JSON.stringify

【网络是怎么连接的】第三章 探索集线器,交换机和路由器
随机推荐
VMware安装ESXI
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
Adobe Premiere基础-常用的视频特效(边角定位,马赛克,模糊,锐化,手写工具,效果控件层级顺序)(十六)
lodash深拷贝使用
Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题
SD6.25集训总结
3h精通OpenCV(八)-形状检测
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
3H proficient in opencv (V) - perspective transformation
Spingmvc requests and responses
Xiaobai yuesai 51 supplement e g f
3h精通OpenCV(七)-颜色检测
Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)
POJ 1975 (传递闭包)
Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)
美法官裁定,被控掩盖黑客行为的Uber前安全主管必须面对欺诈指控
idea怎么使用?
Adobe Premiere foundation - batch material import sequence - variable speed and rewind (recall) - continuous action shot switching - subtitle requirements (13)
Jar package background startup and log output