前提:
打开nacos/conf/application.properties
把下面的注释放开:
#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root
### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2
1.打开Navicat Premium
新建nacos数据库
右击nacos数据库,运行SQL文件:
进入nacos/conf/目录下,
找到mysql-schema.sql文件,
授权:
执行完之后,新建sql语句进行授权:
create user 'nacos'@'%' identified by 'nacos';
grant all privileges on nacos.* to 'nacos'@'%';