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>
相关推荐
重整旗鼓~8 分钟前
27.Redisson基本使用和可重入性
数据库·redis·缓存
瑶总迷弟13 分钟前
使用 Docker 和 docker-compose 快速部署 openGauss
linux·数据库·云原生·eureka
C.R.xing29 分钟前
Pyspark分布式访问NebulaGraph图数据库
数据库·分布式·python·pyspark·nebulagraph
九皇叔叔32 分钟前
深度解析 PostgreSQL 中的 ctid、xmin、xmax:从原理到实战
数据库·postgresql
殷丿grd_志鹏44 分钟前
开源项目RuoYi-Cloud-Plus详解——公网内网穿透到虚拟机环境(持续更新)
数据库·开源·内网穿透·虚拟机
知其然亦知其所以然1 小时前
面试官问:MySQL表损坏怎么修?不会这三招你就凉了!
后端·mysql·面试
木易 士心1 小时前
AI 在数据库操作中的各类应用场景、方案与实践指南
数据库·人工智能·oracle
SunsPlanter1 小时前
苍穹外卖--04--Redis 缓存菜品信息、购物车
数据库·redis·缓存
解决问题no解决代码问题2 小时前
oracle删除表与表空间清理机制
数据库·oracle
洲覆3 小时前
Redis 事务机制:Pipeline、ACID、Lua脚本
数据库·redis·缓存·lua