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>
相关推荐
爱思德学术3 分钟前
DBLP数据库是什么?
数据库
onlooker66666 分钟前
Go 语言底层(四) : 深入 Context 上下文
开发语言·数据库·golang
岁忧8 分钟前
MySQL中【正则表达式】用法
数据库·mysql·正则表达式
浠寒AI1 小时前
PostgreSQL 与 SQL 基础:为 Fast API 打下数据基础
数据库·sql·postgresql
金州饿霸1 小时前
MySQL--慢查询日志、日志分析工具mysqldumpslow
数据库·mysql
zhujilisa1 小时前
MySql中的锁
数据库·mysql
百度Geek说2 小时前
BaikalDB 架构演进实录:打造融合向量化与 MPP 的 HTAP 查询引擎
数据库·分布式·架构
Xy9102 小时前
App Trace技术解析:传参安装、一键拉起与快速安装
数据库·程序员
朝九晚五ฺ2 小时前
【MySQL基础】MySQL表操作全面指南:从创建到管理的深度解析
数据库·sql
AIGC_北苏3 小时前
Ubuntu 安装 Mysql 数据库
数据库·mysql·ubuntu