
What you really want, I believe, is an audit plugin. In MySQL 5.5 the Audit API was added to the server. Please not that init_connect is not being processed for logins of a root user (SUPER_PRIV) for security reasons. A value of system user refers to a nonclient thread spawned by the server to handle tasks internally, for example, a delayed-row handler thread or an I/O (receiver) or SQL (applier) thread used on replica hosts. Use an InnoDB table with auto_increment id for this. > show global variables like 'init%' īy setting init_connect to an insert statement that logs current user, the current time and the connection id you can generate the log you want in a more scaleable way. There is a set of variables which can define actions on server start, slave connect and user connect.

Other formats for the general query log are not supported. This is very extremely slow and not adviseable at all even on low load servers. For that, a table lock on the MyISAM log table is requested. The only problem is I cant remember what I typed, so dont know what to delete.
#MYSQL LIST ALL USERS FULL#
Ive got everything sorted now, but I want to clean up all the screwed up ones Ive entered along the way. Even though there is no such command, users can use a MySQL query and get a full list of users in a given MySQL database server. For that, a write to the general query log is necessary. Im running through a book on mySQL and have messed up adding users. That is, because every query will need to be logged, even read queries. If your general query log is a CSV table, it cannot be queried efficiently, and if it is a MyISAM table, it will essentially serialize all queries (even read queries!) in your database.

Using the general query log for that as suggested elsewhere is not a good idea, as it does not scale at all: The general query log records every single statement your server sees and writing it adds considerably to the contention on LOCK_log and to disk I/O.

The users currently maintaining a connection to the database can be had by looking at SHOW PROCESSLIST or INFORMATION_SCHEMA.PROCESSLIST.Ī historical record of that data is not to be had.
