

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we set up a MySQL User account by using SQL GRANT statement?
We can also add user account by using GRANT SQL command. It can be illustrated by using the following example −
Example
In this example, we will add user Zara with password zara123 for a particular database,
which is named as TUTORIALS.
root@host# mysql -u root -p password; Enter password:******* mysql> use mysql; Database changed mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP -> ON TUTORIALS.* -> TO 'zara'@'localhost' -> IDENTIFIED BY 'zara123';
The above statements will also create an entry in the MySQL database table called as a user.
- Related Questions & Answers
- How can we set up a MySQL User account by using INSERT INTO statement?
- How can we change MySQL user password by using the SET PASSWORD statement?
- How can we grant privileges to a MySQL user?
- How can we change MySQL user password by using the ALTER USER statement?
- How can we create a MySQL user account by omitting the hostname?
- How can we change MySQL user password by using UPDATE statement?
- How can we grant a user to access all stored procedures in MySQL?
- How can we use SET statement to assign a SELECT result to a MySQL user variable?
- How to display grant defined for a MySQL user?
- How to set the local user account settings using PowerShell?
- Grant all privileges of a database to a MySQL user?
- Grant a user permission to only view a MySQL view?
- How can we revoke privileges from a MySQL user?
- MySQL query to create user and grant permission
- SQL statement to create a Restricted user in SAP HANA
Advertisements