新装的MySQL没有密码怎么办
新装的mysql没有密码怎么办
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [root@localhost log] # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 8.0 . 15 MySQL Community Server - GPL Copyright (c) 2000 , 2019 , Oracle and / or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and / or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help . Type '\c' to clear the current input statement. mysql> set password = '123456' ; Query OK, 0 rows affected ( 0.00 sec) / / 或者 mysql> ALTER user 'root' @ 'localhost' IDENTIFIED BY '123456' ; |
2.新版mysql(8.0+)连接数据库出现2059
原因:MySQL的8.0.*版本使用的是caching_sha2_password验证方式,而Navicat Premium 12还不支持该种方式
解决:
1 | 在数据库命令行中输入:ALTER USER 'root' @ 'localhost' IDENTIFIED WITH mysql_native_password BY 'password' ; |
重新连接就OK
关注公众号:
当你握紧双手,里面什么也没有;当你打开双手,世界就在你手中。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架