Saturday, July 14, 2012

Database Security

Access Privilege System



Database is the most important part of a system. all files that are process in the main system are stored in this area/part of system. So, you must secure it properly. To secure it:


* You must not give anyone access to the users table in the MySQL database.
* You should know how MySQL access privilege works.
* You should always use SHOW GRANTS statement to check which account you have access.
* You should not store plain text password in your database.
* You should not transmit plain data over the internet.
* You should invest a firewall.


These are some of the security guidelines that we should aware to secure our databases.


There are too many Permission Privilege in grant and revoke
Select_priv          Permission to run SELECT queries
Create_priv         Permission to CREATE tables and databases
Insert_priv           Permission to run INSERT statements


see others: click here...






Account Management

You should create a user rather than using root because using root is unsafe and unsecured.


+ Creating user:
This is the code to create a user.
CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘password’;


After creating a user the user is now stored in mysql database.
As you can see, we now created a new user. This is where the user is stored.



+ Grant user:
This is the code to grant a user.
GRANT USAGE ON *.* TO 'username'@'localhost' WITH GRANT OPTION



+ Rename user:
This is the code to rename a user.
RENAME USER ‘username’@’localhost’ TO ‘new_username’@’localhost’;


After renaming a user...
Now, you've change your username.




+ Drop user:
This is a code to drop a user.
DROP USER ‘username’@’localhost’;


Source: www.mysql.com

No comments:

Post a Comment