当前位置: 首页 > news >正文

MySQL 8.0的数据库root用户默认无法远程登录,需要修改root的远程授权

mysql> grant all privileges on . to ‘root’@‘%’;

ERROR 1410 (42000): You are not allowed to create a user with GRANT

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set host=‘%’ where user=‘root’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> grant all privileges on . to ‘root’@‘%’;
Query OK, 0 rows affected (0.02 sec)

mysql> select user,host from user;
±-----------------±----------+
| user | host |
±-----------------±----------+
| root | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
±-----------------±----------+
8 rows in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye

相关文章:

  • 换颜色 算法笔记
  • uni-app隐藏返回按钮
  • 【自建grafana接入阿里云sls】
  • JAVA_学习(IDEA
  • 阿里云实践创建实例步骤
  • 云安全【阿里云ECS攻防】
  • leetcode0721. 账户合并-medium
  • Pyenv——使用
  • Java学习笔记之:初识nginx
  • oracle表数据误删除恢复(闪回操作)
  • react中hook和高阶组件的选型
  • flutter把 pubspec.yaml 中的name改成了新的值
  • Elasticsearch的数据同步
  • 使用 React+Vite+Electron 搭建桌面应用
  • Mac中安装Anaconda、Anaconda基础命令、Pycharm结合Anaconda,看这一篇就够啦!
  • oracle 表空间超过最大限度,清理数据释放内存
  • Pycharm常用命令
  • js实现输入高亮@和#后面的内容
  • 第六章网络互联设备
  • 「Java EE开发指南」如何用MyEclipse创建一个WEB项目?(一)
  • 想接外包做网站/微信推广软件
  • 上海跨境电商网站制作/地推公司
  • 网站建设网站设计哪家专业/cpu游戏优化加速软件
  • 小程序app开发制作/杭州小周seo
  • 石柱网站建设/seo技术教程网
  • 网站可以个人备案吗/深圳华强北新闻最新消息今天