Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Give a User Read-Only Access to a Database
How To Give a User Read-Only Access to a Database? - MySQL FAQs - Managing User Accounts and Access Privileges
✍: FYIcenter.com
If you want give a user read-only access to a database, you can grant to him/her only the "SELECT" privilege, so that he/she can not run any DDL statements, and any INSERT, UPDATE, or DELETE statements. The tutorial exercise gives you a good example:
>cd \mysql\bin >mysql -u root -pretneciyf mysql> USE fyi; Database changed mysql> CREATE TABLE links (id INTEGER, name VARCHAR(80)); Query OK, 0 rows affected (0.14 sec) mysql> INSERT INTO links VALUES (1, 'dba.fyicenter.com'); Query OK, 1 row affected (0.05 sec) mysql> CREATE USER guest IDENTIFIED BY 'pub'; Query OK, 0 rows affected (0.24 sec) mysql> GRANT SELECT ON fyi.* TO guest; Query OK, 0 rows affected (0.00 sec) mysql> QUIT; >mysql -u guest -ppub mysql> use fyi; Database changed mysql> SELECT * FROM links; +------+-------------------+ | id | name | +------+-------------------+ | 1 | dba.fyicenter.com | +------+-------------------+ 1 row in set (0.04 sec) mysql> INSERT INTO links VALUES (2, 'dev.fyicenter.com'); ERROR 1142 (42000): INSERT command denied to user 'guest'@'localhost' for table 'links'
2007-05-08, 6661👍, 0💬
Popular Posts:
What will be printed as the resultof the operation below: int x; int modifyvalue() { return(x+=10); ...
What is the significance of Finalize method in .NET? .NET Garbage collector does almost all clean up...
How To Select an Oracle System ID (SID)? - Oracle DBA FAQ - Creating New Database Instance Manually ...
How To Write a Minimum Atom 1.0 Feed File? - RSS FAQs - Atom Feed Introduction and File Generation I...
Write out a function that prints out all the permutations of a string. For example, abc would give y...