Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What does "flush tables;" do exactly?

Posted on 2016-11-08
7
Medium Priority
?
839 Views
Last Modified: 2016-11-08
Long story short, I was trying to trouble an error:

User XXXXXXXXXX already has more than 'max_user_connections' active connections...


This user has  many different web sites all using one MySQL database, I had already restarted all their sites that I could find across varying web servers, and that didn't fix the error, so I then went on the MySQL server and did a "flush hosts" , that didn't help.

Then I read something along about doing:
flush tables;


So I ran that, it's still running, so far other sites using this db server aren't affected but now I'm second guessing myself and wondering if it was OK to run flush tables in the first place.

As I said, the process is still running so I'm hoping I didn't break anything.

Probably I shoudl have just restarted the MySQL service, but I didn't want to affect other users.

This is a Windows MySQL server and I could not find a command or script to kill a specific user's processes in one swoop (I did find a linux method but it involved grep and awk , so would not have worked on Windows)


Thanks
0
Comment
Question by:Vas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 32

Accepted Solution

by:
Pawan Kumar earned 2000 total points
ID: 41878734
Flush tables - Closes all open tables, forces all tables in use to be closed, and flushes the query cache.

It also removes all query results from the query cache, like the RESET QUERY CACHE statement.

Read more at - http://dev.mysql.com/doc/refman/5.7/en/flush.html
http://www.thecreativedev.com/mysql-flush-commands/
0
 
LVL 1

Author Comment

by:Vas
ID: 41878735
thanks, so is there any risk to running flush tables?

It's still running so I don't know if I've caused any issues yet.
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41878742
It will clear the query cache content. When your caches are empty, MySQL can better utilize available memory. It can also used to unlock tables.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 1

Author Comment

by:Vas
ID: 41878755
For this part you said " Closes all open tables, forces all tables in use to be closed"  that sounds like a bad thing though right? (forcing tables to close)

I had run the command exactly like this with no other parameters or switches:

flush tables;


(it's still running)
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41879757
Hi,
Sorry for the delay in reply. Is it done?Did you face any issues?

Pls let me know.

Regards,
Pawan
0
 
LVL 1

Author Comment

by:Vas
ID: 41879799
Hi, it didn't hurt anything, for an unrelated reason we had to reboot the server so it never completed fully but all is good now (the reboot must have cleared connections anyway)

Thanks so much for your help earlier
0
 
LVL 32

Expert Comment

by:Pawan Kumar
ID: 41879802
Great that everything is fine. !!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What we learned in Webroot's webinar on multi-vector protection.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question