Monday, July 16, 2012

DATABASE SECURITY


 There are security guidelines in a database particularly in mysql. One of the guidelines is for privacy and security of the database. For example, do not give the password to anyone or to unauthorized person.


Access Privileges

The access privilege is to give a user a privilege to access the databases such as INSERT, UPDATE, DELETE, SELECT. The access privileges enable the user to manage the operation or the record in MySql server.
The access privilege system are the CREATE, GRANT, REVOKE.

The Mysql Access Privilege System which is the CREATE, GRANT, REVOKE. The CREATE privilege is to create a user/account to the mysql. The syntax in creating an account is CREATE USER 'name'@'localhost' IDENTIFIED BY 'password'; 


The grant is to grant the user to access the database. the syntax is GRANT ALL ON db1.tablename TO 'name'@'localhost';

 


The syntax of revoke REVOKE INSERT ON *.* FROM 'name'@'localhost;
  




Permissions
The example of different kinds of permissions are Select_priv; permission to run SELECT queries,
Insert_priv, this is permission to run INSERT statements.  Update_priv, this is the permission to run UPDATE statements. Delete_priv, this is the permission to run DELETE statements. Create_priv, this is the permission to CREATE tables and databases.

The Account Management
To manage the account in the database, first is to CREATE USER, if you want to delete the account, DROP USER. The GRANT is to grant the user to all the priveleges mentioned above.  The RENAME USER used to rename the name of the user. The REVOKE used when you don’t want to give privileges the user. The SET PASSWORD is to set a password in the database.

  

No comments:

Post a Comment