ERROR: The total number of locks exceeds the lock table size Error Code: 1206
Locate the config file of mysql in Ubuntu 18.04
/etc/mysql/mysql.conf.d/mysqld.cnf
Add the following line to the end of the file
innodb_buffer_pool_size = 1G
ERROR: The total number of locks exceeds the lock table size Error Code: 1206
Locate the config file of mysql in Ubuntu 18.04
/etc/mysql/mysql.conf.d/mysqld.cnf
Add the following line to the end of the file
innodb_buffer_pool_size = 1G
SELECT account_id, open_emp_id
^^^^ ^^^^
1 2
FROM account
GROUP BY 1;
GROUP BY 1 refers to the first column in select statement which is account_id.
InnoDB caches table and index data. The default value is 128MB.
rewriteBatchedStatements=true is the important parameter. rewriteBatchedStatements=true improves the performance so dramatically by rewriting of prepared statements for INSERT into multi-value inserts when executeBatch ( ) (Source). That means that instead of sending the following nINSERT statements to the mysql server each time executeBatch ( ) is calledINSERT INTO X VALUES (A1, B1, C1)
INSERT INTO X VALUES (A2, B2, C2)
...
INSERT INTO X VALUES (An , Bn, Cn)
INSERT INTO X VALUES (A1, B1, C1), (A2, B2, C2),..., (An , Bn, Cn)
ALTER IGNORE TABLE RESIM. LOD_RANDOMRECORDSIM
ADD UNIQUE INDEX USERIDARTISTURI (USERID, ARTISTURI);
SET SESSION old_alter_table=1;
ALTER TABLE aboutme . RandomSample20ForEachPR DROP COLUMN TUIMSimPrecision
ALTER TABLE aboutme . RandomSample CHANGE TopicCount TestFlag INT
ALTER TABLE aboutme . RandomSample20ForEach MODIFY COLUMN MUIMSim decimal( 12,10)
SELECT SUM( SampleFlag) FROM
(SELECT SampleFlag FROM aboutme . RandomSample20ForEach WHERE TwitterURI = 'http://www.twitter.com/parklize' ORDER BY TUIMSim DESC LIMIT 10)
AS SuccessRate
INSERT INTO table2
(column_name( s))
SELECT column_name( s)
FROM table1;
INSERT INTO aboutme . RandomSample50 (TwitterURI, LINK, TopicCount , CreateTime, TestFlag)
SELECT TwitterURI, LINK, TopicCount , CreateTime, 1 FROM aboutme . RandomSample
WHERE PositiveTestCases = '1' AND TwitterURI IN
(SELECT * FROM (SELECT DISTINCT TwitterURI FROM aboutme . RandomSample ORDER BY RAND( ) LIMIT 50) temp);
SELECT SUBSTRING_INDEXUGCID2, '/', -1) FROM UGCListFor150URL (
http://www.twitter.com/parklize/status/562289797117800448->562289797117800448
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
mysql > source file_name
mysql> \. file_name
SHOW STATUS WHERE `variable_name` = 'Threads_connected';
SHOW PROCESSLIST;
KILL 9690; // use id to kill the process
select concat ( 'KILL ', id,';') from information_schema.processlist
where user='root' and time > 200;
update RandomSampleUIM uim , (select distinct Topic, BabelID from _RandomSampleUIM) olduim set uim . `BabelID` = olduim . `BabelID` where uim . `Topic` = olduim . `Topic `;
/etc /init . d/mysql start/stop/restart
UPDATE aboutme . RandomSample SET TestFlag = 1 WHERE UGCID in
(SELECT UGCID FROM
(SELECT UGCID FROM aboutme . RandomSample WHERE TwitterURI = @twitter_uri ORDER BY RAND( ) LIMIT 10) tmp
) ;
ALTER DATABASE CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
ALTER TABLE UGCList CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
String set_names = "SET NAMES 'utf8mb4'";
ps = con.prepareStatement(set_names);
ps.executeUpdate();
sudo /etc/init.d/mysql restart
// Change to string store in MySQL (DATETIME)
Date dt = ugc.getCreate_time();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentTime = sdf.format(dt);