Corrupted Database Tables
Hi, lately I've received 3 email with this in the Subject:
"check_mysql has determined that there are corrupted database tables"
The 1st few lines in the email contains:
"cPanel & WHM has determined that the following database tables are corrupt:
We recommend that you repair these tables with WHM"s Repair a MySQL/MariaDB Database interface at:
Database | Error |
---|---|
mysql | mysqlcheck: [Warning] /root/.mylogin.cnf should be readable/writable only by current user. |
-
ls -l /root/.mylogin.cnf Whats the output of this command? I believe this should be owned by mysql though I'm not 100% sure. 0 -
In most systems, /root/.mylogin.cnf isn't present. If it is, it takes precedence over the default /etc/my.cnf, which looks like this: -rw-r--r-- 1 root root 1128 Mar 22 17:08 /etc/my.cnf
Can you check the permissions and ownership on that file as @andrew.n mentioned?0 -
Hello, thanks for both replies. Here's the output: -rw-r--r-- 1 root root 24 Nov 2 2020 /root/.mylogin.cnf EDIT: Btw, I did search and cPRex is correct. The only file I found was my.cnf. 0 -
This should be right. Can you rename this file and re-run the repair? mv /root/.mylogin.cnf /root/.mylogin.cnf.back 0 -
I'm not sure what I was doing yesterday but You were right all along! I was very tired from work and just probably not seeing things correctly. My apologies. That files is in the right place. I've renamed it and repaired the tables and get the following: ls: cannot access /root/.mylogin.cnf: No such file or directory 0 -
Are you on Ubuntu? It's weird that its still looking for that file. Just out of curiosity could you change the ownership there from root to mysql? chown mysql.mysql /root/.mylogin.cnf then run the repair again. 0 -
No on Cent and just got a new server so I can switch to Ubuntu. LOL Yeah, I started to change ownership before I made my first post but thought I'd ask first, just in case there was something else going on. Now the output is: -rw-r--r-- 1 mysql mysql 24 Nov 2 2020 /root/.mylogin.cnf However, I tend to get the emails early morning EST time. I've also been getting excessive resources which I believed were tied to this. I guess I'll have to wait until tomorrow morning to see if things continue or change for the better. 0 -
Please do keep us updated. I like CentOS better than Ubuntu. I tag @cPRex here though if he has any feedback on this too. 0 -
I like Cent better too although Ubuntu isn't bad. It's just sad that they gave up on it. :( Will defo keep you updated. :) 0 -
I'm not totally sure what the issue would be with this one - you're always welcome to submit a ticket to our team so we can check it out. I recently moved my personal server over to AlmaLinux 8 as I wanted to stay with a CentOS flavor, and it's working well. 0 -
I thought about AlmaLinux too but with it being so new I just wasn't sure. However, I am still getting that same email and I am noticing that whenever I repair any database via WHM it says the same thing in the very first line of the output: [QUOTE]mysqlcheck: [Warning] /root/.mylogin.cnf should be readable/writable only by current user.
I'm starting to think there may be ownership or permission issues that I am unaware of.0 -
Okey, dokey: Id: #94429335 0 -
The error says: mysqlcheck: [Warning] /root/.mylogin.cnf should be readable/writable only by current user. so, if I understand right, the rights should be: -rw------- not: -rw-r--r-- 0 -
I agree with quietFinn that permission should be -rw------- for file /root/.mylogin.cnf 0 -
Here is what our team found in that ticket: "I appreciate your patience while I look into this issue. It seems at some point, the mysql_config_editor program led to the creation of the "/root/.mylogin.cnf" file, which is essentially an encoded .my.cnf file that will take precedence over an existing .my.cnf file if it exists. [20:53:29 root@94429335 ~]cPs# cat /root/.mylogin.cnf [20:53:42 root@94429335 ~]cPs# stat /root/.mylogin.cnf File: "/root/.mylogin.cnf" Size: 24 Blocks: 8 IO Block: 4096 regular file Device: fd01h/64769d Inode: 12731 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 27/ mysql) Gid: ( 27/ mysql) Access: 2022-03-26 20:53:42.098070493 -0400 Modify: 2020-11-02 04:15:48.716250029 -0500 Change: 2022-03-26 20:53:14.599820255 -0400 Birth: - I went ahead and moved this file to the directory you see in the output below: [20:59:13 root@94429335 ~]cPs# mkdir -vp /root/cptechs/94429335 mkdir: created directory "/root/cptechs" mkdir: created directory "/root/cptechs/94429335" [21:12:27 root@94429335 ~]cPs# mv -v /root/.mylogin.cnf /root/cptechs/94429335/ "/root/.mylogin.cnf" -> "/root/cptechs/94429335/.mylogin.cnf" I believe this will fix the issue; if you keep receiving emails regarding database corruption, feel free to reach out to us. If you have any other questions or concerns, cPanel support is always here to help. It was my pleasure working on this issue with you, and I hope you are satisfied with the experience." At this point we haven't seen any additional emails sent from the server. 0 -
uhm I advised the OP earlier here to rename the file and he said: "I've renamed it and repaired the tables and get the following: ls: cannot access /root/.mylogin.cnf: No such file or directory" so he got an error back that it doesn't exist. 0 -
Sorry, I haven't responded sooner...been very busy! Thanks to all who have replied in this topic. The issue seems to be resolved now. :) 0 -
How was this resolved exactly?:) 0 -
[QUOTE]From cPRex Jurassic Moderator Here is what our team found in that ticket: "I appreciate your patience while I look into this issue. It seems at some point, the mysql_config_editor program led to the creation of the "/root/.mylogin.cnf" file, which is essentially an encoded .my.cnf file that will take precedence over an existing .my.cnf file if it exists. [20:53:29 root@94429335 ~]cPs# cat /root/.mylogin.cnf [20:53:42 root@94429335 ~]cPs# stat /root/.mylogin.cnf File: "/root/.mylogin.cnf" Size: 24 Blocks: 8 IO Block: 4096 regular file Device: fd01h/64769d Inode: 12731 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 27/ mysql) Gid: ( 27/ mysql) Access: 2022-03-26 20:53:42.098070493 -0400 Modify: 2020-11-02 04:15:48.716250029 -0500 Change: 2022-03-26 20:53:14.599820255 -0400 Birth: - I went ahead and moved this file to the directory you see in the output below: [20:59:13 root@94429335 ~]cPs# mkdir -vp /root/cptechs/94429335 mkdir: created directory "/root/cptechs" mkdir: created directory "/root/cptechs/94429335" [21:12:27 root@94429335 ~]cPs# mv -v /root/.mylogin.cnf /root/cptechs/94429335/ "/root/.mylogin.cnf" -> "/root/cptechs/94429335/.mylogin.cnf" I believe this will fix the issue; if you keep receiving emails regarding database corruption, feel free to reach out to us. If you have any other questions or concerns, cPanel support is always here to help. It was my pleasure working on this issue with you, and I hope you are satisfied with the experience." At this point we haven't seen any additional emails sent from the server. 0 -
So you're saying you get the corrupted table notification immediately after updating the machine? 0 -
Yes, and I thought that is what happened before but wasn't sure so I didn't say anything last time. However, I've noticed it right after the last two updates. No, I haven't made any changes to the database...that I can remember. I'm wondering if because I'm still using Centos7 may be the reason. I do plan on upgrading using this: 0 -
And one thing I don't understand is why it doesn't tell you exactly which db tables are corrupted. If you have a ton of of db's it would save a LOT of time and effort! 0 -
I'm not totally sure, but it's time to make a ticket for this so we can check it out. Can you do that, and then post the number here so I can follow along? 0
Please sign in to leave a comment.
Comments
25 comments