1

A fresh install of MySQL 8 on Linux yields the following default users for us:

debian-sys-maint
mysql.infoschema
mysql.session
mysql.sys
root

After creating our own users, with the correct privileges, we are thinking of deleting all the users, other than root (i.e. debian-sys-maint, mysql.infoschema, mysql.session and mysql.sys).


Q) Is it okay to delete the default users, other than root, or will there be any unexpected surprises if we do that?

2 Answers 2

1

MySQL 8.0 Reference Manual / ... / Reserved Accounts

You may drop 'root'@'localhost' if you're sure that there exists at least one user with complete privileges set (compare SHOW GRANTS outputs !!!).

mysql.infoschema, mysql.session and mysql.sys are locked and cannot be used for user authentication. Do not alter them - this may cause serious problems.

1

According to this serverfault answer, you should not remove the debian-sys-maint user, or your system will have problems rotating logs, and be unable to start and stop the database service.

One major thing it is used for is telling the server to roll the logs. It needs at least the reload and shutdown privilege.

See the file /etc/logrotate.d/mysql-server

It is used by the /etc/init.d/mysql script to get the status of the server. It is used to gracefully shutdown/reload the server.

The answer also quotes README.debian

* MYSQL WON'T START OR STOP?:
=============================
You may never ever delete the special mysql user "debian-sys-maint". This user
together with the credentials in /etc/mysql/debian.cnf are used by the init
scripts to stop the server as they would require knowledge of the mysql root
users password else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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