473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Prevent a table from being dropped

code green
1,726 Expert 1GB
Is there a way to apply security at table level rather than database level.
A critical table in-house mysteriously disappeared the other day.

Although it shouldn't be necessary I would like only one person with the power to DROP this critical table.

Can privileges be set at table level.
I am working in phpmyadmin
Dec 29 '09 #1
2 4704
Atli
5,058 Expert 4TB
Hey.

Yes, you can define privileges all the way down to individual columns.
You can read all about the specifics in the manual. (12.5.1.3. GRANT Syntax)

But it basically goes like this:
Expand|Select|Wrap|Line Numbers
  1.  -- Global. Applies to all databases, all tables, all columns
  2. GRANT ALL ON *.* ...
  3.  
  4.  -- Database specific. Applies to all tables in that database.
  5. GRANT ALL ON myDb.* ...
  6.  
  7.  -- Tables specific. Applies to all columns in that table.
  8. GRANT ALL ON myDb.myTable ...
  9.  
  10.  -- Column specific. Applies only to the specified columns
  11. GRANT
  12.    SELECT (col1, col2),
  13.    INSERT (col2)
  14.    UPDATE (col1)
  15. ON myDb.myTable ...
Database specific privileges are stored in the 'mysql.db' and 'mysql.host' tables. Table specific in the 'mysql.tables_priv' table and column specific in the 'mysql.columns_priv' table.
You can use them to see which users have access to what commands on which database. If you have root access, you can also edit those tables to modify them.
Remember! Do not modify the mysql tables, though, unless you have backed up the database! In case something goes wrong :)
Dec 30 '09 #2
code green
1,726 Expert 1GB
Thanks Atli. I will take a closer look at manual
Dec 30 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
0
by: djefanten | last post by:
Hi, I have a windows form with a combobox on it (it has the DropDown as DropDownStyle, which means you can type free text in it OR you can select from a list). At the moment that combobox...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
2
by: xixi | last post by:
hi, i found that in alter table command , you can do activate not logged initially to help not log any changes made to the table to log file, cause i have to delete almost 1 million records and my...
1
by: efiryago | last post by:
I have about 200 tables in a DB2 V8.1.4 LUW application schema. There is a third party java appllication that accesses this schema. It started failing and relevant entries in db2diag.log have this:...
1
by: Steve Bottoms | last post by:
Hi, all! How does one prevent table cell background colors from alternating between grey and white? I've dropped a basic table control on an ASP.Net page (using VB.Net codebehind), and...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
1
by: No bother | last post by:
If I have a procedure that will be run simultaneously by several people which requires the use of a temporary table is there a way for the table to be accessible only in the instance in which the...
0
by: bbkm | last post by:
when i am doing dropped table reccovery step1- the tablespace should be in recovery mode is it rite step2 - the database should be in archivelog mode is it rite step-3 - identify the dropped table...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.