Jump to content


Photo

How to Kill Mysql DB connections

mysql

  • Please log in to reply
3 replies to this topic

#1 joaopm33

joaopm33

    Newbie

  • Members
  • 3 posts

Posted 16 December 2020 - 12:01 AM

Hello,

 

As dumb as it may sound, I think I created a lot of connections with my DB without closing them. I am trying to Kill them but i cant see the connections. When I type :

SHOW PROCESSLIST

I get two processes:

 

  s_fulltext.png Id User Host db Command Time State Info dot.gif Termina 17453 joaopm33 localhost joaopm33_Mush_Instagram Query 0 starting SHOW PROCESSLIST dot.gif Termina 17454 joaopm33 localhost NULL Sleep 0   NULL                                  

When trying to kill them i get an unknow id error.

 

I should see 4 connections once I am getting the error:

mysql.connector.errors.ProgrammingError) 1203 (42000): User joaopm33_joaopm33 already has more than 'max_user_connections' active connections

What am I doing wrong here (beside opening all those connections in the first place)

 

 



#2 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 21,643 posts
  • Gender:Male

Posted 17 December 2020 - 05:43 AM

At the time of this post you have zero open connections. The best way to close connections is to do so in your code. It depends on the language that you're using, but some languages like java are well known for trying to open hundreds of connections and never closing any of them. It might also be useful information for you to know that Tommy doesn't have a limit on the number of mysql connections currently. If someone starts to abuse that we may make a limit though.



#3 antobarb

antobarb

    Newbie

  • Members
  • 5 posts

Posted 13 January 2021 - 12:04 PM

Hello,

 

As dumb as it may sound, I think I created a lot of connections with my DB without closing them. I am trying to Kill them but i cant see the connections. When I type :

SHOW PROCESSLIST

I get two processes:

 

  s_fulltext.png Id User Host db Command Time State Info dot.gif Termina 17453 joaopm33 localhost joaopm33_Mush_Instagram Query 0 starting SHOW PROCESSLIST dot.gif Termina 17454 joaopm33 localhost NULL Sleep 0   NULL                                  

When trying to kill them i get an unknow id error.

 

I should see 4 connections once I am getting the error:

mysql.connector.errors.ProgrammingError) 1203 (42000): User joaopm33_joaopm33 already has more than 'max_user_connections' active connections

What am I doing wrong here (beside opening all those connections in the first place)

Hi, have you solved the problem?

Where did you write that command?



#4 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 21,643 posts
  • Gender:Male

Posted Yesterday, 11:46 PM

You can use phpmyadmin to run raw sql commands. Click the database you want on the left navigation pane, and then hit the sql tab along the top. The commands you type in that box will be run. The other option is you can enable remote mysql connections to your database, and then run an application or command such as

mysql --host=johnny.heliohost.org --user=antobarb --database=antobarb_example -p






Also tagged with one or more of these keywords: mysql

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users