Category Archives: MySQL

Springboot error: “errorcode 1045, state 28000” [How to Solve]

Error message:

2022-02-08 14:17:32.022  INFO 1816 --- [nio-8080-exec-3] com. alibaba. druid. pool. DruidDataSource   : {dataSource-1} inited
2022-02-08 14:17:32.110 ERROR 1816 --- [eate-1764881818] com. alibaba. druid. pool. DruidDataSource   : create connection SQLException, url: jdbc: mysql://127.0.0.1:3306/itqs?allowMultiQueries=true , errorCode 1045, state 28000

 

As shown below:

Reason: application The MySQL database user name or password in the properties file is incorrect.

Solution: change to the correct user name or password.

[Solved] ERROR: child process failed, exited with error number 14 (error number 1, error number 100)

Problem Description:

Error: 14 when starting mongodb, check mongodb.log for MongoDB – Unable to unlink socket file / tmp / mongodb-27017

Cause analysis:

Check /tmp/mongodb-27017.sock, found that the owner is root

Solution:

Delete the /tmp/mongodb-27017.sock file and restart the mongod process. Check the /tmp/mongodb-27017.sock permissions again and change the ownership to the “mongodb” user.

also started successfully

Summary:

1. Check more logs, mongodb.log
2. The mongodb error column, such as 1100, is mostly due to the wrong specification of the data path and log path in the configuration file. The data path needs to be created in advance, which is a directory, and the log path also needs to be created in advance, which is a file

MySQL: Got error 139 from storage engine [How to Solve]

InnoDB restrictions

1. a table cannot contain more than 1000 columns.
2. The maximum internal key length is 3500 bytes, but MySQL itself limits this to 1024 bytes.
3. except for VARCHAR, BLOB and TEXT columns, the maximum row length is slightly less than half of the database page. That is, the maximum row length is about 8000 bytes. longBLOB and longTEXT columns must be less than 4GB, and the total row length, including BLOB and TEXT columns, must be less than 4GB. innoDB stores the first 768 bytes of VARCHAR, BLOB or TEXT columns in rows, and the rest is stored in scattered pages.
4. The default database page size in InnoDB is 16KB.

Solution 1: replace the engine

ALTER TABLE tableName ENGINE = MyISAM;

[Solved] pymysql.err.internalError: (1054, “Unknown column ‘LGD_xiaohong’ in ‘field list'”)

This is the problem I encountered in mongodb project. The original code is as follows:

running result:

the modified code is nested with quotation marks:

running result:


mysql database view data, as shown in the following figure:

successfully insert data. I wish everyone a smooth solution, I wish you success!!

MAC MYSQL Start Error: The server quit without updating PID

1. System configuration information:

System MacOS bigsur 11.6
MySQL 8.0.26

2. Start MySQL service:

sudo /usr/local/mysql/support-files/mysql. server start

The error message is as follows:

Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/jinjideleishen.local.pid).

Solution commands
mac default user is _mysql, under linux the default user of mysql is mysql
Use chown to change the owner of the specified file to the specified user or group
-R : Process all files in the specified directory and its subdirectories

sudo chown -R _mysql:_mysql /usr/local/mysql/

Restart successful:

 sudo /usr/local/mysql/support-files/mysql.server restart
 ERROR! MySQL server PID file could not be found!
Starting MySQL
.................................................... SUCCESS!

3. Stop MySQL service

sudo /usr/local/mysql/support-files/mysql.server stop

4. Restart MySQL service

sudo /usr/local/mysql/support-files/mysql.server restart

scm_prepare_database.sh CDH initial data script execute error

Environment

CDH 5
MySQL 5.7.30

check the manual that corresponds to your MySQL server version for the right synta to use near '@ default character  
set utf8 at line 1

reason

For the problem of script execution mode, – P does not write a password after it. Execute it directly, and then enter the password. The result returns successful

/usr/share/cmf/schema/scm_prepare_database.sh mysql -h Database_ip -u username -p --scm-host cdhip scm scm scm

How to Solve Navicat open view error

View ‘orgemp.view_allempinfo’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

Right click to open the view design, click the top to optimize SQL and check the view SQL.

Check whether the view table does not exist or the field does not exist.

MYSQL Create TIMESTAMP and Save Error: ERROR 1067 (42000): Invalid default value for ‘last_updated_on’

ERROR 1067 (42000): Invalid default value for ‘last_updated_on’

Solution:
Remove the values: NO_ZERO_IN_DATE,NO_ZERO_DATE in sql_mode.

show variables like 'sql_mode';

Outcome:
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
Modify sql_mode:
set session
sql_mode=’ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;
Execute successfully!

PhpllyAdminSqlParser\Exceptions\LoaderException:Specifed context xampp phpadmin & MySQL Error

1、PhpllyAdminSqlParser\Exceptions\LoaderException:Specifed context (“PhpMyAdminlSqlParserContextslContextMariaDb100422”) does not exist. i
Click mysql–>Admin Error:
PhpllyAdminSqlParser\Exceptions\LoaderException:Specifed context (“PhpMyAdminlSqlParserContextslContextMariaDb100422”) does not exist. in

Solution:

2. Error: Error: MySQL shutdown unexpectedly
20:49:25 [mysql] This may be due to a blocked port, missing dependencies,
20:49:25 [mysql] improper privileges, a crash, or a shutdown by another method.
20:49:25 [mysql] Press the Logs button to view error logs and check
20:49:25 [mysql] the Windows Event Viewer for more clues
20:49:25 [mysql] If you need more help, copy and post this
2. Error:
Error: MySQL shutdown unexpectedly.
20:49:25 [mysql] This may be due to a blocked port, missing dependencies,
20:49:25 [mysql] improper privileges, a crash, or a shutdown by another method.
20:49:25 [mysql] Press the Logs button to view error logs and check
20:49:25 [mysql] the Windows Event Viewer for more clues
20:49:25 [mysql] If you need more help, copy and post this

Solution:

These two are the database I built before, just in case, the above files will be replaced after the two also deleted, and later put back to try, just need to back in the file to overwrite the data in the file can

MySQL startup error: vcruntime140_1.dll cannot be found, unable to continue code execution

Build a MySQL development environment under Windows environment and report an error when executing mysqld. The error content is:

Vcruntime140 not found_ 1.dll, unable to continue code execution

The reason is that there is no vcruntime140_1.DLL file under C:\Windows\System32 of windows.

Solution: Download vcruntime140_1.dll from the official Website and put it in C:\Windows\System32.

[Solved] MySQL: datetime (0) null default NULL

Resolve the MySQL: datetime (0) null default null error

Remove the database from mysql5 7 is exported as SQL in mysql5 When importing on 5, there will be an error of datetime (0) null default null. The main reason for the error is mysql5 7 and mysql5 Datetime and timestamp of 5 are incompatible, mysql5 7. The exported format is datetime (0) and mysql5 5, the syntax is not recognized

Solution:

1) Change datetime(0) to datetime, or timestamp(0) to timestamp in the export statement

2) Keep database version consistent

be careful

When datetime is set to CURRENT_TIMESTAMP by default, the length of CURRENT_TIMESTAMP cannot be specified as 0 as well.

datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0)

Correct grammar

datetime NULL DEFAULT CURRENT_TIMESTAMP

[Solved] asp.NETCORE connect to MySQL error: encoding 1252

The error information is as follows:

System.NotSupportedException:“No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.”

Solution:

Add system.Through.nuget.Text.Encoding and system.Text.Encoding.References to codepages

Then add the following code to the code

System.Text.EncodingProvider ppp = System.Text.CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(ppp);

OK solve the problem