mysqld  can (and should) be run as an ordinary, unprivileged user instead. You can create a separate Unix account named mysql  to make everything even more secure. Use this account only for administering MySQL. To start mysqld  as a different Unix user, add a user  option that specifies the user name in the [mysqld]  group of the my.cnf  option file where you specify server options. For example: 

[mysqld] user=mysql 

This causes the server to start as the designated user whether you start it manually or by using mysqld_safe  or mysql.server . For more details, see Section 6.1.5, “How to Run MySQL as a Normal User” . 

Running mysqld  as a Unix user other than root  does not mean that you need to change the root  user name in the user  table. User names for MySQL accounts have nothing to do with user names for Unix accounts . 

•Do not grant the FILE  privilege to nonadministrative users. Any user that has this privilege can write a file anywhere in the file system with the privileges of the mysqld  daemon. This includes the server’s data directory containing the files that implement the privilege tables. To make FILE -privilege operations a bit safer, files generated with SELECT ... INTO OUTFILE  do not overwrite existing files and are writable by everyone. 

The FILE  privilege may also be used to read any file that is world-readable or accessible to the Unix user that the server runs as. With this privilege, you can read any file into a database table. This could be abused, for example, by using LOAD DATA  to load /etc/passwd  into a table, which then can be displayed with SELECT . 

To limit the location in which files can be read and written, set the secure_file_priv  system to a specific directory. See Section 5.1.8, “Server System Variables” . 

•Encrypt binary log files and relay log files. Encryption helps to protect these files and the potentially sensitive data contained in them from being misused by outside attackers, and also from unauthorized viewing by users of the operating system where they are stored. You enable encryption on a MySQL server by setting the binlog_encryption  system variable to ON . For more information, see Section 17.3.2, “Encrypting Binary Log Files and Relay Log Files” . 

•Do not grant the PROCESS  or SUPER  privilege to nonadministrative users. The output of mysqladmin processlist  and SHOW PROCESSLIST  shows the text of any statements currently being executed, so any user who is permitted to see the server process list might be able to see statements issued by other users. 

mysqld  reserves an extra connection for users who have the CONNECTION_ADMIN  or SUPER  privilege, so that a MySQL root  user can log in and check server activity even if all normal connections are in use. 

The SUPER  privilege can be used to terminate client connections, change server operation by changing the value of system variables, and control replication servers. 

•Do not permit the use of symlinks to tables. (This capability can be disabled with the --skip- symbolic-links  option.) This is especially important if you run mysqld  as root , because anyone that has write access to the server’s data directory then could delete any file in the system! See Section 8.12.2.2, “Using Symbolic Links for MyISAM Tables on Unix” . 

•Stored programs and views should be written using the security guidelines discussed in Section 25.6, “Stored Object Access Control” . 

