 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
MySQL new user access denied even after giving privileges?
After creating a user and giving all privileges to the user, you need to FLUSH PRIVILEGES to set up and want the new settings to work correctly.
The syntax is as follows −
FLUSH PRIVILEGES;
Here is the query to create a new user which has the name ‘Bob’ in my case. The query to create a new user is as follows −
mysql> CREATE USER 'Bob'@'%' IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.56 sec)
Now given all privileges to user Bob −
mysql> GRANT ALL PRIVILEGES ON *.* TO 'Bob'@'%' WITH GRANT OPTION; Query OK, 0 rows affected (0.23 sec)
Now flush the privileges. The query is as follows −
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.14 sec)
Now here I am using user Bob with password 123456. The snapshot is as follows −

Advertisements
 