MySQL manage users

Posted In: blog |

1. Removing users from the database.

2. Creating users – 3 common ways:

A) The default way:

B) As an insert statements:

C) Batch adding users. Create a file (useradd.sql for example) which contains all create users statements :

and then execute the script:

2.1 Adding specific grants for users

Allow only insert,update,delete for one table:

2.1 Adding specific grants for all tables starting with prefix

Allow only insert,update,delete for tables with the same prefix:

3. List of mysql users

4. Check users grants

If You want to get a detailed information on permissions (user level, schema level, table level) for every user and every table:

  • Produce SQL to transfer grants between dbs

  • And a one-liner for newer versions of mysql

    Post Tags: administration | mysql |

    Comments Off on MySQL manage users