博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu 超级管理员修改Mysql数据库密码
阅读量:7051 次
发布时间:2019-06-28

本文共 871 字,大约阅读时间需要 2 分钟。

  hot3.png

debian-sys-maint是个安装之后自带的用户,具体作用是重启及运行mysql服务。

忘了root密码就该他大显身手了。

root@ms:/etc# cd mysql/
root@ms:/etc/mysql# vi debian.cnf

user     = debian-sys-maint

password = *******************************

把密码粘贴出来  用这个用户密码登录mysql

root@ms:/etc/mysql# mysql -u debian-sys-maint -pEnter password:**********

登录进来:

 

mysql> use mysqlmysql> update user set password=password('新密码') where user='root';

报错了!

ERROR 1054 (42S22): Unknown column 'password' in 'field list'

别慌,很简单。

 

mysql> update user set authentication_string=password('新密码') where user='root';Query OK, 0 rows affected, 1 warning (0.03 sec)Rows matched: 1  Changed: 0  Warnings: 1mysql> exit;
root@ms:/etc/mysql# mysql -u root -pEnter password:刚才设置的密码

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4
Server version: 5.7.19-0ubuntu0.16.04.1 (Ubuntu)

 

转载于:https://my.oschina.net/marhal/blog/1499723

你可能感兴趣的文章
HDU - 6115 Factory (LCA 倍增)
查看>>
unity客户端与c++服务器之间的简单通讯_1
查看>>
Python_反射
查看>>
Codeforces-963 D Frequency of String
查看>>
MyBatis-mybatis全局映射文件解析
查看>>
WebApi 跨域解决方案 --CORS
查看>>
MySQL系列详解五: xtrabackup实现完全备份及增量备份详解-技术流ken
查看>>
单独编译Android源代码中的模块
查看>>
manjaro安装mysql5.7
查看>>
记录零散的知识点
查看>>
H5上传图片并使用canvas制作海报
查看>>
springmvc学习笔记
查看>>
LRU算法的设计
查看>>
清除windows系统垃圾文件简易脚本(bat)
查看>>
Java 之switch语句
查看>>
焊盘的制作
查看>>
Finalize 和 Dispose 的分析
查看>>
从一道题看线程安全--牛客网Java基础题
查看>>
简单验证码业务
查看>>
Java util包中常用的类和方法
查看>>