mysql设置初始密码

dos 复制代码
E:\zhurong_soft\MySQL\MySQL Server 8.1\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 8.1.0 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

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>
mysql> update user set authentication_string='' where user='root';
ERROR 1046 (3D000): No database selected
mysql> update user set authentication_string='' where user='root';
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Database changed
mysql> update user set authentication_string='' where user='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.01 sec)

mysql>
相关推荐
计科土狗1 小时前
GESP六级专题之类与对象
java·前端·数据库
麦聪聊数据1 小时前
数据治理 ROI(下):算清投入产出比,小切口落地快速验证价值
数据库
dyxal1 小时前
SSH本地端口转发完全解析:像“挖掘隧道”一样安全访问远程数据库
数据库·安全·ssh
OceanBase数据库官方博客2 小时前
让 DRP全域数据智能流转OceanBase AI 数据库支撑央国企落地穿透式监
数据库·人工智能·oceanbase
笃行3502 小时前
零代码完成MongoDB迁移,KingbaseES是怎么做到的
数据库
Leighteen2 小时前
时区的坑:为什么存进数据库的时间,差了 8 小时
数据库
陈天伟教授2 小时前
TraeWork初体验-生成研究报告
大数据·数据库·人工智能
大黄说说2 小时前
SQL Server 执行计划怎么看?快速定位 SQL 慢的根源
java·linux·数据库
专注API从业者2 小时前
告别人工盯品!Open Claw 搭建京东商品全自动监控与数据分析系统(附完整可运行代码)
大数据·数据库·数据分析
00后程序员张4 小时前
抓包鹰 电脑本机网络连接表怎么看?哪些程序在联网 进程归属与可疑 IP 追溯
网络协议·计算机网络·网络安全·ios·adb·https·udp