This script allows you to connect to a server, retrieve access privilege information, and test the result of specifying user privileges. It does this using copies of the user, db, and host tables from the mysql database. (mysqlaccess cannot be used to experiment with table or column privileges, however.) You can also commit changes you make to the temporary tables back into the actual tables in the mysql database.

To use mysqlaccess, you must have sufficient privileges to access the grant tables yourself.


mysqlaccess [host_name [user_name [db_name]]] options 

Standard Options Supported by mysqlaccess

--host          --password      --user          --version 

Options Specific to mysqlaccess

  • --brief, -b

    Display results in single-line format.

  • --commit

    Copy the temporary grant tables back to the mysql database. Be sure to execute a mysqladmin flush-privileges command afterward so that the server notices the changes.

  • --copy

    Load the grant tables into the temporary tables.

  • --db=db_name, -d db_name

    The database name.

  • --debug=n

    Specify the debugging level. n should be an integer from 0 to 3, with higher values producing greater amounts of diagnostic output.

  • --howto

    Display some examples demonstrating how to use mysqlaccess.

  • --old_server

    Use this option when the server is older than MySQL 3.21; it causes mysqlaccess to make certain adjustments to the queries that it sends to the server.

  • --plan

    Display a list of enhancements planned for future releases of mysqlaccess.

  • --preview

    Display the privilege differences between the actual and temporary grant tables.

  • --relnotes

    Print the mysqlaccess release notes.

  • --rhost=host_name, -H host_name

    The remote server host to connect to.

  • --rollback

    Undo the changes made to the temporary grant tables.

  • --spassword=pass_val, -P pass_val

    The password for the MySQL superuser (a user with sufficient privileges to modify the grant tables).

  • --superuser=user_name, -U user_name

    The username for the MySQL superuser.

  • --table, -t

    Display results in tabular format.