2022-09-27 08:10阅读: 56评论: 0推荐: 0

Centos8安装MySql

第一步:下载

wget https://dev.mysql.com/get/mysql80-community-release-el8-3.noarch.rpm

第二步:安装

yum install mysql80-community-release-el8-3.noarch.rpm

命令关闭centos8本地的mysql模块

yum module disable mysql

安装

yum -y install mysql-community-server --nogpgcheck

启动、查看、开机自启

启动MySQL:
systemctl start mysqld
查看MySQL状态:
systemctl status mysqld
开机自启
systemctl enable mysqld
重新加载系统配置,使开机自启立马有效
systemctl daemon-reload

登录 改密 远程连接

拿到临时密码:
grep 'temporary password' /var/log/mysqld.log
登录
mysql -u root -p
改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码'
刷新
flush privileges;
远程连接
换库
use mysql;
查看数据库用户
select user,host from user;
所以我们需要将他改为所有机器都能连:(或者指定为ip)
update user set host='%' where user='root';
刷新
flush privileges;

本文作者:Sherwin

本文链接:https://www.cnblogs.com/sherwin1995/p/16733204.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Sherwin_szw  阅读(56)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.