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>
相关推荐
!chen6 分钟前
Oracle分区表+本地索引 核心优化方案
数据库·oracle
叽里咕噜怪9 分钟前
MySQL-读写分离实验
数据库·mysql
生产队队长11 分钟前
Database:PLSQL中文乱码(查询显示问号???、表注释显示问号???)
数据库
饕餮争锋19 分钟前
SQL LIKE 语句中下划线“_”是通配符
数据库·sql
霸王大陆25 分钟前
《零基础学PHP:从入门到实战》教程-模块七:MySQL 数据库基础-3
数据库·mysql·php
AL流云。33 分钟前
MySQL安装【Centos, Ubuntu, Windows】
mysql·ubuntu·centos
老华带你飞33 分钟前
茶叶商城|基于SprinBoot+vue的茶叶商城系统(源码+数据库+文档)
java·前端·javascript·数据库·vue.js·spring boot
我科绝伦(Huanhuan Zhou)34 分钟前
Oracle性能优化方法论:从基线建立到问题根治
数据库·oracle·性能优化
菜鸟小九35 分钟前
mysql运维(主从复制)
android·运维·mysql