Home >Backend Development >PHP Tutorial >PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?

PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?

WBOY
WBOYOriginal
2016-10-22 00:14:301232browse

Access localhost/ci
The code is as follows (it’s just locked)

PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?
After finishing,
I used Navicat to establish a connection, adjusted the command line, locked it, and found that it was blocked:

PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?

Why? The php connection should be released
ps:
The environment is windows+nginx+php+mysql

Reply content:

Access localhost/ci
The code is as follows (it’s just locked)

PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?
After finishing,
I used Navicat to establish a connection, adjusted the command line, locked it, and found that it was blocked:

PHP should automatically disconnect after connecting to mysql, but is it blocked with GET_LOCK?

Why? The php connection should be released
ps:
The environment is windows+nginx+php+mysql

Unlock after locking

<code>unlock tables</code>

or

<code>rollback</code>

<code>select release_lock('lock1');</code>

Release lock

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn