GRANT ALL PRIVILEGES

1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"

1. mysql -u root -pvmwaremysql>use mysql;
2. mysql>update user set host = '%' where user =
'root';
3. mysql>select host, user from user;

2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

Sql代码 复制代码

1. GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY
'mypassword' WITH

GRANT OPTION;
2.FLUSH PRIVILEGES;

如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码

Sql代码 复制代码

1. GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED
BY
2. 'mypassword' WITH GRANT OPTION;
3. FLUSH PRIVILEGES;

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED
BY
'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;

另外一种方法.

在安装mysql的机器上运行:
1、d:\mysql\bin\>mysql -h localhost -u root
//这样应该可以进入MySQL服务器
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'
WITH GRANT OPTION
//赋予任何主机访问数据的权限
3、mysql>FLUSH PRIVILEGES
//修改生效
4、mysql>EXIT
//退出MySQL服务器
这样就可以在其它任何的主机上以root身份登录啦!

mysql GRANT ALL PRIVILEGES 限制某个或所有客户端都可以连接至mysql的更多相关文章

  1. GRANT ALL PRIVILEGES 限制某个或所有客户端都可以连接至mysql

    GRANT ALL PRIVILEGES 1. 改表法.可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mys ...

  2. mysql grant all privileges on

    遇到了 SQLException: access denied for @'localhost' (using password: no) 解决办法 grant all privileges on * ...

  3. mysql 1449 : The user specified as a definer ('root'@'%') does not exist ,mysql 赋给用户权限 grant all privileges on

    mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法 遇到了 SQLException: acce ...

  4. Mysql授权GRANT ALL PRIVILEGES

    1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 " ...

  5. 解决本地软件链接不上虚拟机mysql 的问题:grant all privileges on *.* to 'root'@'%' identified by 'nsfocus'

    mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' ->     IDENTIFIED BY 'some_pass' WITH ...

  6. mysql 赋给用户权限 grant all privileges on

    遇到了 SQLException: access denied for  @'localhost' (using password: no) 解决办法   grant all privileges o ...

  7. mysql访问权限GRANT ALL PRIVILEGES ON,访问权限表

    开启远程连接:2, 修改 Mysql-Server 用户配置mysql> USE mysql; -- 切换到 mysql DBDatabase changedmysql> SELECT U ...

  8. mysql赋给用户权限grant all privileges on

    查看mysql用户表的结构,Field项都是各类权限限制 Host限制登录的IP,User限制登录的用户,Delete_priv限制删除权限,Grant_priv限制权限授予,Super_priv为超 ...

  9. mysql中all privileges包含哪些权限

    mysql> grant all privileges on test.* to 'ybb'@'%' identified by 'ybb'; Query OK, 0 rows affected ...

随机推荐

  1. GetStockObject 理解

    原文地址:https://www.cnblogs.com/Clingingboy/archive/2013/04/13/3017952.html GetStockObject在图形编程中是常用API之 ...

  2. zabbix客户端日志报错no active checks on server [192.168.3.108:10051]: host [192.168.3.108] not found

    zabbix客户端日志报错: 45647:20160808:220507.717 no active checks on server [192.168.3.108:10051]: host [192 ...

  3. 服务器上安装FileZilla Server连接时报You appear to be behind a NAT router. Please configure the passive mode settings and forward a range of ports in your router.

    官方资源下载链接:客户端,或者直接点击下载“FileZilla_3.24.0_win64-setup.exe”:服务端,或者直接点击下载“FileZilla_Server-0_9_60_2.exe”: ...

  4. 测试开发之前端——No4.HTML5中的事件属性

    HTML5的事件属性. 属性 值 描述 onafterprint script 在打印文档之后运行脚本 onbeforeprint script 在文档打印之前运行脚本 onbeforeonload ...

  5. 怎样使用github

    https://www.zhihu.com/question/20070065 https://www.shiyanlou.com/courses/868/labs/3163/document 初次尝 ...

  6. ssh-keygen -t rsa -b 4096 -C "邮箱"

    ssh-keygen -t rsa -b 4096 -C "邮箱":这条命令的目的是为了让本地机器ssh登录远程机器上的GitHub账户无需输入密码.将这条命令分解: 1.ssh- ...

  7. 前端工程化-webpack篇之babel-polyfill与babel-runtime(三)

    关于 Babel 如果我们没有配置一些规则,Babel 默认只转换新的 JavaScript 句法(syntax),而不转换新的 API,比如 Iterator.Generator.Set.Maps. ...

  8. hdu5672 尺取

    因为没有初始化ans搞了一晚上 还是尺取,枚举所有l 然后寻找对应满足条件的r,这个串可以被后面所有的串包含,所以每个l 的贡献就是len-r+1 #include<bits/stdc++.h& ...

  9. python接口自动化测试十五:解决密码动态,无法登录情况

    解决问题:每次密码都是变化的,无法通过账号密码登录 (总不能每次去fiddler复制吧????) 解决思路: 1.先用selenium调用浏览器(不会selenium的自己想办法了), 2.登录后从浏 ...

  10. IntelliJ IDEA设置不自动打开最后关闭的项目