In case of an error, first of all, check whether the database can be accessed correctly through MySQL instructions:
it is found that the database can be accessed normally
later, when I observed my configuration, I found that my password was all digital. There would be a little problem with all digital passwords in the YML file, so I need to add ‘single quotation mark to correctly identify them. The correct configuration is as follows:
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/mall?useUnicode=true&characterEncoding=utf8&useOldAliasMetadataBehavior=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=UTC
username: root
password: '123456'
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
Read More:
- When the springcloud obtains the cloud link database information, an error is reported: errorcode 1045, state 28000
- System error 5 occurred in net start mysql. Access denied)
- ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mysql’
- Error code 1045, state 28000, Java sql.SQLException :Access denied for user ‘root’@’localhost’
- Get connection timeout retry: 1 MySQL errorcode 0, state 08s01 docker container accessing MySQL container is very slow and sometimes interrupted
- Error 1045 (28000) access denied for user ‘root’ @’localhost ‘appears in MySQL under Windows system
- MySQL startup problem (ERROR 1045 (28000): Access denied for user’ODBC’@’localhost’ (using password: NO))
- MySQL Access denied
- Solve MySQL error 1698 (28000): access denied for user ‘root’ @’localhost ‘
- ER_ACCESS_DENIED_ERROR: Access denied for user ‘root‘@‘localhost‘ (using password: NO)
- MySQL connection error access denied for user ‘root’ @ ‘localhost‘
- Net start mongodb failed to start: system error 5 has occurred. Access is denied
- Solve net start mysql, start MySQL service, prompt system error 5. Access denied.
- Eclipse startup error: an error has occurred.See the log file E:\workspace\.metadata\.log.
- An error occurred when MySQL backup with mysqldump instruction in MacOS system
- MySQL — initialize failed to generate temporary password in error log after initialization
- Error: could not install packages due to an environmenterror: [winerror 5] access denied.
- There is an unhandled exception at: 0xc0000005: an access conflict occurred while reading location 0x00000000.
- 【docker】 denied: requested access to the resource is denied
- Login failed with an access denied error.