Solve the problem that Nacos can't connect to Mysql8.0+

If your mysql is more than 8.0 do not refer to official documents in Ali because Ali document applies only to mysql5 version, again Tucao about, Ali document is the real man !!! digging buried , only the following Is the standard configuration process

1 Initialize the mysql database, create a database named nacos_config, and then execute the nacos-mysql.sql file, which is in the conf folder of nacos, as follows
Insert picture description here

2 Create a new plugins/mysql folder under the nacos installation directory (plugins and bin, conf are at the same level), and put in the 8.0+ version of mysql-connector-java-8.0.xx.jar. The version of this jar package must be the same Your data version corresponds

3 Modify the conf/application.properties file, modify the url link, user, and password. A little trick, url can go to your idea to find the previous connection, this is foolproof, otherwise you will definitely suffer from the connection address;
Insert picture description here
paste the following paragraph to the end of the application.properties file, this is my content , Pay attention to change to your username, password and connection

spring.datasource.platform=mysql

db.num=1
db.url.0=jdbc:mysql://localhost:3306/nacos_config?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
db.user=root
db.password=123

4 Restart nacos

Guess you like

Origin blog.csdn.net/wwwwwww31311/article/details/113092735