Author Archives: Robins

[Solved] JMeter Connect Database error: unblock with ‘mysqladmin flush hosts’

It can be seen that the causes are:

Blocking caused by too many (exceeding the maximum value of max_connect_errors for mysql database) broken database connections from the same ip in a short period of time

Solution 1: Change the value of max_connect_errors
(1) Go to the Mysql database and check the max_connect_errors.

show variables like ‘%max_connect_errors%’;

(2) Modify the value of max_connect_errors:

set global max_connect_errors = 100;

(3) Check whether the modification is successful or not

show variables like ‘%max_connect_errors%’;

Solution 2: use mysqladmin flush-hosts command to clean up the hosts file

(1) Use the command to modify under the found Directory: mysqladmin -u xxx -p flush-hosts

perhaps

flush hosts;

Solution: mysqld> Restart

I solved it by restarting mysql

Centos7 View java-v Error [How to Solve]

[root@localhost ~]# java -v
Unrecognized option: -v
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

jdk1. 7 view the version number through java -V and java --version,
and jdk1 8 you have to check the version number through java -version

Centos MYSQL Install Error: The GPG keys listed for the “MySQL 8.0 Community Server” repository are already installed but they are not correct for this package.

Scenario:

When installing mysql8, I didn’t encounter this problem before. This time, I suddenly encountered a new problem (maybe mysql5.7?): The GPG keys listed for the “MySQL 8.0 Community Server” repository are already installed but they are not correct for this package.

 

Solution:

1. Try this first:

sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

Then yum install mysql-community-server

2. If you can’t, you can use this:

sudo yum -y install * --nogpgcheck

GPG keys are the keys generated when the installation package is released. During installation, you need to check the keys to ensure security.

[Solved] UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’

Create a new POJO class

@Data
public class UserInfo {
    private Long userId;
    private String userKey;
}

Use the data annotation in lombook, but make an error when using it

UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’

Reason: POJO class only uses Data annotation and lacks construction method,

Solution: use annotation @AllArgsConstructor @NoArgsConstructor  or construct directly

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    private Long userId;
    private String userKey;
}

[Solved] no such column: id (code 1): , while compiling: DELETE FROM zhangdan WHERE id=?

Possible reason one: simply put, the name of the id column is wrongly written, can not find the id column

Double-check your delete in the sql statement id has not been written wrong, there may be a time when you set up a table may be different from the current one, the project with the former table, for example, I started to build a table with _id, and then change the code too many times, the statement to build the table also changed, but the project with the beginning of the table, so the sql statement still need to use _id

Possible reason 2: The database version was not increased, which led to this error

Add the following code to your MySQLHelper.java, which is used to upgrade the database

  @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}

EF Core Error: “Format of the initialization string does not conform to specification starting at index 0.”

Problem analysis:

I found this error today during the EF Core database migration, my project just copied and pasted the configuration file, and since then I found that the database configuration file json was the culprit.

I found out that the .json file was not set to “copy to output directory”, so the program could not find the data file at runtime. The following figure shows the correct configuration.

This problem is generally divided into two cases: 1.

1, the database link in the database file is not correctly configured .

2, json configuration file is not correctly set to “copy to output directory”, exactly what I mentioned above.

[Solved] serial port Call Error: Permission denied: ‘/dev/ttyUSB0’

1. Reasons

Generally, it is not the root user and has no permission on the port.

2. Solutions

2.1 temporary

1 sudo chmod 777 /dev/ttyUSB0

Modify the permission to be readable, writable and executable. However, this problem will occur again when this setting is restarted and used next time. You need to reset it again.

2.2 permanent

1 sudo usermod -aG dialout usrname

Usrname: user name.

That is, the user name is added to the dialout user group. After restart, it can be used directly.

[Solved] PHP7.3 Error: undefined function simplexml_load_string()

Usually this situation is caused by the php extension module not having simplexml installed.

yum install php73-php-simplexml //install simplexml
systemctl restart php73-php-fpm  //restart php

If it is another version you can replace 73 accordingly
Then print phpinfo() and see the following module, then the problem is solved