遇到了 SQLException: access denied for @'localhost' (using password: no)

解决办法 grant all privileges on *.* to joe@localhost identified by '1';
flush privileges;

拿 joe 1 登陆

附:

mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;

权限1,权限2,…权限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限。
当权限1,权限2,…权限n被all privileges或者all代替,表示赋予用户全部权限。
当数据库名称.表名称被*.*代替,表示赋予用户操作服务器上所有数据库所有表的权限。
用户地址可以是localhost,也可以是ip地址、机器名字、域名。也可以用’%'表示从任何地址连接。
‘连接口令’不能为空,否则创建失败。

mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。

mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。

mysql>grant all privileges on *.* to joe@10.163.225.87 identified by ‘123′;
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。

mysql>grant all privileges on *.* to joe@localhost identified by ‘123′;
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。

最新文章

  1. 死去活来,而不变质:Domain Model(领域模型) 和 EntityFramework 如何正确进行对象关系映射?
  2. VMware Workstation and Hyper-V are not compatible. 解决方案
  3. React的双向绑定
  4. [leetcode]Path Sum II
  5. TCP和UDP的聊天
  6. [转]Oracle分页之三:利用PagerView来实现无刷新GridView
  7. git workflow常用命令
  8. easy ui tree 取复选框打勾的值
  9. fafu 1100 线段树
  10. JQuery Datatable Ajax请求两次问题的解决
  11. AngularJS html5Mode与ASP.NET MVC路由
  12. mysql5.7安装教程
  13. vue项目架构
  14. 共享MFC自绘Listctrl代码
  15. J2EE进阶(九)org.hibernate.LazyInitializationException: could not initialize proxy - no Session
  16. css引用与html语义化
  17. LayaAir疑难杂症之三:1.7版本click()、execCommand('copy')函数不生效
  18. 公开课 之 tony 电子时钟 (课堂笔记)
  19. DACLs and ACEs
  20. curl发送xml , xml和数组互转

热门文章

  1. Spring4分别整合mongo2.X和3.0
  2. 使用HTML5中的Canves标签制作时钟特效
  3. U盘装系统系列三—-ghost系统安装教程
  4. Android再学习-便签开发小结-20141119
  5. pyqt5按钮计数
  6. JDBC开发模式
  7. cf C. Valera and Elections
  8. fuck WPFG.org
  9. VS2010安装与测试编译问题(fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt)
  10. Linux tr 命令使用