MySQL Permissions – Restarting MySQL

I am working with a client that is using managed hosting on dedicated servers. This has presented new challenges in obtaining the right permissions to undertake MySQL tasks but not have either ‘root’ or ‘mysql’ access and not have to involve a third party everytime.

Adding the following to the /etc/sudoers file enabled the ability to restart MySQL.

User_Alias	DBA = rbradfor, user2, etc
Host_Alias 	DB_SERVERS = server1.example.com, server2.example.com, etc
Cmnd_Alias	MYSQL = /etc/init.d/mysqld, /usr/sbin/tcpdump

DBA DB_SERVERS = MYSQL

As you can see I also got tcpdump, which I find valuable to monitor via mk-query-digest .

Next, permissions for log files.

Tagged with: Databases Linux MySQL Uncategorized

Related Posts

Take a look at mk-query-digest

Q: What SQL is running on your MySQL database server now? A: The bane of pain for MySQL DBA’s when there is no official MySQL instrumentation that is dynamic and fine grained sufficiently to solve this problem at the SQL interface.

Read more

Monitoring MySQL resource limits

I have for the first time seen a client implement MySQL Resource Limits . I got the following error tying to connect to the database. $ mysql -udba -p ERROR 1226 (42000): User 'dba' has exceeded the 'max_user_connections' resource (current value: 10) I see from the documentation the ability to see the limits in the mysql.

Read more

Unknown locale for statpack & maatkit

I had trouble today on a client site using my MySQL power tools Maatkit and Statpack . $ ~/scripts/statpack.py --files=mysql.status.091015.080001.txt,mysql.status.091015.090001.txt Traceback (most recent call last): File "/home/rbradfor/scripts/statpack.py", line 563, in ?

Read more