当前位置:网站首页>Solutions to common problems in database development such as MySQL

Solutions to common problems in database development such as MySQL

2022-07-06 14:22:00 Programming pebbles


One ,mysql Database correlation (java)

1,Caused by: java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

solve : Through the last sentence, we know ,JDBC 8 The time zone must be configured for the above version

So you have to connect MySQL The location of the server address ?serverTimeZone=UTC

mysql And other common problems in database development _ Common development errors

2, When creating a data table sql The default time has been added to the statement , But it also reports errors :

SQL Error:1048,SQLState:23000

Colum createtime cannot be null

mysql And other common problems in database development _ database _02

mysql And other common problems in database development _ database _03

terms of settlement : In the corresponding bean Add the following two notes

mysql And other common problems in database development _mysql_04

Two ,idea Common errors in operating the database

1,IDEA 2019.1 Connect to the database, report errors and solve them !(08001)

The error information is as follows

mysql And other common problems in database development _ Common development errors _05

The reason for this error is actually IDEA The version of the connection database driver is incorrect , Previous IDEA It uses 5.1.47 edition , So there's no problem ,2019.1.1 Version of IDEA The default is 8.0.15 So I can't connect to the database . Just change the version back to 5.1.47 To solve this problem .

Solution :

Open the database connection interface , Click on the MySQL, At this time, you will see the corresponding version on the right , At this time, just click to select the required version . My local database is MySQL5.7, choice 5.1.47 You can connect to the database . After clicking on Apply It can be applied .

New edition IDEA There may be a 2 individual MySQL Connect (MySQL and MySQL for 5.1), If you only change one, you need to use the changed one when connecting to the database , If you don't explicitly specify which one to use for connection, it's best 2 Change all of them .

mysql And other common problems in database development _ database _06

Ongoing update ......



原网站

版权声明
本文为[Programming pebbles]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131401174982.html