nacos\nacos\bin> startup.cmd -m standalone
"nacos is starting with standalone"

         ,--.
       ,--.'|
   ,--,:  : |                                           Nacos 2.1.0
,`--.'`|  ' :                       ,---.               Running in stand alone mode, All function modules
|   :  :  | |                      '   ,'\   .--.--.    Port: 8848
:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 19144
|   : '  '; | /       \   /     \.   ; ,. Nacos 2.1 链接 mysql8.0报Error creating bean with name ‘memoryMonitor‘ defined in URL-小白菜博客  :  /`./   Console: http://192.168.6.1:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: Nacos 2.1 链接 mysql8.0报Error creating bean with name ‘memoryMonitor‘ defined in URL-小白菜博客  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'

2022-07-22 15:01:05,978 INFO Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@173b9122' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2022-07-22 15:01:05,984 INFO Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2022-07-22 15:01:06,557 INFO Tomcat initialized with port(s): 8848 (http)

2022-07-22 15:01:06,903 INFO Root WebApplicationContext: initialization completed in 3191 ms

2022-07-22 15:01:10,046 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memoryMonitor' defined in URL [jar:file:/G:/yangsir/soft/nacos/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-config-2.1.0.jar!/com/alibaba/nacos/config/server/monitor/MemoryMonitor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncNotifyService': Unsatisfied dependency expressed through field 'dumpService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalDumpService': Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure :
No DataSource set

解决方法:1.如下图添加:db.driver-class-name=com.mysql.cj.jdbc.Driver

(

JDBC连接Mysql5驱动名称: com.mysql.jdbc.Driver:

JDBC连接Mysql6到Mysql8+驱动名称: com.mysql.cj.jdbc.Driver

)

 2.进入mysql数据库执行如下语句:

update user set host = '%' where user = 'root';
flush privileges;