MySQL user loses lock tables privilege every day

veronicabend

Well-Known Member
Feb 25, 2005
70
1
158
Hi,

I have manually created a mysql user which doesn't belong to any cpanel account on server. This is a global user which I use for a script that runs daily and does mysqldump of all databases. I created this user by accessing PhpMyAdmin from within WHM, then clicked on Privileges link on first screen there, and added the user. This user only has these privileges:

select
show databases
lock tables

Every day, I need to go back and manually add the lock tables privilege because it is gone. after I add it, my backup script runs just fine. Then next day when it runs automatically, it sends me an error message. I go look, and the user has lost the lock tables privilege.

There must be some process in cron removing this privilege.

Please help me see how I can have this user keep its privileges. Right now my automatic database backup script is useless with this issue. Thanks.
 

dballanc

Registered
Dec 29, 2008
3
0
51
I'm having the same problem.

I'm also experiencing this. It's maddening. The only way I've been able to work around so far is by using the root password, which is just slightly less unacceptable than having a failing backup script.

Any information on how to fix the issue correctly would be greatly appreciated.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,608
77
308
cPanel Access Level
Root Administrator
This is done by /scripts/securemysql, which is executed during cPanel updates. To prevent this from happening, perform the following from the command line:

Code:
# touch /etc/securemysqldisable
 

Ivanner

Active Member
Oct 13, 2003
28
0
151
Tried this and the user still loses its privileges. His privileges get rolled back to "USAGE"
 
Last edited:

AlexAT

Well-Known Member
PartnerNOC
May 23, 2003
202
0
166
Ukraine
cPanel Access Level
Root Administrator
For a month I get this problem for different users.
cPanel support can't help me with it.

I'll try this command "touch /etc/securemysqldisable" and will see how it goes.
But customers angry, wery angry.
 

AlexAT

Well-Known Member
PartnerNOC
May 23, 2003
202
0
166
Ukraine
cPanel Access Level
Root Administrator
Currently I have several customers complain about thos problem.
So this fix (touch /etc/securemysqldisable) does not help.

Any ideas?
 

jacampbe

Active Member
Mar 19, 2008
30
0
56
I have found that the cPanel backup job only resets the mySQL privileges for cPanal accounts - ie. those accounts associated with a cPanel domain.
To avoid this problem use a non-cPanel mySQL account with global privileges (SELECT, LOCK TABLES).
It works for me.
 

robertjmoore

Registered
Aug 21, 2009
2
0
51
some options for resolving this

I bumped into this issue yesterday and traced it back through the cPanel update script (and the scripts it calls).

It looks like some options for fixing this are:
  • touch the securemysqldisable file
  • remove the 'removelockntmp' parameter from the securemysql call in mysqlup
  • restore the MySQL privileges daily by inserting mysql calls into postcpup.

- Removed -