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.

aseques
  • 718
  • 4
  • 12
  • 28

2 Answers2

3

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

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • 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 07 '13 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. – Ignacio Vazquez-Abrams Oct 07 '13 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 09 '13 at 06:48
-1

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

  • 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 07 '13 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 02 '15 at 05:07