![]() | 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. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |