1

Wehn I test the following PDO code, I could view the connections to MySQL in MySQL with show processlist, but how could I cut off one connection? Is there any other power tool for managing MySQL connection/etc other than command line?

<?php $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass, array(PDO::ATTR_PERSISTENT => true)); // use the connection here // and now we're done; close it $dbh = null; ?> 

1 Answer 1

3

I've never worked with it, but there's KILL that looks like what you're looking for.

Each connection to mysqld runs in a separate thread. You can see which threads are running with the SHOW PROCESSLIST statement and kill a thread with the KILL thread_id statement.

In MySQL 5.0.0, KILL permits an optional CONNECTION or QUERY modifier:

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.