linux mysql 8安装教程,MySQL8系列安装与配置教程(Linux环境)

以CentOS8为例进行讲解。

关闭firewalld

关闭: systemctl stop firewalld

开机禁用  : systemctl disable firewalld

使用root用户按照如下步骤执行

yum install -y wget

选择一个目录,并进行下载

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

rpm -ivh mysql80-community-release-el8-1.noarch.rpm

yum install mysql-server -y

默认安装目录 /usr/share/mysql

如果需要取消大小写敏感,请在启动mysql之前进行设置:

(1)打开mysql配置文件

vim /etc/my.cnf.d/mysql-server.cnf

(2)尾部追加一行

lower_case_table_names=1

并保存,然后再初始化数据库。

启动mysql

systemctl start mysqld

验证是否启动

systemctl status mysqld

mysql安装完成之后,默认无密码!

登录数据库:

mysql -uroot

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8 Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

重新设置root密码(红色部分密码自行修改)

alter user 'root'@'localhost' identified by 'Dongyun@8888';

use mysql;

update user set host = '%' where user = 'root';

修改加密规则(可能会报ERROR 1396 (HY000): Operation ALTER USER failed for ‘root’@’%’,再执行一次即可!)

ALTER USER 'root'@'%' IDENTIFIED BY 'Dongyun@8888' PASSWORD EXPIRE NEVER;

更新 root 用户密码(允许navicat登录)

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Dongyun@8888';

刷新权限

FLUSH PRIVILEGES;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值