数据库配置-第2步

小辉的博客 / 2023-08-15 / 原文

1. 先安装mysql,需要8.0版本的,Nacos 目前只支持MySQL数据库,请安装MySQL8.0版本

在 CentOS 7 上安装 MySQL 8.0

 

2.  设置root账号任意ip访问

use mysql;
update user set host = '%' where user = 'root';
select host, user from user;
FLUSH RIVILEGES;

3. 设置大小写不敏感,要在创建数据库之前,否则mysql 8.0会启动失败

  修改MySQL 配置文件(通常位于 /etc/my.cnf 或 /etc/mysql/my.cnf)

[mysqld]
lower_case_table_names=1

然后重启mysql,重启命令为

sudo systemctl restart mysqld

4. 新建数据库nacos_config,并运行【nacos-mysql.sql】文件,初始化数据库即可。

5. 创建 `srt_cloud` 数据库,数据库编码为`utf8mb4` ,执行`db/srt_cloud.sql`文件,初始化数据库脚本