Tag Archives: mysql

Error in installing MySQL devel for CentOS MySQL

Question

Execute Yum install MySQL devel to install the development environment. An error occurs

[[email protected] software]# yum install mysql-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: mirrors.163.com
 * centos-sclo-sclo: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package mariadb-devel.i686 1:5.5.68-1.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-32) = 1:5.5.68-1.el7 for package: 1:mariadb-devel-5.5.68-1.el7.i686
--> Processing Dependency: libmysqlclient.so.18 for package: 1:mariadb-devel-5.5.68-1.el7.i686
---> Package mariadb-devel.x86_64 1:5.5.68-1.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.68-1.el7 for package: 1:mariadb-devel-5.5.68-1.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.i686 1:5.5.68-1.el7 will be installed
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be installed
Removing mariadb-libs.i686 1:5.5.68-1.el7 - u due to obsoletes from installed mysql-community-libs-5.7.34-1.el7.x86_64
Removing mariadb-libs.x86_64 1:5.5.68-1.el7 - u due to obsoletes from installed mysql-community-libs-5.7.34-1.el7.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb-libs.i686 1:5.5.68-1.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-32) = 1:5.5.68-1.el7 for package: 1:mariadb-devel-5.5.68-1.el7.i686
--> Processing Dependency: libmysqlclient.so.18 for package: 1:mariadb-devel-5.5.68-1.el7.i686
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.68-1.el7 for package: 1:mariadb-devel-5.5.68-1.el7.x86_64
--> Finished Dependency Resolution
Error: Package: 1:mariadb-devel-5.5.68-1.el7.i686 (os)
           Requires: libmysqlclient.so.18
Error: Package: 1:mariadb-devel-5.5.68-1.el7.x86_64 (os)
           Requires: mariadb-libs(x86-64) = 1:5.5.68-1.el7
Error: Package: 1:mariadb-devel-5.5.68-1.el7.i686 (os)
           Requires: mariadb-libs(x86-32) = 1:5.5.68-1.el7
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
rdma-core-devel-51mlnx1-1.51066.x86_64 has missing requires of ibacm(x86-64) = ('0', '51mlnx1', '1.51066')

reason

Because there is no MySQL source, you will be prompted to install mariadb-devel-5.5.50-1.el7 when installing MySQL devel_ 2.x86_ 64, and the system does not have mysql_ config

Solution

wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
rpm -ivh mysql57-community-release-el7-10.noarch.rpm
ls /etc/yum.repos.d/

The installation source appears

[[email protected] software]# ls /etc/yum.repos.d/
CentOS-Base.repo  CentOS-Epel.repo  CentOS-SCLo-scl.repo  CentOS-SCLo-scl-rh.repo  mysql-community.repo  mysql-community-source.repo

Continue to complete the installation

yum install mysql-devel

Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column xxxx

catalogue

Background problem analysis and solution

Background

Import the test environment data into the local database and report incorrect datetime value: '0000-00-00 00:00:00' , and the error details are as follows
[DTF] Data Transfer started
[DTF] 0> Getting tables
[DTF] 1> xx: Getting table structure
[DTF] 1> xxx: Fetching records
[DTF] 1> xx: Drop table
[DTF] 1> xx: Create table
[DTF] 1> xx: Transferring records
[ERR] 1> INSERT INTO xxx VALUES (xxxx
[ERR] 1> 1292 – Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘create_ time’ at row 373
[DTF] Process terminated

Problem analysis

Why is there 0000-00-00 00:00:00 ?

The official document states that MySQL allows’ 0000-00-00 ‘to be saved as a “pseudo date” (if no is used)_ ZERO_ Date (SQL mode). In some cases, this is more convenient than using null values (and takes less space for data and indexes).

Solution

The solution is to set sql_ Mode , cancel no_ ZERO_ DATE。 Let’s first look at SQL in the local environment_ Mode setting. Use show variables like '% SQL'_ mode%';, the results are as follows.

Value:ONLY_ FULL_ GROUP_ BY,STRICT_ TRANS_ TABLES,NO_ ZERO_ IN_ DATE,NO_ ZERO_ DATE,ERROR_ FOR_ DIVISION_ BY_ ZERO,NO_ AUTO_ CREATE_ USER,NO_ ENGINE_ SUBSTITUTION

Then look at the test environment
it is easy to find that there is no No_ ZERO_ Date . Now let's modify the my.cnf file of MySQL and modify sql_ Mode (if not, add it under [mysqld]) and remove No_ ZERO_ DATE。 The code is shown below.

sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Then import again, and you can succeed. The results are as follows

[Solved] Canal Error: CanalParseException: column size is not match,parse row data failed

1、 Background phenomenon

Background: there is a problem with the company’s flick task, and the data is not written to the result library.

So immediately check the flick task. On the web page, there are no exceptions, checkpoints and backpressure
then the problem is not my program. The spearhead is directed at environmental problems

2、 Environmental investigation

First, I checked the log printed by the task manager of Flink and found that the data was consumed for a certain period of time, and no data came in later
it means that the data is not sent to the Flink program, so there is a problem at the source
after checking Kafka, it is found that there is no message backlog and the consumption rate is normal
then the problem is not Kafka. Then it can only come from a more original place: canal

3、 Culprit canal

The operation and maintenance boss checked the canal log:

com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed.
Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed.
Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed.
Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: column size is not match for table:xxxx.xxx,22 vs 21

Obviously, this log says that a new field has been added to the database, which is inconsistent with the number of fields in the previous database. It causes an error in canal, and then the message is not sent

At that time, I thought that canal must support DDL compatibility, which must be a problem with one of canal’s settings
then I went to GitHub to find the document of canal
during the search, an issue was found. The content in the issue is similar to mine.
the key points are:

 canal.instance.filter.query.ddl = true 

Semantically speaking, it is obvious that canal filters out the DDL statements of MySQL, so it is naturally impossible to perceive that MySQL has added a new field. In this way, when a new piece of data comes after adding a field, canal will report an error if it cannot match the number of fields.

Solution

canal.instance.filter.query.ddl = false

In this way, canal can receive DDL statements and adapt to the changes after adding new fields.

(error when importing database): MySQL 2006-mysql server has gone away

Method 1 (verified to be correct):

Find the my.ini configuration file in the installation directory and add the following code:

max_allowed_packet=500M

wait_timeout=288000

interactive_timeout = 288000

The three parameters are annotated as follows:

max_ allowed_ Packet is the largest packet allowed by mysql, that is, the request you send;

wait_ Timeout is the maximum waiting time. You can customize this value. However, if the time is too short, a MySQL server has gone away #2006 error will appear after the timeout.

max_ allowed_ The packet parameter is used to control the maximum length of its communication buffer

Method 2 (online extract is not verified temporarily):

Open tools in the menu of Navicat, select server monitor, then select in the left column, and click variable in the right column to find max_ allowed_ Packet and increase its value.

In the Chinese version: in the menu, tools – & gt; Server monitoring – & gt; Tick in front of the database list on the left – & gt; Find Max in the variable on the right_ allowed_ Packet, increase the value, such as 999999999

MySQL settings are case insensitive:

MySQL under Linux is case sensitive by default. You can make MySQL case insensitive by the following settings:
1. Log in with root and modify/etc/my.cnf
2. Under the [mysqld] node, add a line: lower_ case_ table_ Names = 1
3. Restart MySQL;

Where lower_ case_ table_ The name = 1 Parameter defaults to 1 in windows and 0 in UNIX. Therefore, the problem will not be encountered in windows. Once it reaches Linux, the cause of the problem will occur (especially when MySQL names the table with uppercase letters, but when querying with uppercase letters, there will be an error that cannot be found, which is really puzzling)

View the maximum length of the communication buffer:

show global variables like ‘max_ allowed_ packet’;

The default maximum is 1m. You can modify the maximum length of the communication buffer to 16m:

set global max_ allowed_ packet=1024102416;

Query again:

Next, import again. Import succeeded!

Note: the modification is only valid for the current. If MySQL is restarted, it will still restore the original size. If you want to take effect permanently, you can modify the configuration file and add or modify the configuration in my.ini (under Windows) or my.cnf (under Linux):

max_ allowed_ packet = 16M

Restart MySQL service

Mybatis plus configuration console prints complete SQL statement with parameters

Solution
if it is application.yml

#mybatis-plus configures the console to print full SQL statements with parameters
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

If it is application.properties, add:

#mybatis-plus configures the console to print full SQL statements with parameters
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

JAVA Connect MYSQL Error: Path does not chain with any of the trust anchors

Connection address:

jdbcUrl=jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true

There is no problem with MySQL 5.5 on windows, but the connection fails on Mac.

Maybe it’s a certificate problem. Just change usessl = true to usessl = false. If you have time, please study SSL connection.

The error information is as follows:

Warning: Exception starting filter JFinalFilter
java.lang.RuntimeException: Plugin start error: com.jfinal.plugin.activerecord.ActiveRecordPlugin. 
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at com.jfinal.core.Config.startPlugins(Config.java:116)
	at com.jfinal.core.Config.configJFinal(Config.java:51)
	at com.jfinal.core.JFinal.init(JFinal.java:63)
	at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4747)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5389)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1400)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.jfinal.plugin.activerecord.ActiveRecordException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:55)
	at com.jfinal.plugin.activerecord.ActiveRecordPlugin.start(ActiveRecordPlugin.java:226)
	at com.jfinal.core.Config.startPlugins(Config.java:107)
	... 15 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 316 milliseconds ago.  The last packet sent successfully to the server was 309 milliseconds ago.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
	at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:203)
	at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4901)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1461)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1525)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:734)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1060)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1056)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:104)
	at com.jfinal.plugin.activerecord.TableBuilder.build(TableBuilder.java:43)
	... 17 more
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:328)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:322)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1614)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:188)
	... 39 more
Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:304)
	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:985)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
	... 47 more
Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
	at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:154)
	at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:80)
	at java.security.cert.CertPathValidator.validate(CertPathValidator.java:292)
	at com.mysql.jdbc.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:297)
	... 49 more

六月 03, 2018 12:36:57 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
六月 03, 2018 12:36:57 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/youpai] startup failed due to previous errors
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
警告: The web application [youpai] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
警告: The web application [youpai] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Druid-ConnectionPool-Create-683007923] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.net.SocketInputStream.socketRead0(Native Method)
 java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
 java.net.SocketInputStream.read(SocketInputStream.java:171)
 java.net.SocketInputStream.read(SocketInputStream.java:141)
 sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
 sun.security.ssl.InputRecord.read(InputRecord.java:503)
 sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
 sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
 sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
 com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:188)
 com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4901)
 com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1659)
 com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
 com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191)
 com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2222)
 com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)
 com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
 com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 java.lang.reflect.Constructor.newInstance(Constructor.java:423)
 com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
 com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
 com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1461)
 com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1525)
 com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2100)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
警告: The web application [youpai] appears to have started a thread named [Druid-ConnectionPool-Destroy-683007923] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Thread.sleep(Native Method)
 com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2172)
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
严重: The web application [youpai] created a ThreadLocal with key of type [com.jfinal.template.io.WriterBuffer$2] (value [[email protected]]) and a value of type [com.jfinal.template.io.CharWriter] (value [[email protected]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
六月 03, 2018 12:36:57 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
严重: The web application [youpai] created a ThreadLocal with key of type [com.jfinal.template.io.WriterBuffer$3] (value [[email protected]]) and a value of type [com.jfinal.template.io.FastStringWriter] (value []) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
六月 03, 2018 12:36:57 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-2018"]
六月 03, 2018 12:36:57 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
六月 03, 2018 12:36:57 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 9062 ms
六月 03, 2018 12:37:01 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading
信息: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
	at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1372)
	at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1042)
	at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
	at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Path does not chain with any of the trust anchors [Solved]

Path does not chain with any of the trust anchors exception resolution

Problem statement: JDBC. Url = JDBC: mysql://192.168.23.129:3306/ssmbuild?useSSL=true&amp ; useUnicode=true& Characterencoding = utf8
solution: change usessl = true to usessl = false
reason: according to the requirements of MySQL 5.5.45 +, 5.6.26 + and 5.7.6 +, for data security and maintenance, if you do not set explicit options, you must establish a default SSL connection (true), change it to false and turn it off

MYSQL Slave is not configured or failed to initialize properly. You must at least set –server-id

1.Background of the problem

When creating the MySQL replication link from the node, because the virtual machine is copied from a template, the server ID is the same.

2. Solutions
# edit/etc/my.cnf
vi /etc/my.cnf

# Add the following 2 lines of code
# server-id here, as long as it is not the same, my mysql master node is 1, here I set it to 2
log-bin=mysql-bin
server-id=2

#restart mysql

systemctl restart mysql

[Solved] Anaconda Error: pyqt can’t use QSqlDatabase to connect to MySQL

1. Problem description

Generally speaking, pyqt can connect to MySQL database in the following format:

self.DB = QSqlDatabase.addDatabase('QMYSQL')
self.DB.setDatabaseName("school_club") # Enter the data table you want to access
self.DB.setHostName('localhost')
self.DB.setPort(3306)
self.DB.setUserName('root')
self.DB.setPassword('') # Enter the password for your own database

However, sometimes the connection fails, and debug can’t point out the error clearly. Errors can be found in the following ways.

Method 1: check the driver attached to pyqt

print(QSqlDatabase.drivers())

If ‘qmmysql’ and ‘qmysql3’ are found missing in the driver, it indicates that the error is driver missing. You can use this method to solve the problem. Because under normal conditions, the output should be as follows:

['QSQLITE', 'QMYSQL', 'QMYSQL3', 'QODBC', 'QODBC3', 'QPSQL', 'QPSQL7']

Method 2: print error information

print(self.DB.lastError().text())

This method can also get the specific part of the connection error.

2. How to solve the lack of qmmysql driver?

The author’s pyqt is installed in Anaconda environment, so the folder path to be found by the driver is special.

The general idea is to add two DLL files: qsqlmysql.dll and libmysql.dll in pyqt related folder. At the same time, these two files must be fully matched with the relevant pyqt version.

Step 1: load qsqlmysql.dll

First, open Anaconda prompt, enter the following command line, and adjust the python version to 5.12.1 (only this version comes with qsqlmysql.dll, other versions of this DLL are too difficult to find a matching one)

pip install PyQt5==5.12.1

After this step, qsqlmysql.dll has been successfully installed in the relevant folder.

Step 2: load libmysql.dll

This is relatively easy. First, find the libmysql.dll (this is the default path for MySQL installation, and the user-defined path will be found separately) in the path of C:// program files/MySQL/MySQL server 8.0/bin, and copy it.

Take my computer as an example, paste the file to the following path:

D:\Anaconda\Anaconda\Lib\site-packages\PyQt5\Qt\bin

You can choose the appropriate path according to the relative path of the above path according to the installation location of anaconda.

Restart the programming tool and print again (QSqlDatabase. Drivers()). It is found that ‘qmmysql’ and ‘qmysql3’ have successfully appeared.

The problem of MySQL database connection failure errno: 1049 error

Today, I use phpstudy to open the MySQL database, and then connect to the database failed: the report is 1049, which means that the database does not exist.

The error is as follows
. In this CMD window, you can go all the way up to the time when you just connected the data

to see if your database name is right, but my database name is wrong
config file, which contains the

default.json file. There is a

database, fill in your own correct database name in the database, and then connect to the database after saving it

this way means success, and I hope it will help you with your mistakes!!!

Cannot resolve classpath entry: e://jar/mysql-connector-java-5.1.17-bin mybatis error in reverse engineering

error: failed: Cannot resolve classpath entry: E:\jar\mysql-connector-java-5.1.17-bin -> [Help 1]

[INFO] Scanning for projects…
[INFO]
[INFO] ————————–< pay-center:demo >—————————
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] ——————————–[ jar ]———————————
[INFO]
[INFO] — mybatis-generator-maven-plugin:1.3.2:generate (default-cli) @ demo —
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 1.043 s
[INFO] Finished at: 2021-07-01T10:31:26+08:00
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate (default-cli) on project demo: Execution default-cli of goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2:generate failed: Cannot resolve classpath entry: E:\jar\mysql-connector-java-5.1.17-bin -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
My generatorConfig.xml file looks like this, showing only the parts.



My generatorConfig.xml file looks like this, showing only the parts.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>


    <!-- Database driver: select the database driver package on your local hard disk-->
    <classPathEntry  location="E:\jar\mysql-connector-java-5.1.17-bin"/>

    <context id="DB2Tables"  targetRuntime="MyBatis3">
        <commentGenerator>
            <property name="suppressDate" value="true"/>
            <!-- Whether to remove automatically generated comments true: yes : false:no -->
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>



This database driver cannot be found problem occurs, go directly to the database driver to delete. The following figure shows the comparison of the two figures
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>

    

    <context id="DB2Tables"  targetRuntime="MyBatis3">
        <commentGenerator>
            <property name="suppressDate" value="true"/>
            <!-- Whether to remove automatically generated comments true: yes : false:no -->
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>

[Solved] error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed

Premise: I install percona-server-shared-compat-8.0.23-14.1.el8.x86 in percona server for MySQL 8.0 bundle on CentOS 8_ 64. RPM package, even if the latest version of OpenSSL (version: 1:1.1.1g-15.el8) is installed_ 3) It doesn’t help

error:Failed Dependencies
		libcrypto.so.10()(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libcrypto.so.10(libcrypto.so.10)(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libssl.so.10()(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libssl.so.10(libssl.so.10)(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm

Process : Found the library when googling
https://pkgs.org/download/libcrypto.so.10()(64bit)
I found compat-openssl10 and an explanation to the effect that compat-openssl10 contains only libraries and provides compatibility with earlier versions and software that does not support compilation with OpenSSL-1.1.

The OpenSSL toolkit provides support for secure communications between machines. This version of OpenSSL package contains only the libraries and is provided for compatibility with previous releases and software that does not support compilation with OpenSSL-1.1.

From stackoverflow, we can find that openssl provides libcrypto.so.10 without the module name, making the system think that the dependency is missing

In your case, openssl seems to provide only libcrypto.so.10 without any module name, making geramer-server believe that dependency is missing as it requires libcrypto.so.10 from module libcrypto.so.10.

https://stackoverflow.com/questions/20518183/dependency-resolution-fails-on-installed-library

Solution:
yum install compat-openssl10
or
yum install http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm

Result: