Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-07-2017, 04:29 PM
|
#1
|
LQ Newbie
Registered: Jun 2017
Posts: 2
Rep: 
|
Folder "mysql" is full
Hi there, we are running a server based on centOS with mariadb.
Now folder /var/lib/mysql where MySQL are stored is getting full, because one file/folder is getting bigger and bigger. I don't know whats the purpose of this file/folder.
Do you have any experience to share with me or ideas, how I can delete this file/folder? Should I delete this or its essential?
Command: du /var/lib/mysql/0 -h
Extract:
Code:
8.3G /var/lib/mysql/0
This "0" I dont know what it is...
Thanks for support!
|
|
|
06-07-2017, 06:49 PM
|
#2
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Looks to be a database at that location
Code:
mysql -u root -p -e "show databases like '%0%';" -Ns
|
|
|
06-07-2017, 10:34 PM
|
#3
|
LQ Guru
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
|
|
|
|
06-08-2017, 04:31 AM
|
#4
|
LQ Newbie
Registered: Jun 2017
Posts: 2
Original Poster
Rep: 
|
I deleted those files/folders
- /var/lib/mysql/0
- /var/lib/mysql/1:
1. sudo systemctl stop mariadb
2. rm 0
3. rm 1
4. sudo systemctl start mariadb
Websites still running. No issues.
What I don't get with your sources: Why was there this huge folders? What are this?
|
|
|
06-08-2017, 05:54 PM
|
#6
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Quote:
Originally Posted by Nimenno
I deleted those files/folders
What I don't get with your sources: Why was there this huge folders? What are this?
|
They were databases. How they got there is anybody's guess.
Grok around /var/log/, check .mysql_history files on the system.
If that's the way you verify databases, I hope you have tested backups.
And why ask why, if you don't care to follow direction?
|
|
|
06-08-2017, 07:13 PM
|
#7
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,358
|
I hope that you are using LVM = Logical Volume Management to manage your physical drive space. If so, you can simply add another hard drive to your physical storage pool, then assign all or part of it to the logical storage pool where your "mysql" folder is located. Even without restarting your machine, you have just increased the amount of space available.
And if you don't use LVM now, I strongly suggest that you convert to it at once. 
|
|
|
04-20-2018, 11:05 AM
|
#8
|
LQ Newbie
Registered: Apr 2018
Posts: 1
Rep: 
|
Explanation and solution
Hi,
I had a similar issue and I investigated thoroughly.
My monitoring toolkit told me to inspect that virtual machine for high disk usage, when I wasn't expecting it... After searching through the file system, I noticed a file named /var/lib/mysql/1 having a size of about 40 GB...
After some checkups, I noticed the file was opened by the main MySQL thread, so I suspected it was maybe a log... I checked some parts of the file and this confirmed my intuition...
After some investigation, I noticed there was an entry "log_slow_queries=1" into the MySQL configuration... I tested changing the parameter to the value "0" and it created a log with that name in the /var/lib/mysql folder...
According to the documentation, the log_slow_queries parameter isn't a boolean... If it is defined, it uses the name as is... If it's a 0 or a 1, it will create the log with that name.
So I expect you have an entry "log_slow_queries=0" in your MySQL configuration.
|
|
|
All times are GMT -5. The time now is 09:13 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|