简体   繁体   English

什么是锁定mysql数据库的最佳方法。 没有创建更新和删除操作

[英]what is the best approach to lock the mysql database. no create update and delete opparation

Actually i am currently working on a construction management system which is built in yii. 实际上我目前正在建设一个建于yii的施工管理系统。 Now one project is completed and we have to give them data in view format. 现在一个项目已经完成,我们必须以视图格式提供数据。 we guys are planing to transfer their data on another link so they only can view data. 我们正计划在另一个链接上传输他们的数据,以便他们只能查看数据。

What is the best way to lock the database, or any other idea is much appreciated. 锁定数据库的最佳方法是什么,或任何其他想法非常感谢。

Thanks. 谢谢。

Use database permissions: create SQL users and grant them only read-related privileges. 使用数据库权限:创建SQL用户并仅授予他们与读取相关的权限。 You have read/write permissions, your clients read-only. 您具有读/写权限,您的客户端是只读的。

Exact syntax is DBMS-dependent, but the statement to use is GRANT 确切语法与DBMS相关,但要使用的语句是GRANT

该语句以只读模式打开数据库:

ALTER DATABASE OPEN READ ONLY;

Use database permissions, but I would do it with PHPMyAdmin or MySQL Workbench. 使用数据库权限,但我会使用PHPMyAdmin或MySQL Workbench。 Only provide the users the password for the read-only user account. 仅向用户提供只读用户帐户的密码。 You can grant only select authority to the read only user. 您只能向只读用户授予选择权限。 However, root will always have all authority to any database on the server, so if they are using thier own server, you will be out of luck. 但是,root将始终拥有服务器上任何数据库的所有权限,因此如果他们使用自己的服务器,那么您将失去运气。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 终端功能创建数据库。 Bash到Mysql? - Terminal function to create database. Bash to Mysql? 将本地数据库sqlite与生产服务器(MySQL)同步的最佳方法是什么? - What is the best approach for sync local database sqlite with Production server (MySQL)? 在 GCP 帐户之间迁移 MySQL 数据库的最佳方法是什么? - What is the best approach to migrate MySQL database between GCP Accounts? 在ExtJS 4中,将树的节点和子节点保存到MySQL数据库中。 关于ExtJS最简单的方法有什么想法吗? - In ExtJS 4, saving the nodes and children of a tree into a MySQL database. Any ideas as to what approach would be the easiest, as I'm new to ExtJS? MySQL创建或更新锁 - Mysql create or update lock 删除MySQL整个数据库。 数据库未显示在MySQL数据库中 - delete MySQL entire database. Database not showing in MySQL Databases 大规模的MySQL更新最佳方法? - Massive MySQL update best approach? 在实际的mysql系统中处理DELETE的最佳方法 - Best approach to deal with DELETE in real mysql system 设置此数据库模型(MySQL)的最佳方法? - Best approach to set up this database model (MySQL)? .net核心数据库托管的最佳方法是什么? - What is the best approach for .net core database hosting?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM