preface

Nacos uses an embedded database to store data by default if it is not configured for data persistence. What if you want to store data in a database?

persistence

Nacos 0.7 supports MySQL database, which needs to be configured. The configuration steps are as follows:

1. Create a local database: nacos_config

2. Go to the conf folder of your local nacos root directory, copy the nacos-mysql. SQL file, and run it in the database

3. Open the conf file down his application. The properties. The example (this file is only example), the data as follows, duplicate the circle of the data

4. Paste it into the application. Properties of the project, and remember to change the database address, user, and password to your local database

5. Add a new user admin and its roles to the users and Roles tables of database NACOS_config

6. Run your nacos-related project, then open the NACOS website, log in with admin account, successful! Nacos is connected to the local database