The mysql upgrade from 5.5.25 to 8.0.12

The mysql upgrade from 5.5.25 to 8.0.12 encountered several problems, recorded as follows:

After the database is installed, import the original data, start tomcat, error unable to load authentication caching_sha2_plugin, the solution is as follows:

   ALTER USER 'root' @ 'localhost ' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; # modify the encryption rule 
   'root' @ 'localhost' IDENTIFIED WITH mysql_native_password BY 'password' ALTER USER; # update about the user's password 

   FLUSH PRIVILEGES; # refresh permission 

Reference: https: //blog.csdn.net/u010026255/article/details/80062153 

Internet also has said that by modifying my.ini, adding

[mysqld]
default_authentication_plugin=mysql_native_password

After my test, unsuccessful, I do not know why.

After the above problem is solved, time and Tomcat startup experience: java.math.BigInteger can not be cast to java.lang.Long, can not be type cast from biginteger to a Long, said the Internet has changed the original code, I look at the source code in the mapper file, which did not bigInteger and Long words, should be driven or iBatis resolve the problem, the drive to upgrade and mysql version 8.0.12 with the above-mentioned problems disappear, they encountered another problem "Unsupported major .minor version 52.0 "is the operating environment does not support 1.8, my development environment and runtime environment is 1.7 to 1.8 can not change, only to find the official relationship between mysql-connector-java JDK and version, the official document at:

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html

Connector/J version JDBC version MySQL Server version JRE Supported jDK Required for Compilation Status
8.0 4.2 5.6, 5.7, 8.0 1.8.x  1.8.x  General availability. Recommended version.
5.1 3.0, 4.0, 4.1, 4.2 5.6*, 5.7*, 8.0* 1.5.x, 1.6.x, 1.7.x, 1.8.x* 1.5.x and 1.8.x General availability

The figure shows more than 8.0 connector drive requires JDK1.8 support, 5.1.x version of the driver also supports 8.0. * Mysql, and then download a newer mysql-connector-java-5.1.46 (originally 5.1.21 ), tomcat start again, without being given!

When the project is running for some time, another error:

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

Online search a bit, meaning open ONLY_FULL_GROUP_BY SQL mode by default after the release of 5.7, can cause this problem, modify the my.ini, adding

[mysqld] 
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

That is, remove sql_mode in ONLY_FULL_GROUP_BY, and then restart mysql, restart TOMCAT, normal operation of the project.

Online said through set @@ sql_mode = 'STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION' modify global settings, I tested and can not succeed, some say global setting is only effective on the later of the new database. I did not verify. There is to know, please leave a message!

Conclusion is: a production environment, do not easily change the version!

Guess you like

Origin www.cnblogs.com/yesok/p/11457316.html