grant

报错:1130-host ... is not allowed to connect to t...

断了今生、忘了曾经 提交于 2019-12-05 19:17:40
报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。 例如,你想myuser使用mypassword从任何主机连接到mysql 服务器 的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql 服务器 ,并使用mypassword作为密码 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'

oracle常用命令整理

柔情痞子 提交于 2019-12-05 14:27:12
用户 创建用户: create user username identified by password; 创建用户并指定表空间: CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE tablespacename; 用户授权: grant create session, connect, resource to username; 授予全部权限 grant all privileges to username; -- 最好不要授权dba给普通用户 授权创建表 grant create any table to username; 授权创建视图: grant create any view to username; 修改用户密码: alter user username identified by password; 撤销用户权限: revoke privileges from username; 表空间 创建表空间: create tablespace tblspacename datafile 'xxxx.dbf' size 10m; 将表空间分配给用户: ALTER USER username DEFAULT TABLESPACE tablespacename; 查看表空间的位置: select file

mysql学习笔记----增加新用户权限

不问归期 提交于 2019-12-05 11:33:12
1.向MySql增加新用户权限: 第一种:使用GRANT语句 比较好的方法,更简明并且错误少 mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 超级用户,本机连接,完全权限 mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 超级用户,其他主机,完全权限 mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost'; 账户用户名admin,没有密码,只能本机连接,授予RELOA和PROCESS管理权限。 这些权限允许admin用户执行mysqladmin reload、mysqladmin refresh和 mysqladmin flush-xxx命令,以及mysqladmin processlist。 未授予访问数据库的权限。你可以通过GRANT语句添加此类权限。 mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost'; 一个账户有用户名dummy,没有密码。该账户只用于从本机连接。

数据库安全性

旧城冷巷雨未停 提交于 2019-12-05 09:22:37
1 all previleges语法错误 2 3 二、数据库的安全性控制 4 1、存取控制 5 ①自主存取控制(DAC)(C2级) 6 [例1] 把查询Student表权限授给用户U1 7 grant select 8 on student 9 to u1 10 [例2] 把对Student表和Course表的全部权限授予用户U2和U3 11 12 [例3] 把对表SC的查询权限授予所有用户 13 grant select 14 on sc 15 to public 16 [例4] 把查询Student表和修改学生学号的权限授给用户U4 17 grant select, update(sno) 18 on student 19 to u4 20 [例5] 把对表SC的INSERT权限授予U5用户,并允许他再将此权限授予其他用户 21 grant insert 22 on sc 23 to u1 24 with grant option 25 [例8] 把用户U4修改学生学号的权限收回 26 revoke update(sno) 27 on student 28 from u1 29 [例9] 收回所有用户对表SC的查询权限 30 revoke select 31 on sc 32 from public 33 [例10] 把用户U5对SC表的INSERT权限收回 34 revoke

Mysql: execute command denied to user ''@'localhost' for routine error

牧云@^-^@ 提交于 2019-12-05 08:48:36
问题 i got some problem during open my old website. My dataTable show: DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error. After that, I tried to debug my script and found error in mysql: Error occuered during query execution: (<small>SELECT SQL_CALC_FOUND_ROWS ID,name,remark,avrusepmonth , CONCAT('<input type=''checkbox''id=''cb' , ID ,''' name=''check[]'' value=''',ID,''' >','<label class=''lbcb'' for=''cb', ID,'''><=update=</label>') as

如何修改mysql root密码

耗尽温柔 提交于 2019-12-05 08:08:45
如何修改mysql root密码 忘记MySQL ROOT密码是在MySQ使用中很常见的问题,可是有很多朋友并不会重置ROOT密码,那叫苦啊,特写此文章与大家交流: 1、编辑MySQL的配置文件:my.ini 一般在MySQL安装目录下有my.ini即MySQL的配置文件。 在此配置文件的最后添加如下一行: skip-grant-tables 保存退出编辑。 2、然后重启MySQL服务 在命令行下执行: net stop MySQL net start MySQL 3、设置新的ROOT密码 然后再在命令行下执行: MySQL -u root -p MySQL或mysql -u root -p 直接回车无需密码即可进入数据库了。 此时,在命令行下执行 use mysql; 现在我们执行如下语句把root密码更新为: update user set password=PASSWORD("root") where user='root'; (注意:此时不用使用mysqladmin -u root -p password '你的新密码'这条命令修改密码,因为'skip-grant-tables'配置, 不信的话,你可以试用一下,它肯定会报如下所示的错误: F:\Documents and Settings\long>mysqladmin -u root -p password 'root'

Query GRANTS granted to a sequence in postgres

半城伤御伤魂 提交于 2019-12-05 04:02:13
To query GRANTS granted to a table I can use a query like: SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE table_name='mytable' (see my old question here: Query grants for a table in postgres ) But how I query the GRANTS grated to a sequence? I've looked through the source code, and I can't find any place that exposes the ACL for sequences through the information_schema tables. (I could have missed something, though.) PostgreSQL does expose the ACL for sequences in the system catalog pg_class. SELECT relname, relacl FROM pg_class WHERE relkind = 'S' AND relacl is

mysql-权限

烈酒焚心 提交于 2019-12-04 23:45:14
1. 用root用户登录mysql mysql -uroot -p123456 2. 添加用户 % 表示自动选择可用IP 增加登录用户(可允许登录的ip地址,只能登录,什么都不能做) create user ‘username’@‘host’ identified by ‘password’; 3. 授权 grant 权限列表 on 库.表 to "用户名"@"%" identified by "密码" with grant option; 4. 刷新权限 flush privileges; 权限列表** ``` all privileges 、select 、insert ... ... 库.表 : *.* 代表所有库的所有表 ``` **示例** ```mysql 1、添加授权用户work,密码123,对所有库的所有表有所有权限 mysql>grant all privileges on *.* to 'work'@'%' identified by '123' with grant option; mysql>flush privileges; 2、添加用户duty,密码123,对db2库中所有表有所有权限 mysql>grant all privileges on db2.* to 'duty'@'%' identified by '123' with grant

Oracle中的用户、角色、授权、收权操作

为君一笑 提交于 2019-12-04 23:02:50
1. 用户 1.1 Oracle内置的用户 用户名 说明 scott 普通用户 system 普通管理员 sys 超级管理员 1.2 用户操作命令 查看当前用户 show user; 创建用户,一般是具有dba(数据库管理员) 的权限才能使用 create user 用户名 identified by 密码 -- 密码以字母开头 修改用户密码 -- 修改当前连接用户的密码 password 用户名 -- 给其他用户修改密码,需要具有dba(数据库管理员) 的权限才能使用 alter user 用户名 identified by 新密码 删除用户,一般以dba的身份去删除某个用户,如果用其它用户去删除用户则需要具有 drop user 的权限。 drop user 用户名 [cascade] --如果删除的用户创建了表,则需要加cascade 2. 角色 2.1 Oracle内置的角色 角色名 说明 connect 可连接数据库,不能创建表、视图等 resource 可连接数据库,可以创建表、视图等 dba 拥有操纵系统最大权限的角色 2.2 角色操作命令 创建角色 create role 角色名 删除角色 drop role 角色名 3. 授权/收权 3.1 说明 系统权限: 允许用户执行特定的数据库动作,如创建表、创建索引、连接实例等(对用户而言) 对象权限:

报错:1130-host ... is not allowed to connect to t...

僤鯓⒐⒋嵵緔 提交于 2019-12-04 21:45:15
报错:1130-host ... is not allowed to connect to this MySql server 解决方法: 1。 改表法。 可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%" mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user; 2. 授权法。 例如,你想myuser使用mypassword从任何主机连接到mysql 服务器 的话。 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES; 如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql 服务器 ,并使用mypassword作为密码 GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3'