若依RuoYi框架浅析 部署篇②——CentOS 8 配置MySQL 8.0
Posted 小康师兄
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了若依RuoYi框架浅析 部署篇②——CentOS 8 配置MySQL 8.0相关的知识,希望对你有一定的参考价值。
目录
一、dnf安装
二、开机自启动
三、查看状态
四、安全设置
五、开放远程连接
六、DataGrip远程连接
七、新建数据库
八、导入sql文件
参考
官方文档:Installing mysql on Linux
一、dnf安装
CentOS 8 支持dnf,dnf安装MySQL
sudo dnf install @mysql
二、开机自启动
[root@iZ2ze30dygwd6yh7gu6lskZ ~]# sudo systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
三、查看状态
[root@iZ2ze30dygwd6yh7gu6lskZ ~]# sudo systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-02-17 10:30:16 CST; 38s ago
Process: 27178 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 27052 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
Process: 27027 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 27134 (mysqld)
Status: "Server is operational"
Tasks: 39 (limit: 26213)
Memory: 429.8M
CGroup: /system.slice/mysqld.service
└─27134 /usr/libexec/mysqld --basedir=/usr
Feb 17 10:30:11 iZ2ze30dygwd6yh7gu6lskZ systemd[1]: Starting MySQL 8.0 database server...
Feb 17 10:30:11 iZ2ze30dygwd6yh7gu6lskZ mysql-prepare-db-dir[27052]: Initializing MySQL database
Feb 17 10:30:16 iZ2ze30dygwd6yh7gu6lskZ systemd[1]: Started MySQL 8.0 database server.
四、安全设置
是否进入设置:y
选择密码验证策略等级:2(强)
输入密码,确认密码
是否移除匿名用户:y
是否禁止远程登录:n
是否移除test数据库:y
是否重新载入权限表:y
五、开放远程连接
登录,输入密码
第一次输错了,第二次才输对了
[root@iZ2ze30dygwd6yh7gu6lskZ ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@iZ2ze30dygwd6yh7gu6lskZ ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 12
Server version: 8.0.21 Source distribution
Copyright (c) 2000, 2020, 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> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
六、DataGrip远程连接
七、新建数据库
八、导入sql文件
选择:RuoYi-Vuesql y_20210210.sql和quartz.sql
参考
CentOS 8 安装MySQL 8.0
以上是关于若依RuoYi框架浅析 部署篇②——CentOS 8 配置MySQL 8.0的主要内容,如果未能解决你的问题,请参考以下文章