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>
相关推荐
小锅巴1239 分钟前
百度测开面经(分类版)
数据库·分类·数据挖掘
芒果要切18 分钟前
Redis 使用场景
数据库·redis·缓存
全栈工程师修炼指南38 分钟前
DBA | Oracle RMAN 实战:物理备份与数据恢复全解析
数据库·oracle·dba
现在,此刻44 分钟前
clickhouse和pgSql跨库查询方案对比
数据库·sql·clickhouse·性能优化
while(1){yan}1 小时前
数据库的基本操作
数据库·oracle
翻斗花园牛图图-1 小时前
MySQL——库的操作
数据库·mysql
大猫会长1 小时前
supabase备份数据库中某个schema的方法
数据库·oracle
-指短琴长-1 小时前
MySQL快速入门——内置函数
android·数据库·mysql
蒲公英源码3 小时前
uniapp开源ERP多仓库管理系统
mysql·elementui·uni-app·php
小码过河.3 小时前
告别 mysqldump 痛点!用 mydumper 实现 MySQL 高效备份与恢复
数据库·mysql