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>
相关推荐
软件派7 小时前
生产动态数据智能风控:阈值判别、趋势预测、异常识别算法工程落地实战
前端·数据库·算法
ss27314 小时前
PostgreSQL常见索引问题与解决方案
数据库·postgresql
小徐不徐说14 小时前
序列化与反序列化:把 C++ 对象可靠地保存下来
开发语言·数据库·c++·php
瀚高PG实验室16 小时前
发布端逻辑复制槽消失
数据库·postgresql·瀚高数据库
ss27316 小时前
PostgreSQL慢查询定位与优化
数据库·postgresql
香蕉大香蕉(06敬畏市场)17 小时前
MySQL 单点详解(07)
java·数据库·mysql·ai·博客·八股
smilejingwei18 小时前
TRAE 插件上新 | SQLazy:让 AI 写出可信复杂 SQL
数据库·人工智能·sql
我要见SA姐118 小时前
GitHub Actions 自动化:5 个真实运维提效案例
运维·数据库·机器学习·oracle·回归
IT规划师19 小时前
百亿数据写入 MySQL:空间降维 × IO 降维 × 工程兜底
mysql·sqlsugar·.net10