Collections:
Giving Privileges at the Database Level in MySQL
How To Grant User Privileges at the Database Level in MySQL?
✍: FYIcenter.com
If you want to grant a user privilege at the database level, you can use the "GRANT privilegeName ON databaseName.* TO userName" command. The argument "databasename.*" in the command stands for all tables in the specified database. The following tutorial exercise shows you how to create a new database and grant access privilege to a user only for this new database:
>cd \mysql\bin >mysql -u root -pretneciyf mysql> CREATE DATABASE faq; Query OK, 1 row affected (0.04 sec) mysql> CREATE USER qa IDENTIFIED BY 'iyf'; Query OK, 0 rows affected (0.24 sec) mysql> GRANT CREATE ON faq.* TO qa; Query OK, 0 rows affected (0.00 sec) mysql> QUIT; >mysql -u qa -piyf mysql> USE faq; Database changed mysql> USE fyi; ERROR 1044 (42000): Access denied for user 'qa'@'%' to database 'fyi'
⇒ Viewing User Privileges in MySQL
⇐ Giving Privileges at Server Level in MySQL
2017-08-21, 2157🔥, 0💬
Popular Posts:
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
How To Disable a Login Name in SQL Server? If you want temporarily disable a login name, you can use...
How To Convert Numeric Expression Data Types using the CAST() Function in SQL Server Transact-SQL? I...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...