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 分钟前
软件设计师上午题5:数据库
数据库
hong781713 分钟前
阿里coding plan qwen3.6-plus 不支持图片上下文长度只有200K,问题出在哪?
linux·运维·数据库
Paxon Zhang39 分钟前
MySQL 大师之路**数据库约束,表设计,CRUD**
android·数据库·mysql
HealthScience1 小时前
clinvar数据集说明
数据库·oracle
王的宝库1 小时前
【MySQL】主从复制原理详解:从 Binlog 到数据一致性
数据库·mysql
Vect__1 小时前
MySQL基本认知、库和表的操作
数据库·mysql
cyber_两只龙宝1 小时前
【Oracle】Oracle之DQL中SELECT的基础使用
linux·运维·服务器·数据库·云原生·oracle
老苏畅谈运维1 小时前
Oracle 在线表重定义:将非分区表转换为分区表的最佳实践
数据库·oracle
treacle田1 小时前
达梦数据库-达梦数据库中link链接访问oracle 19c/11g-记录总结
数据库·oracle·达梦 link访问oracle
萌兰三太子1 小时前
RAG 向量数据库设计指南:从入门到生产
数据库·oracle