当前位置:网站首页>centos8 用yum 安装MySQL 8.0.x
centos8 用yum 安装MySQL 8.0.x
2022-07-06 18:17:00 【[email protected]】
目录
第二步:用yumyum makecache把服务器的包信息下载到本地电脑缓存起来
第一步:添加MySQL Yum存储库
yum -y install https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
第二步:用yumyum makecache把服务器的包信息下载到本地电脑缓存起来
yum makecache
第三步:安装mysql
sudo yum -y install mysql-community-server
安装成功!!!!
第四步,启动mysql,并设置为开机启动
先执行它,启动成功后执行下一步设置为开机启动
systemctl start mysqld
设置开机启动
systemctl enable mysqld
第五步,更改密码
先查看默认生成的密码,默认的密码就是输出的最后[email protected]:后面的全部
sudo grep 'temporary password' /var/log/mysqld.log
登录,然后密码就是上面的那个自动生成的
mysql -uroot -p
然后接下来就是更改密码,一步步来就是了
mysql>set global validate_password.policy=0;
mysql>set global validate_password.length=4;
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password By 'newPassword'; # 修改密码
mysql>flush privileges;
mysql>update mysql.user set host = '%',plugin='mysql_native_password' where user = 'root'; # 全部主机都能访问
mysql>flush privileges;
mysql>exit;
#注意初始化的密码得必须符合长度,且必须含有数字,小写或大写字母,特殊字符。
如果下面两条报错了:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
先运行下面那一条命令。
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password By '[email protected]';
第六步,Linux登录和本地登录测试
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46504244/article/details/125589643
边栏推荐
猜你喜欢
一起看看matlab工具箱内部是如何实现BP神经网络的
454-百度面经1
Yunna | work order management software, work order management software app
JS reverse -- ob confusion and accelerated music that poked the [hornet's nest]
Modify the system time of Px4 flight control
2022/0524/bookstrap
Shell script quickly counts the number of lines of project code
AcWing 345. Cattle station solution (nature and multiplication of Floyd)
LeetCode. Sword finger offer 62 The last remaining number in the circle
JVM memory model
随机推荐
tansig和logsig的差异,为什么BP喜欢用tansig
字符串转成日期对象
HDU 4661 message passing (wood DP & amp; Combinatorics)
Hutool post requests to set the body parameter to JSON data
Today's question -2022/7/4 modify string reference type variables in lambda body
场景实践:基于函数计算快速搭建Wordpress博客系统
uva 1401 dp+Trie
PartyDAO如何在1年内把一篇推文变成了2亿美金的产品DAO
初识MySQL
Set up [redis in centos7.x]
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (上)
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (下)
AcWing 904. Wormhole solution (SPFA for negative rings)
MySQL's most basic select statement
Clickhouse fields are grouped and aggregated, and SQL is queried according to the granularity of any time period
Drag to change order
新工作感悟~辞旧迎新~
Use nodejs to determine which projects are packaged + released
AcWing 1141. LAN problem solving (kruskalkruskal finding the minimum spanning tree)
JS ES5也可以创建常量?