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>
相关推荐
Mr_Xuhhh1 小时前
MySQL核心知识梳理:从连接到查询的完整指南
数据库·sql·mysql
wsxlgg1 小时前
MySQL中count(*)、count(1)、count(字段)的区别
数据库·mysql
_F_y7 小时前
MySQL用C/C++连接
c语言·c++·mysql
pengdott7 小时前
Oracle RAC内存融合技术深度解析:集群性能的幕后引擎
数据库·oracle
csudata8 小时前
绿色便携版PostgreSQL发行版重磅发布
数据库·postgresql
阳光九叶草LXGZXJ8 小时前
达梦数据库-学习-48-DmDrs控制台命令(同步之Manager、CPT模块)
linux·运维·数据库·sql·学习
五岳9 小时前
DTS按业务场景批量迁移阿里云MySQL库实战(上):技术选型和API对接
mysql·阿里云·dts
我科绝伦(Huanhuan Zhou)9 小时前
脚本再升级,兼容Oracle 26ai一键安装
数据库·oracle
野生绿箭侠9 小时前
Ncos 2.3.2 版本集成达梦数据库
数据库
仍然.10 小时前
MYSQL--约束
数据库·mysql