SqlSugar Connect MySql 8.0.29 Error [How to Solve]

Sqlsugar Connect Mysql 8.0.29 Error [How To Solve]

1. Background

I exported the database desk construction and information from the corporate server Mysql (model: 8.0.16) and restored it to my native laptop Mysql (model: 8.0.29). Just after beginning the venture, I used to be prompted with a SqlSugar database connection error. The immediate error is as follows:

Execute Db.Ado.VerifyConnection() reviews an error
Connection open error . The given key ‘0’ was not current within the dictionary.

word: the connection string: database=shares;server=127.0.0.1;port=3306;uid=root;pwd=123;

The following is the error report drawback of particular person desk question.

DB.Queryable().Where(p=>true).ToList() error. ToList() error, after evaluation, the primary drawback is the present desk subject character set and sorting guidelines should not uniform. The error is reported as follows.
MySqlException: “Fatal error encountered attempting to read the resultset.”
Internal exception MySqlException: Expected finish of information packet

2. Solution

1. Solution to connection error

Add charset=utf8mb4, and the connection will not report errors word: if you need utf8mb4, I take advantage of utf8 regionally and nonetheless report an error

database=shares;server=127.0.0.1;port=3306;uid=root;pwd=123;charset=utf8mb4;

2. Modify the inconsistency of database character set

Execute the next SQL script as required.

(1) Change the encoding (character set) of a desk and the encoding (character set) of all fields within the desk:

ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
·TABLE_NAME change to your desk title.

(2) Change the encoding (character set) of all tables and the encoding (character set) of all fields within the desk:

SELECT
	CONCAT(
		'ALTER TABLE ',
		TABLE_NAME,
		' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
	)
FROM
	information_schema.`TABLES`
WHERE
	TABLE_SCHEMA = 'DATABASE_NAME';
·DATABASE_NAME change to your databese title.

3. Other contents

READ :  Error: Cannot find module ‘webpack/lib/rules/DescriptionDataMatcherRulePlugin’ Require stack:

Query all desk names of a database:

SHOW FULL COLUMNS FROM TABLE_NAME;
·TABLE_NAME change to your desk title.

Leave a Reply

Your email address will not be published.