MySQL8.0修改mysql允许远程连接

news/2024/7/24 10:38:39 标签: mysql, android, 数据库
1、连接服务器: mysql -u root -p

2、看当前所有数据库:show databases;

3、进入mysql数据库:use mysql;

4、查看mysql数据库中所有的表:show tables;

5、查看user表中的数据:select Host, User,Password from user;

6、修改user表中的Host:update user set Host=‘%’ where User=‘root’;
或者INSERT INTO mysql.user (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, Create_tablespace_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections, plugin, authentication_string, password_expired, password_last_changed, password_lifetime, account_locked, Create_role_priv, Drop_role_priv, Password_reuse_history, Password_reuse_time, Password_require_current, User_attributes) VALUES (‘%’, ‘root’, ‘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’, ‘Y’, ‘’, ‘’, ‘’, ‘’, ‘0’, ‘0’, ‘0’, ‘0’, ‘mysql_native_password’, ‘*81F5E21E35407D884A6CD4A731AEAF209E1B’, ‘N’, ‘2023-01-10 17:59:05’, NULL, ‘N’, ‘Y’, ‘Y’, NULL, NULL, NULL, NULL);

7、最后刷新一下:flush privileges;


http://www.niftyadmin.cn/n/5083696.html

相关文章

需永远在线的游戏公司,如何在线替换开源存储?

小帅是一个酷爱游戏的玩家,他玩一款游戏已经很久了,始终乐在其中。 这款游戏风靡全球,在中国手游出海榜单中,长期位居榜首。 他不知道的是,就在他玩游戏的过程中,这款游戏的出品公司,其实已经…

如何得到numpy当前的随机数种子

使用numpy内置的random.get_state()即可。 测试代码 使用np.random.get_state()[1][0]即可。 实例 import numpy as npMyNames = [CSDN, Kuang, Xiao, Hu] IDs = [1, 2,

“Linux免除系统交互操作方法” 及 “SSH批量修改主机密码脚本”

一、Linux系统免除交互操作方法 1、EOF多文本输入 案例&#xff1a;为机器磁盘进行分区并实现挂载&#xff0c;免交互式操作&#xff0c;如何实现&#xff1f; #!/bin/bash fdisk /dev/sdb <<EOF n p 1 wq EOFmkfs.xfs /dev/sdb1 && mkdir -p /data &&am…

计算机毕业设计选什么题目好?springboot 航司互售系统

✍✍计算机编程指导师 ⭐⭐个人介绍&#xff1a;自己非常喜欢研究技术问题&#xff01;专业做Java、Python、微信小程序、安卓、大数据、爬虫、Golang、大屏等实战项目。 ⛽⛽实战项目&#xff1a;有源码或者技术上的问题欢迎在评论区一起讨论交流&#xff01; ⚡⚡ Java实战 |…

Vue-2.7自定义指令

自定义指令 自己定义的指令&#xff0c;可以封装一些dom操作&#xff0c;扩展额外功能 例如需求&#xff1a;当页面加载时&#xff0c;让元素将获得焦点&#xff08;autofucus在safari浏览器有兼容性&#xff09; 操作dom&#xff1a;dom元素.focus() 太麻烦&#xff01;…

GCC vs. G++:C 与 C++ 编译器的差异和比较

本文将介绍 GCC&#xff08;GNU Compiler Collection&#xff09;和 G 编译器的区别&#xff0c;并对它们在 C 和 C 程序开发中的特性和用法进行比较和总结。 引言 在 C 和 C 程序开发中&#xff0c;选择合适的编译器是至关重要的。GCC&#xff08;GNU Compiler Collection&a…

接口测试框架实战 | 接口请求断言

接口请求断言是指在发起请求之后&#xff0c;对返回的响应内容去做判断&#xff0c;用来查看是否响应内容是否与规定的返回值相符。 在发起请求后&#xff0c;我们使用一个变量 r 存储响应的内容&#xff0c;也就是 Response 对象。 Response 对象有很多功能强大的方法可以调…

pytorch定义datase多次重复采样

有的时候训练需要对样本重复抽样为一个batch&#xff0c;可以按如下格式定义: class TrainLoader(Dataset):def __init__(self, fns, repeat1):super(TrainLoader, self).__init__()self.length len(fns) # 数据数量self.repeat repeat # 数据重复次数def __getitem__(self,…