How to make it possible to start a project once MySQL is not started, throw an exception or report an error when getting MySQL data?

now the company has a requirement. When a project starts, it often reports an error because the database is not started, resulting in the project cannot be started. How to make the project start without caring whether MySQL is started or not? to put it simply, when you get the data of MySQL, you can report that MySQL did not start, instead of reporting an error at the beginning. As a result, the project cannot be started because the project is not entirely dependent on MySQL, and MongoDB. Sometimes you don"t need to use MySQL,. Only some data will use MySQL.

Mar.16,2021

you need to modify your project code so that you don't create a MySQL connection when the project starts, but when you use it.
but is this really good?


has been solved. There is a configuration of Mysql in the configuration file in SprinBoot, so that the project can be started at startup if mysql does not start normally!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf863f-320eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf863f-320eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?