Tag Archives: database

How to Solve DB2 uses Limit Error

preface

Prepare DB2 to use a simple limit query, and the result reports an error
Baidu has a wave. The previous articles are of no use at all, but they still report errors
later, we finally found a correct one and recorded a wave.

Text

SQL sample for DB2:

select * from sname.usertable fetch first 10 rows only

DB2 uses fetch first 10 rows only to return the first 10 rows of data
MySQL uses limit 10 to return the first 10 rows of data
Oracle uses rownum & lt= 10 returns the first 10 rows of data.

How to Solve canal & MYSQL or “Kafka cannot consume data” Error

Error 1: interaction between canal and MySQL

Explanation: the essential reason is that the same IP generates too many interrupted database connections (exceeding the maximum value of max_connect_errors) in a short time

If the MySQL server continuously receives requests from the same host, and all these continuous requests are unsuccessful, the established connection will be interrupted. When the cumulative value of these continuous requests is greater than When you set the value of max_connect_errors, the MySQL server will block all subsequent requests from this host.

Solution:   Mysqladmin flush hosts – H 127.0.0.1 – uroot – P password

Error 2: Kafka cannot consume data

Reason: the number of partitions of the theme I created is insufficient. You can manually add the same number of partitions as those set in instance.properties in conf/example of canal

Execute the following command:

//1. View the subject details and the number of partitions

kafka-topics.sh –bootstrap-server hadoop102:9092 –describe –topic ODS_BASE_DB_C

//2. Manually add the number of partitions

kafka-topics.sh –bootstrap-server hadoop102:9092 –alter –partitions 4 –topic ODS_BASE_DB_C

[Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)

MYSQL Startup error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)

[root@iZ2zei01n7f2wrecqn5249Z ~]# sudo service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysqladmin -u root password '123456'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@iZ2zei01n7f2wrecqn5249Z ~]# sudo mysqladmin -u root password '123456'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@iZ2zei01n7f2wrecqn5249Z ~]# lsof -i:3306
-bash: lsof: command not found
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -uroot -h 127.0.0.1 -p
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -uroot -h 127.0.0.1 -p
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[root@iZ2zei01n7f2wrecqn5249Z ~]# netstat -ntlp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      950/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      969/master          
tcp6       0      0 ::1:25                  :::*                    LISTEN      969/master          
[root@iZ2zei01n7f2wrecqn5249Z ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@iZ2zei01n7f2wrecqn5249Z ~]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2021-11-01 19:27:48 CST; 14s ago
  Process: 1724 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 1664 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 1723 (mysqld_safe)
   CGroup: /system.slice/mysqld.service
           ├─1723 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─1890 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/...

Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Support MySQL by buying support/licenses at http://shop.mysql.com
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Note: new default config file not created.
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Please make sure your config file is current
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: WARNING: Default config file /etc/my.cnf exists on the system
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: This file will be read by default by the MySQL server
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: If you do not want to use this, either remove it, or use the
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: --defaults-file argument to mysqld_safe when starting the server
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysqld_safe[1723]: 211101 19:27:47 mysqld_safe Logging to '/var/log/mysqld.log'.
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysqld_safe[1723]: 211101 19:27:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Nov 01 19:27:48 iZ2zei01n7f2wrecqn5249Z systemd[1]: Started MySQL Community Server.

Start it.

service mysqld start

Recheck status

service mysqld status

Just as shown above
set the password

mysqladmin -u root password '123456'

Sign in

mysql -u root -p

General error: 2006 MySQL server has gone away [How to Solve]

Congratulations on your journey;

There are many reasons for this. Let’s not talk about the others. Let’s talk about the problems that occurred today; Eliminate the problem of the database itself (my MySQL does not go down at this time.) it is the problem of the program. This problem is that the process always exists, but it has not operated the database for too long, resulting in the disconnection of the database, but suddenly a piece of data comes. At this time, the process will not re link the database, but use the original link (disconnected at this time), so there is no way to find the database, so this error is reported.

Solution:

$round = mt_rand(1, 10);
if ($round == 6) {
    // Query a sql to avoid unavailability of the process due to connection timeout
    $dividend = Db::query("select id from think_member_group where  `id` = 1");
}

A random number. The core of this method is to let your process check the database every few seconds so that the link will not be disconnected.

MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha

MYSQL Use cmd to change root password error:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(“123456”) where user = “root”‘ at line 1

Prompt for SQL syntax error
Change the password with another command

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

Modified successfully

SVN Update Error Please execute the ‘Cleanup‘ command [How to Solve]

Question

SVN Update Error: Please execute the ‘Cleanup’ command

Detailed description
when using SVN to update files, you will encounter failure (maybe because the last pull was forcibly interrupted). You will be prompted to need cleanup, but when you clean up, you will be prompted that the folder has been locked. At this time, you go to release lock, but still fail. You will be prompted to please execute the ‘cleanup’ command. (TMD is really difficult to use)

Solution:
obviously, this cannot be operated because the SVN file is locked and needs to be released, but manual release does not work, so you need to enter the SVN root directory where the locked folder is located, and then set the hidden files to be visible find the .SVN folder, and link wc.db with database management tools such as Navicat, DataGrid and other ides. This is a SQLite database. Find WC_Lock table

Delete locked records and submit updates to the database
it’s OK to update the code or file again

error: XML error: target ‘vdb‘ duplicated for disk sources ‘aaa.img‘ and ‘bbb.img‘

On a Sunday morning when you want to learn, try adding a hard disk to the KVM virtual machine with the command line.
create a disk
#qemu-img create – F qcow2/home/KVM FS/sy-b80915disk1.qcow2 10g

Bind disk to domain: sy-b80915
#virsh attach disk sy-b80915/home/KVM FS/sy-b80915disk1.qcow2 VDB — live — config

Later, I tried to unbind the VDA of the main disk. As a result, I accidentally unbind the VDA of the main disk
#virsh detach disk sy-b80915 VDA — live — config

But I unbound VDB, namely sy-b80915disk1.qcow2
#virsh detach disk sy-b80915 VDB — live — config

The virtual machine can still be restarted and used normally later, but I think the name of sy-b80915disk1.qcow2 is not good. Delete and recreate sy-b80915vdb.qcow2
#rm – RF/home/KVM/sy-b80915disk1.qcow2
#qemu-img create – F qcow2/home/KVM FS/sy-b80915vdb.qcow2 10g

Then bind
#virsh attach disk sy-b80915/home/KVM FS/sy-b80915vdb.qcow2 VDB — live — config
the results are as follows:
error: XML error: target ‘VDB’ duplicated for disk sources’ sy-b80915disk1. Img ‘and’ sy-b80915vdb. Img ‘
the big idea is to bind repeatedly, but it has been unbound before.

The only exception is that the main disk VDA is unbound accidentally, but the system can still run. So I checked the XML file. Compared with other virtual machines, I found that the XML file of SY – b80915 lacks the main disk VDA. When unbinding the VDA, the XML file is changed. So add VDA to the XML file again
execute the following command to edit the XML file:
#virsh edit sy-b80915
repair the XML definition of VDA, as shown in Figure 1:

Figure 1

Then bind sy-b80915vdb.qcow2 again. Success
#virsh attach-disk sy-B80915 /home/kvm-fs/sy-B80915vdb.qcow2 vdb –live –config

2021-10-30 .spi.CommandAcceptanceException: Error executing DDL


```java
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table Books (bookId varchar(255) not null auto_increment, bName varchar(255), primary key (bookId)) engine=MyISAM" via JDBC Statement
	at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:562) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:507) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:277) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:71) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:184) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:318) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:468) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1259) [hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) [spring-orm-5.3.12.jar:5.3.12]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) [spring-orm-5.3.12.jar:5.3.12]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) [spring-orm-5.3.12.jar:5.3.12]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) [spring-orm-5.3.12.jar:5.3.12]
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) [spring-orm-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.12.jar:5.3.12]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.12.jar:5.3.12]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.12.jar:5.3.12]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.12.jar:5.3.12]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.6.jar:2.5.6]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.6.jar:2.5.6]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.6.jar:2.5.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.6.jar:2.5.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.6.jar:2.5.6]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.6.jar:2.5.6]
	at com.example.library.LibraryApplication.main(LibraryApplication.java:10) ~[classes/:na]
Caused by: java.sql.SQLSyntaxErrorException: Incorrect column specifier for column 'bookId'
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.27.jar:8.0.27]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.27.jar:8.0.27]
	at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:768) ~[mysql-connector-java-8.0.27.jar:8.0.27]
	at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:653) ~[mysql-connector-java-8.0.27.jar:8.0.27]
	at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
	at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.4.32.Final.jar:5.4.32.Final]
	... 34 common frames omitted

When using JPA to create a table, crazy errors are reported. It is clear that it is copying the last configuration file. How to report errors
I’ve been Baidu for most of the day. The reason is that some fields use database keywords
but it’s obviously impossible

 @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String bookId;
    @Column(updatable = false)
    private String bName;

In fact, because the ID field should be of integer type, I wrote it as string. It’s really a sunny pig
just modify it

When the springcloud obtains the cloud link database information, an error is reported: errorcode 1045, state 28000

Today, when doing the micro service exercise, put the relevant information of the linked database on the code cloud warehouse, and configure application.yml through config to pull the data; An error occurs when querying the user’s Micro service connection database

Post error message first

jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:32.882 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:32.883  INFO 14288 --- [eate-2036393189] c.a.druid.pool.DruidAbstractDataSource   : {dataSource-1} failContinuous is true
2021-11-03 18:43:33.397 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:33.908 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) ~[mysql-connector-java-8.0.15.jar:8.0.15]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.7.jar:1.2.7]
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2838) ~[druid-1.2.7.jar:1.2.7]

2021-11-03 18:43:34.420 ERROR 14288 --- [eate-2036393189] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: jdbc:mysql://localhost:3306/springboot?serverTimezone=GMT%2B8, errorCode 1045, state 28000

Config:

server:
  port: 9100
spring:
  application:
    name: config-server
  cloud:
    config:
      server:
        git:
          uri: https://gitee.com/shangdigao/shop1103
          username: [email protected]
          password: GYH000909
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

Member (user micro service)

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka
spring:
  application:
    name: member-server
  cloud:
    config:
      discovery:
        enabled: true
        service-id: config-server
      label: master
      name: member-server

Code cloud:

According to the error report, it is found that there is a problem with the user name and password when connecting to the database. After many attempts, it is found that the password pulled by config from the code cloud is incorrect

It is possible that the 0 at the beginning of the password was not obtained

Change the database login password to 123456

Run successfully

 

Etcd Error: mvcc: database space exceeded

etcd report error: mvcc: database space exceeded

Main analysis: auto-compact (auto-compact)
etcd does not recognize automatic compact, require an initial parameter, or compact through an order, and if more frequently recommended installation, the cost and error of space and internally existing. etcd v3 honored backend quota 2GB, if not compact, boltdb document is larger than that limit, errors: ” Error: etcdserver: mvcc: database spaceexceeded”, resulting in the failure to write data.

processing process:
My master point here is 192.168.10.203, 192.168.10.204, 192.168.10.204, 192.168.10.205

1 View alarms
[root@ ~]# /opt/k8s/bin/etcdctl –endpoints=https://192.168.10.203:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm list
[root@~]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.204:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm list
[root@~]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.205:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm list

2 To get the old copy
[root@~]#rev=$(/opt/k8s/bin/etcdctl –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem –endpoints=”https://127.0.0.1:2379
[root@~]#echo $rev
846418475

3 compression of old copy data
[root@~]#opt/k8s/bin/etcdctl –endpoints=https://192.168.10.203:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem compact $rev
[root@]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.204:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem compact $rev
[root@]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.205:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem compact $rev

4 Executive debris integration
[root@~]#opt/k8s/bin/etcdctl –endpoints=https://192.168.10.203:2379 –cacert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem defrag
[root@ ~]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.204:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem defrag
[root@~]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.205:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem defrag

5 dismissal of warning police
[root@~]#opt/k8s/bin/etcdctl –endpoints=https://192.168.10.203:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm disarm
[root@]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.204:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm disarm
[root@]#/opt/k8s/bin/etcdctl –endpoints=https://192.168.10.205:2379 –ca cert=/etc/kubernetes/ssl/ca.pem –cert=/etc/etcd/ssl/etcd.pem –key=/etc/etcd/ssl/etcd-key.pem alarm disarm

6 equipment and identifying standby data information
ETCDCTL_API=3 etcdctl snapshot save backup.db
ETCDCTL_API=3 etcdctl snapshot status backup.db

How to Solve SQL comments error in the mybatis query

Query condition modification, comment out the old sql, resulting in an error
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=’command.bldgLevel’, mode=IN, javaType=class java.lang.Object, jdbcType=VARCHAR, numericScale=null, resultMapId=’null’, jdbcTypeName=’null’, expression=’null’}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType VARCHAR . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType VARCHAR . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).

 

Solution:
Remove useless comments