Get the App
SLTechnology News&Howtos  ›  Database  › 

How to add users and empower a database in MySQL 8.0.18

Shulou Source: shulou.com Published: 2022-05-31 22:07:30 09月30日 Update

How to add users and empower a database in MySQL 8.0.18? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1. Preferred to use root users to log in to the database

Mysql-uroot-p

two。 Using the mysql database

USE mysql

3. Create a user for mysql: dev password is: dev12345

CREATE USER dev IDENTIFIED BY 'dev12345'

4. Check the permissions of user dev

SELECT * FROM user WHERE user='dev'; SHOW GRANTS FOR dev

5. Give user dev EXECUTE (execute stored procedure) on the database name dev_db, INSERT,SELECT,UPDATE permission, @'% 'means that the database can be accessed from any ip

GRANT EXECUTE,INSERT,SELECT,UPDATE ON dev_db.* TO 'dev'@'%';FLUSH PRIVILEGES

6. Query the permissions again.

SELECT * FROM USER WHERE USER='dev_dv'; SHOW GRANTS FOR dev; after reading the above, do you know how to add users and empower the database in MySQL 8.0.18? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Data databases users permissions empowerment content methods more problems passwords for this again reasons passwords skills articles experience industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Technology Redmi Docker Shulou Information