Database administrators should use the following guidelines to keep passwords secure.
MySQL stores passwords for user accounts in the
mysql.user table. Access to this table should
never be granted to any nonadministrative accounts.
A user who has access to modify the plugin directory (the value
of the plugin_dir system
variable) or the my.cnf file that specifies
the location of the plugin directory can replace plugins and
modify the capabilities provided by plugins, including
authentication plugins.
Passwords can appear as plain text in SQL statements such as
CREATE USER,
GRANT, and
SET PASSWORD, or statements that
invoke the PASSWORD() function.
If these statements are logged by the MySQL server, the
passwords become available to anyone with access to the logs.
As of MySQL 5.6.3, passwords in statements written to the
general query log, slow query log, and binary log are rewritten
by the server not to occur literally in plain text. Password
rewriting can be suppressed for the general query log by
starting the server with the
--log-raw option. This option may
be useful for diagnostic purposes, to see the exact text of
statements as received by the server, but for security reasons
is not recommended for production use.
To guard against unwarranted exposure to log files, they should
be located in a directory that restricts access to only the
server and the database administrator. If you log to tables in
the mysql database, access to the tables
should never be granted to any nonadministrative accounts.
Replication slaves store the password for the replication master
in the master.info file. Retrict this file
to be accessible only to the database administrator.
Database backups that include tables or log files containing passwords should be protected using a restricted access mode.

User Comments
Add your own comment.