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
Release: 2016-10-22 00:14:30
Original
1239 people have browsed it

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>
Copy after login

or

<code>rollback</code>
Copy after login

<code>select release_lock('lock1');</code>
Copy after login

Release lock

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template