How to revoke MySQL user access from a database?

People who manage a dedicated server are likely making the most out of their purchase by using a MySQL database. MySQL is the industry standard in data management across the Internet. Its compatibility with various server-side languages give it a presence all over the Web. Finally, MySQL offers its owner complete control of how data is manipulated in the database.

It's easy enough to see how MySQL can be of great assistance to any web master. However, MySQL is also a prime target for many Internet hackers. Any web master's data management security can be compromised if someone gets a hold of login information to access the database. Thus, database managers should be careful in what permissions are delegated to other users.

If a user is abusing privileges, the MySQL database manager can revoke his or her permissions. All it requires is a simple SQL query. Suppose you have a database named MyDatabase and a bad user named EvilUser. To prevent EvilUser's access to MyDatabase, you would simply enter:

  • REVOKE ALL PRIVILEGES
  • ON MyDatabase.*
  • FROM EvilUser@localhost;

Nonetheless, the use of REVOKE is not exclusive to preventing malicious manipulation of a data management system. A wise database owner only delegates privileges to those who need them. Thus, REVOKE can also be used to limit only certain privileges:

  • REVOKE DELETE, DROP
  • ON MyDatabase.*
  • FROM LimitedUser@localhost;

By using the REVOKE SQL query, database management through MySQL becomes much more secure. Delegating only certain powers over a database and keeping a watchful eye out for malicious users is essential to successfully maintain a database.

  • 0 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

Advantages and Disadvantages of Using Linux Over UNIX?

Choosing a dedicated hosting solution forces a close look at the choices. For most businesses it...

Advantages and Disadvantages of Using Linux Over UNIX?

Choosing a dedicated hosting solution forces a close look at the choices. For most businesses it...