LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 06-07-2017, 04:29 PM   #1
Nimenno
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Rep: Reputation: Disabled
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!
 
Old 06-07-2017, 06:49 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Looks to be a database at that location
Code:
mysql -u root -p -e "show databases like '%0%';" -Ns
 
Old 06-07-2017, 10:34 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
No I wouldn't delete it until you have confirmation that you can.
The third link talks about it.

https://www.digitalocean.com/communi...on-on-centos-7

https://www.quora.com/How-can-I-safe...-var-lib-mysql

https://forums.cpanel.net/threads/co...-files.130597/
 
Old 06-08-2017, 04:31 AM   #4
Nimenno
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
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?
 
Old 06-08-2017, 05:14 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Not sure why the huge folder.

It's most likely a default to keep a data base.

MySQL data base files are stored in the same place on a Debian system/server too.
https://unix.stackexchange.com/quest...ases-on-debian

Four answers here that give a little more of an explanation.
https://stackoverflow.com/questions/...sql-store-data

HTH
 
Old 06-08-2017, 05:54 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Nimenno View Post
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?
 
Old 06-08-2017, 07:13 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,156
Blog Entries: 4

Rep: Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688Reputation: 3688
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.
 
Old 04-20-2018, 11:05 AM   #8
TheShadowKnows
LQ Newbie
 
Registered: Apr 2018
Posts: 1

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is it allowed to use full path to "*.desktop" files in the "mimeapps.list"? Andy_Crowd Linux - Newbie 1 05-12-2016 03:17 PM
[SOLVED] There is no "menu.lst" in my Ubuntu "/boot/grub/" folder. msbstar Linux - Newbie 18 09-15-2012 01:26 PM
How does one "zip" a folder with Linux .? How does Windows user "unzip" same ? brjoon1021 Linux - Software 5 12-19-2010 12:10 AM
BASH:find out if volume "foo"/folder "goo" can be written to SilversleevesX Programming 2 08-28-2010 10:03 AM
Difference between "frugal" and "full" installations of Puppy? gray53 Linux - Newbie 2 07-31-2009 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration