grant

MySQL grant all privileges to database except one table

此生再无相见时 提交于 2019-11-26 07:34:03
问题 I\'ve been unable to find a reasonable solution to achieve the following: I wish to have a user that has ALL privileges on a database (or series of databases with the same schema), except for one table, to which they will only have SELECT privileges. Essentially I want the user to have free reign over a database but not to be able to update a specific table. So far I have tried, to no avail: Granting all privileges on that database (db_name.*) and then specifically granting only select

Permission denied for relation

╄→гoц情女王★ 提交于 2019-11-26 06:52:43
问题 I tried to run simple sql command: select * from site_adzone; and I got this error ERROR: permission denied for relation site_adzone What could be the problem here? I tried also to do select for other tables and got same issue. I also tried to do this: GRANT ALL PRIVILEGES ON DATABASE jerry to tom; but I got this response from console WARNING: no privileges were granted for \"jerry\" Do you have some idea what can be wrong? 回答1: GRANT on the database is not what you need. Grant on the tables

How to grant remote access permissions to mysql server for user?

不羁的心 提交于 2019-11-26 03:20:00
问题 If I do SHOW GRANTS in my mysql database I get GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' IDENTIFIED BY PASSWORD \'some_characters\' WITH GRANT OPTION If I am not mistaken, root@localhost means that user root can access the server only from localhost . How do I tell MySQL to grant root the permission to access this mysql server from every other machine (in the same network), too? 回答1: This grants root access with the same password from any machine in *.example.com : GRANT ALL

MySQL用户和权限管理

空扰寡人 提交于 2019-11-26 01:22:24
用户管理 帐号名称 MySQL帐户名由用户名和主机名组成,这可以为具有相同用户名且可以从不同主机进行连接的用户创建不同的帐户。 语法: 'user_name'@'host_name' 主机值可以是主机名或IP地址(IPv4或IPv6)。 主机名或IP地址值中允许 使用%和_通配符。 %:表示任意长度的任意字符 _:表示任意单个字符 注:账户名的主机名部分(如果省略)默认为'%' 用户管理 创建用户:CREATE USER 创建用户hechunping可以在192.168.7.72这台主机连接当前MySQL服务器 mysql> create user 'hechunping'@'192.168.7.72'; mysql> select user,host from user; +---------------+--------------+ | user | host | +---------------+--------------+ | hechunping | 192.168.7.72 | | root | localhost | +---------------+--------------+ 注:默认情况下,新建的用户只有连接权限(USAGE) 重命名用户:RENAME USER 重命名用户hechunping为hcp mysql> rename user

mysql权限问题

风流意气都作罢 提交于 2019-11-26 00:34:39
mysql权限系统介绍 mysql权限系统功能:实现对用户的权限控制。 具体控制这些权限: 权限 权限级别 权限说明 CREATE 数据库、表或索引 创建数据库、表或索引权限 DROP 数据库或表 删除数据库或表权限 ALTER 表 更改表,比如添加字段、索引等 DELETE 表 删除数据权限 INDEX 表 索引权限 INSERT 表 插入权限 SELECT 表 查询权限 UPDATE 表 更新权限 FILE 服务器主机上的文件访问 文件访问权限 CREATE USER 服务器管理 创建用户权限 LOCK TABLES 服务器管理 锁表权限 SHOW DATABASES 服务器管理 查看数据库权限 SHUTDOWN 服务器管理 关闭数据库权限 REPLICATION CLIENT 服务器管理 复制权限 RELOAD 服务器管理 执行flush-hosts, flush-logs, flush-privileges, flush-status, flush-tables, flush-threads, refresh, reload等命令的权限 GRANT OPTION 数据库、表或保存的程序 赋予权限选项 权限系统实现原理 mysql的权限信息存储在如下几个被称为grant tables的系统表中。 mysql.User mysql.db mysql.table_priv

grant remote access of MySQL database from any IP address

≡放荡痞女 提交于 2019-11-25 23:24:14
问题 I am aware of this command: GRANT ALL PRIVILEGES ON database.* TO \'user\'@\'yourremotehost\' IDENTIFIED BY \'newpassword\'; But then it only allows me to grant a particular IP address to access this remote MySQL database. What if I want it so that any remote host can access this MySQL database? How do I do that? Basically I am making this database public so everyone can access it. 回答1: TO 'user'@'%' % is a wildcard - you can also do '%.domain.com' or '%.123.123.123' and things like that if