当前位置:网站首页>Mysql 远程连接权限错误1045问题
Mysql 远程连接权限错误1045问题
2022-07-25 12:27:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
#今天新安装mysql以后,由于没有勾选Enable root access from remote machines 而再连接数据库时出现了以下问题
走了许多绕路,在这里做下笔记。 网上查阅资料很多说是密码问题,我一开始也是照着网上的方法去服务器上修改密码,然后本地连接,结果还是出 错,才发现是混淆了一些东西。 数据库的root账户分两种,一种是本地,一种是远程: 我需要修改的是远程root密码,权限也是远程账户root: 1.首先再服务器的mysql打开cmd输入: mysql -u root -p 接下来会提示输入密码 2.进入成功以后找到表user: use mysql 提示database changed表示成功 3.修改表里的参数,也就是权限修改 mysql> GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘’ WITH GRANT OPTION; (这个==%==号就是代表任意IP都可以进行数据库的访问) 4.在进入这句话完了以后需要再加上一句: flush privileges; (告诉mysql进行权限刷新) 5.退出mysql的连接 \q
好了,到了这一步,权限就已经修改,再次远程连接mysql,就可以了 对于远程密码和localhost的密码不一致导致一方连接不上的问题下次再补充。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127189.html原文链接:https://javaforall.cn
边栏推荐
- Azure Devops (XIV) use azure's private nuget warehouse
- 2022.07.24 (lc_6125_equal row and column pairs)
- SSTI template injection vulnerability summary [bjdctf2020]cookie is so stable
- 阿里云技术专家秦隆:可靠性保障必备——云上如何进行混沌工程?
- Does MySQL have flush privileges
- 3.2.1 what is machine learning?
- 论文解读(MaskGAE)《MaskGAE: Masked Graph Modeling Meets Graph Autoencoders》
- 1.1.1 welcome to machine learning
- Selenium uses -- XPath and analog input and analog click collaboration
- I want to ask whether DMS has the function of regularly backing up a database?
猜你喜欢

MySQL exercise 2

使用TensorBoard可视化训练过程

【AI4Code】《GraphCodeBERT: Pre-Training Code Representations With DataFlow》 ICLR 2021

感动中国人物刘盛兰

Want to go whoring in vain, right? Enough for you this time!

Clickhouse notes 03-- grafana accesses Clickhouse

"Wei Lai Cup" 2022 Niuke summer multi school training camp 2 supplementary problem solution (g, J, K, l)

A hard journey

【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例

业务可视化-让你的流程图'Run'起来(3.分支选择&跨语言分布式运行节点)
随机推荐
Force deduction 83 biweekly T4 6131. The shortest dice sequence impossible to get, 303 weeks T4 6127. The number of high-quality pairs
If you want to do a good job in software testing, you can first understand ast, SCA and penetration testing
JS convert pseudo array to array
WPF project introduction 1 - Design and development of simple login page
Pytorch visualization
[fluent -- example] case 1: comprehensive example of basic components and layout components
深度学习MEMC插帧论文列表paper list
Pytorch main module
Numpy first acquaintance
【6】 Map box settings
感动中国人物刘盛兰
2022.07.24 (lc_6126_design food scoring system)
【五】页面和打印设置
零基础学习CANoe Panel(13)—— 滑条(TrackBar )
【问题解决】org.apache.ibatis.exceptions.PersistenceException: Error building SqlSession.1 字节的 UTF-8 序列的字
Kyligence 入选 Gartner 2022 数据管理技术成熟度曲线报告
【C语言进阶】动态内存管理
2022.07.24(LC_6126_设计食物评分系统)
Microsoft azure and Analysys jointly released the report "Enterprise Cloud native platform driven digital transformation"
SSTI template injection vulnerability summary [bjdctf2020]cookie is so stable