This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

mariadb-access

mariadb-access is a tool for checking access privileges, developed by Yves Carlier.

Prior to MariaDB 10.5, the client used to be called mysqlaccess, and can still be accessed under this name, via a symlink in Linux, or an alternate binary in Windows.

It checks the access privileges for a host name, user name, and database combination. Note that mariadb-access checks access using only the user, db, and host tables. It does not check table, column, or routine privileges specified in the tables_priv, columns_priv, or procs_priv tables.

Usage

mariadb-access [host [user [db]]] OPTIONS

If your MariaDB distribution is installed in some non-standard location, you must change the location where mariadb-access expects to find the mariadb client. Edit the mariadb-access script at approximately line 18. Search for a line that looks like this: <<code> $MYSQL = ´/usr/local/bin/mariadb; # path to mariadb executable <</code>> Change the path to reflect the location where mariadb actually is stored on your system. If you do not do this, a Broken pipe error will occur when you run mariadb-access.

Options

OptionDescription
-?, --helpDisplayhelp and exit.
-v, --versionDisplay version.
-u username, --user=usernameUsername for logging in to the db.
-p[password], --password[=password]Password to use for user. If ommitted, mariadb-access prompts for one.
-h hostname, --host=hostname Name or IP of the host.
-d dbname, --db=dbnameName of the database.
-U username, --superuser=usernameConnect as superuser.
-P password, --spassword=passwordPassword for superuser.
-H server, --rhost=serverRemote server to connect to.
--old_serverConnect to a very old MySQL servers (before version 3.21) that does not know how to handle full WHERE clauses.
-b, --briefSingle-line tabular report.
-t, --tableReport in table-format.
--relnotesPrint release-notes.
--planPrint suggestions/ideas for future releases.
--howtoSome examples of how to run `mariadb-access'.
--debug=NEnter debug level N (0..3).
--copyReload temporary grant-tables from original ones.
--previewShow differences in privileges after making changes in (temporary) grant-tables.
--commitCopy grant-rules from temporary tables to grant-tables (the grant tables must be flushed after, for example with mariadb-admin reload).
--rollbackUndo the last changes to the grant-tables.

Note

At least the user (-u) and the database (-d) must be given, even with wildcards. If no host is provided, `localhost' is assumed. Wildcards (*,?,%,_) are allowed for host, user and db, but be sure to escape them from your shell!! (ie type \* or '*')

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.