简体   繁体   中英

How can I lock a table in PHPMyAdmin so it can't be modified?

I'm trying to lock a certain table (called gmd_settings ) so it can't be modified anymore, but my lack of experience with MySQL and PHPMyAdmin plagues me. I need it explained to me how I would do this in simple terms, to someone that doesn't manage MySQL databases for a living.

To accomplish this, you should set up proper permissions. MySQL allows you to set permissions not only on a database and table level, but also on individual columns. If you create a new user (or edit the user you're using for this project) and set the permissions you desire, you can limit the user's ability to edit the gmd_settings table. Make sure you don't lock yourself out and I suggest that you make sure you understand what's happening rather than just copying the steps I outline. With that being said, here's what I would do:

Click on the Users tab and the Edit Privileges for the user you wish to edit (or Add a new user).

Near the top, look for the second level of tabs where you can select "Database": 数据库选项卡

Then select your database from the list and click Go: 数据库选择器

Next, from the second level of tabs again click on "Table"

Now you have to add permissions for each table. From the dropdown select each table in turn and grant the proper set of permissions. For gmd_settings , that might be only SELECT, for the rest you'll probably at least also need INSERT and UPDATE. Again, these will depend on your configuration and specific needs; you should have some understanding of what you're doing here.

仅限选择权限

选择,插入和更新权限 Hopefully that will get you where you want to be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM