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>
相关推荐
kyrie_sakura15 小时前
MySQL学习笔记4 -- select的7大子句,子查询
笔记·学习·mysql
灵境(虚幻知音)15 小时前
效能评估指标体系构建:方法、流程与模板
android·数据库
沈管家AI数字员工15 小时前
对话式数据分析实操:从自然语言到可视化图表的全流程
数据库·人工智能·ai·oracle·数据分析
may_一一15 小时前
MongoDB数据查看(Studio 3T)
数据库·mongodb
一个天蝎座 白勺 程序猿16 小时前
SQL Server数据库迁移实测:金仓KES V9R4C019让存量T-SQL“少量修改”
数据库·sql·kingbasees
嘻哈baby16 小时前
FastAPI + SQLite 从 0 写一个真正能用的待办 API
数据库·sqlite·fastapi
judezh16 小时前
「可重放」不是形容词:我把自家 Agent 运行时的 run 账本翻了个底朝天
数据库·人工智能
snow@li16 小时前
服务器运维:mysql 安装笔记
运维·服务器·mysql
Rain的Java大神之路16 小时前
高并发场景下MySQL数据库性能优化实战
java·后端·mysql