rm -rf 86790 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/86790 -v bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/86790 --core-file --socket=/tmp/mysql.sock --port=3306 --log-error=$PWD/86790/log.err 2>&1 & ### Terminal one [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.18: bin/mysql -uroot --prompt='Term1>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.18-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Term1>use test Database changed Term1>drop table if exists t; Query OK, 0 rows affected (0.00 sec) Term1>CREATE TABLE `t` ( -> `id` int(11) NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (`id`) -> ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 ; Query OK, 0 rows affected (0.00 sec) Term1> Term1>set autocommit = 0; Query OK, 0 rows affected (0.00 sec) Term1>insert into t values(1); Query OK, 1 row affected (0.01 sec) Term1>select sleep(10) from t; +-----------+ | sleep(10) | +-----------+ | 0 | +-----------+ 1 row in set (10.00 sec) ### Terminal two [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.18: bin/mysql -uroot --prompt='Term2>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.18-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Term2>use test Database changed Term2>set lock_wait_timeout = 1; Query OK, 0 rows affected (0.00 sec) Term2>flush tables with read lock; ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction Term2> ### Terminal one Term1>insert t values (2); -- hangs ### Terminal two Term2>show processlist; +----+------+-----------+------+---------+------+------------------------------+---------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+------+---------+------+------------------------------+---------------------+ | 3 | root | localhost | test | Query | 118 | Waiting for global read lock | insert t values (2) | | 4 | root | localhost | test | Query | 0 | starting | show processlist | +----+------+-----------+------+---------+------+------------------------------+---------------------+ 2 rows in set (0.00 sec)