Tag Archives: The mysql database

MySQL installation error. Netframeword installation failed

NET Framework is required to install the MySQL database, but after trying several versions of the NET Framework, it cannot be successfully installed

All of them are saying “installation failed”.

 
The resolution scheme is as follows:
Method one:
Select the.NET Framework installation file, right-click and select Administrator Permission to Execute. If this is not successful, continue to try the following method
 
Method 2:
1. Start – run – type “regedit” and open registry editor when you confirm.
2, find the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ SQMClient \ Windows \ DisabledSessions, you can delete the item, and then restart.
If it still doesn’t work, please look at method 3
Method 3:
1. Click “Start” and enter: CMD in the search box. In the search results, right-click on “CMD” and select “run as administrator”.
2, enter the following and press enter: reg in registry key HKLM \ SOFTWARE \ Microsoft \ delete SQMClient \ Windows \ DisabledSessions/va/f, also can make this statement a. Bat batch file, then right-click can be run as an administrator.
can
3, restart Windows 7 system after the operation, can activate Windows 7 TrustedInstalle permissions, again under the Windows 7 installation software “unable to access the Windows Installer service” will not happen again
If that doesn’t work, look at method four
Method 4:
Right-click on My Computer — Administration — Services and Applications — Services — go to Windows Installer and enable it as Auto
 

Mybatis batch insert data

Due to the project need to generate more data, and saved to the database, in the program encapsulates a List collection objects, then need to put the collection of entities in the inserted into the database, the project USES the Spring + MyBatis, therefore intends to use the MyBatis bulk insert, should be better than that of circular insert, because before used bulk insert, finally achieved after got some information on the Internet, stick process in detail. For future reference and study.
Java code:

Java code:

MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails

Today, adding a foreign key to one of the two existing tables encountered the following error:
sql 1452 Cannot add or update a child row:a foreign key constraint fails
The reason:
The foreign key set does not match the primary key value of the corresponding table.
Solutions:
Find the mismatched value changes.
Or empty both tables of data.
 
The original link
 
It is my personal understanding that the cause should be (untested) :
1. The names of fields in the two tables are different;
2. The types of fields in two tables are different (such as an int and a VARCHar);
3. According to the original author’s idea, there should be data in the two tables, and the data are different;