mysql 禁制远程连接
2024-08-28 01:29:20
改表法:把host地址改为%
use mysql;
update user set host = '%' where user = 'root'and host="127.0.0.1" ;
FLUSH PRIVILEGES;
2、重新建立一个用户
1、把原user表导出一份来
mysqldump -w"User='root'" -uroot -p mysql user>/home/jksong/user.sql
2、修复其中的一条为 User='jksong' , Host='%', 然后插入user表, 不能复用下面的sql,不同版本sql可能会不同
INSERT INTO `user` VALUES ('%','jksong','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
3、执行
FLUSH PRIVILEGES;
修改密码:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
update user set password=password("520") where user="root";
最新文章
- JAVA 设计模式 模板方法模式
- django rest framework
- Oracle分页语句
- 每天一个 Linux 命令(5):rm 命令
- javascript的原型与继承(2)
- log4j使用教程详解(怎么使用log4j2)
- hdu1024 Max Sum Plus Plus
- 【字符串处理】HDOJ-1020-Encoding
- 由C到C++的学习 ----Essential C++
- SGU 171.Sarov zones
- Swift - whose view is not in the window hierarchy 问题解决方法
- The application to execute does not exist: 'C:\Users\Administrator\.dotnet\tools\.store\dotnet-aspnet-codegenerator\2.2.0-rtm-35687\dotnet-aspnet-codegenerator\2.2.0-rtm-35687\tools\netcoreapp2.1\any\
- Altium designer 新建快捷键
- elasticsearch 集成springboot
- Web服务器之Nginx详解(理论部分)
- cmd 安装mysql
- 进程表示之进程ID号
- ES6-循环
- [UE4]使用蓝图关闭对象的碰撞SetActorEnableCollision
- java Enum 类型互转
热门文章
- 【8.17校内测试】【模拟】【set】【网络流】
- bzoj 2821 分块
- bzoj 3757 树上莫队
- bzoj 1303: [CQOI2009]中位数图 数学
- Codeforces Round #300 C. Tourist's Notes 水题
- zoj 1610 Count the Colors 线段树区间更新/暴力
- Unity Pivot/Center与Local/Global总结
- wampserver3.1.0安装及配置
- change kernel defconfig
- 利用Lucene与Nutch构建简单的全文搜索引擎