3

I am using debian-sys-maint as practical way to do database dumps in our debian systems, somenthing like this:

mysqldump -u debian-sys-maint -p`cat /etc/mysql/debian.cnf | grep password | tail -n 1 | cut -d' ' -f3`

I would like to know if there is a similar user to this in CentOS, I just need the user to be able to make backups. This way I don't have to create a new user on every system. The interesting part of this is that /etc/mysql/debian.cnf contains the clear password for the debian-sys-maint.

2 Answers 2

3

No, there is no such MySQL user created by default in CentOS.

3
  • That's a pity, then how is it handled when doing an upgrade from i.e. mysql 4.1 to 50 (where there are queries involved) or the mysqlcheck that needs to be done in case a table crashed? Or the log rotations? In debian all this stuff is being/can be done with the debian-sys-maint user. For all those actions you are prompted for the mysql root password?
    – aseques
    Oct 7, 2013 at 12:19
  • Major version upgrades must be performed by the user manually, since a given distro version will not contain a major version upgrade. The other operations are left to the sysadmin to prepare for. Oct 7, 2013 at 12:21
  • I accept you solution, alought it sadly confirms that I will have to precreate a user for dumps in all the centos I manage. Thanks anyway
    – aseques
    Oct 9, 2013 at 6:48
-1

debian-sys-maint user is by default a root equivalent on RHEL/CentOS. root exists on any mysql installations.

2
  • The interesting part is that on every debian install there's the password for that user in /etc/mysql/debian.cnf, so the database dumps can be scripted even when you don't know the password for the root user.
    – aseques
    Oct 7, 2013 at 12:17
  • You need to have Linux root access to be able to read the contents of /etc/mysql/debian.cnf. But as you said, you don't need the MySQL ` root` password, as debian-sys-maint is equvivalent to MySQL root user. I would make a backup user anyway, as that would not have write access to all databases, just read.
    – Anders
    Jan 2, 2015 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.