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 Thanks for support! |
Looks to be a database at that location
Code:
mysql -u root -p -e "show databases like '%0%';" -Ns |
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/ |
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? |
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 |
Quote:
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? |
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. :tisk: |
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 05:28 AM. |