

| Replication slave | Server Admin | To read binary log events from the master | | Replication client | Server Admin | To ask where the slave or master servers are | | Reload | Server Admin | To reload or refresh tables, logs and privileges | | References | Databases,Tables | To have references on tables | | Proxy | Server Admin | To make proxy user possible | | Process | Server Admin | To view the plain text of currently executing queries | | Lock tables | Databases | To use LOCK TABLES (together with SELECT privilege) | | Insert | Tables | To insert data into tables | | Index | Tables | To create or drop indexes | | Grant option | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess | | File | File access on server | To read and write files on the server | | Execute | Functions,Procedures | To execute stored routines | | Event | Server Admin | To create, alter, drop and execute events | | Drop role | Server Admin | To drop roles | | Drop | Databases,Tables | To drop databases, tables, and views | | Delete | Tables | To delete existing rows | | Create user | Server Admin | To create new users | | Create view | Tables | To create new views |

| Create temporary tables | Databases | To use CREATE TEMPORARY TABLE | | Create role | Server Admin | To create new roles | | Create routine | Databases | To use CREATE FUNCTION/PROCEDURE | | Create | Databases,Tables,Indexes | To create new databases and tables | | Alter routine | Functions,Procedures | To alter or drop stored functions/procedures | To list them all, just run: mysql> show privileges In 8.0.13, they are currently 46 privileges ! It’s now time to grant more privileges to our user… but which privileges are available ?

The default privilege is very limited: mysql> show grants It seems I don’t have access to many databases… Let’s change it to ‘ MySQL8isGreat‘: mysql> set password='MySQL8isGreat' Īnd now we can use MySQL and run any statement we are allowed to do (that we have the privileges for). Statement before executing this statement.
#Mysql create user query ok 0 rows affected password#
Yes I did, let’s try any statement: mysql> select now() ĮRROR 1820 (HY000): You must reset your password using ALTER USER Nothing special, we are connected as expected… but didn’t I explicitly expired the password ? Type '\c' to clear the current input statement. Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and/or itsĪffiliates. Commands end with or \g.Ĭopyright (c) 2000, 2018, Oracle and/or its affiliates. Mysql: Using a password on the command line interface can be insecure. Let’s try to connect to MySQL using that new created user: $ mysql -u user1 -pChangeMe -h localhost Let’s create a user ‘ user1‘ with ‘ ChangeMe‘ as password that the user will have to change: mysql> create user 'user1' identified by 'ChangeMe' password expire This means that to grant some privileges, the user must be created first. To start, let’s highlight the fact that in MySQL 8.0 it’s not any more possible to create a user directly from the GRANT command ( ERROR 1410 (42000): You are not allowed to create a user with GRANT). It seems, that this is a question that regularly shows up in forums or stackoverflow.
