MariaDB忘记root密码
在MariaDB配置文件/etc/my.cnf [mysqld]中加入skip-grant-tables一行:
[Richard@localhost ~]$ sudo vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables #加入这一行
# Disabling symbolic-links is reco
重启服务:
[Richard@localhost ~]$ sudo systemctl restart mariadb.service
进入MariaDB修改root密码:
[Richard@localhost ~]$ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB-wsrep MariaDB Server, wsrep_25..r4026 Copyright (c) , , Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
MariaDB [mysql]> show tables
-> ;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
rows in set (0.00 sec) MariaDB [mysql]> UPDATE user SET Password = password ( ' ) WHERE User = 'root' ;
Query OK, rows affected (0.03 sec)
Rows matched: Changed: Warnings: MariaDB [mysql]> flush privileges;
Query OK, rows affected (0.01 sec) MariaDB [mysql]> exit
重启服务即可登陆:
[Richard@localhost ~]$ sudo systemctl restart mariadb.service
[Richard@localhost ~]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB-wsrep MariaDB Server, wsrep_25..r4026 Copyright (c) , , Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> exit
MariaDB忘记root密码的更多相关文章
- MySQL或MariaDB忘记root密码
当我们忘记数据库密码时,我们可以通过如下来修改! 编辑配置文件(提前最好进行备份) 然后重启服务 systemctl restart mariadb 或者 systemctl restart mysq ...
- Linux下MySQL或MariaDB忘记root密码的解决方法
1.vim /etc/my.cnf 2.在[mysqld]下添加一行skip-grant-tables,然后保存并退出. 3.重启mysql服务:service mysqld restart. 4.不 ...
- Centos7 之 MariaDB(Mysql) root密码忘记的解决办法
MariaDB(Mysql) root密码忘记的解决办法 1.首先先关闭mariadb数据库的服务 # 关闭mariadb服务命令(mysql的话命令就是将mariadb换成mysql) [root@ ...
- CentOS忘记mariadb/mysql root密码解决办法
本文不再更新,可能存在内容过时的情况,实时更新请访问原地址:CentOS忘记mariadb/mysql root密码解决办法: 这里有两种方式实现修改mariadb root密码. mariadb版本 ...
- Centos7 禁止firewalld并使用iptables 作默认防火墙以及忘记root密码的处理方法
一.停止并禁用firewalld [root@test ~]# systemctl stop firewalld [root@test ~]# systemctl disable firewalld ...
- MySQL 忘记root密码怎么办
前言:记住如果忘记root密码,在启动MySQL的时候,跳过查询授权表就ok了. 对于RedHat 6 而言 (1)启动mysqld 进程时,为其使用:--skip-grant-tables --sk ...
- Mac上MySQL忘记root密码且没有权限的处理办法&workbench的一些tips (转)
忘记Root密码肿么办 Mac上安装MySQL就不多说了,去mysql的官网上下载最新的mysql包以及workbench,先安装哪个影响都不大.如果你是第一次安装,在mysql安装完成之后,会弹出来 ...
- Linux忘记root密码怎么办?
开篇前言:Linux系统的root账号是非常重要的一个账号,也是权限最大的一个账号,但是有时候忘了root密码怎么办?总不能重装系统吧,这个是下下策,其实Linux系统中,如果忘记了root账号密码, ...
- mysql忘记root密码解决办法
最近项目中的数据库我放在了服务器上,但是今天突然不能用了,进入服务器查看,果然是数据库不能进去了,所以今天来分享一个mysql忘记root密码的解决方案: 1.让mysql不载入权限表,命令:mysq ...
随机推荐
- linux(边压缩边传输边解压)
比如我要转移旧VPS /home/wwwroot 下的web目录到新VPS(123.123.123.123)的/home/wwwroot 目录下 1.进入目录 cd /home/wwwroot ...
- [置顶] 获取系统时间的方法--linux
一. localtime 函数获取(年/月/日/时/分/秒)数值. 1.感性认识 #include<time.h> //C语言的头文件 #include<stdio.h> ...
- OC基础9:预处理程序
"OC基础"这个分类的文章是我在自学Stephen G.Kochan的<Objective-C程序设计第6版>过程中的笔记. 1. 关于#define语句: (1). ...
- jquery获取父窗口的元素[转]
$("#父窗口元素ID",window.parent.document); 对应javascript版本为window.parent.document.getElementById ...
- 对于deferred的一点点理解
deferred对象,是一个异步队列.能够实现异步代码调用,从而解决代码执行顺序的问题. 它提供了一下主要方法: jQuery.Deferred() 一个构造函数,返回一个链式实用对象方法来注册多个回 ...
- UVA 1623 Enter The Dragon
题意: 一只龙,在每个不下雨的日子都可以喝干一个湖里的水,当湖满时,再向这个湖里下雨就会溢出.给出下雨的顺序,求龙喝水的序列. 分析: 记录每个湖上次满水的日子,和不下雨的日子.下雨时,查找当前湖上次 ...
- 第五章SignalR的实时高频通讯
第五章SignalR的实时高频通讯 概述:本例子演示了如果创建一个对象与其他浏览器共享实时状态的应用程序.我们要创建的应用程序为“MoveShape”,该MoveShape页面会显示一个Html Di ...
- jQuery基础---Ajax基础教程
jQuery基础---Ajax基础 内容提纲: 1.Ajax 概述 2.load()方法 3.$.get()和$.post() 4.$.getScript()和$.getJSON() 5.$.ajax ...
- uinavagation 透明代码
NSShadow *shadow = [[NSShadow alloc] init]; [shadow setShadowOffset:CGSizeMake(1, 1)]; [shadow setSh ...
- 解决UITableView数据没有充满屏幕时,显示多余的空白cell的问题
#pragma mark 去除多余的线 -(void) clearExtrLine{ UIView *view = [[UIView alloc] init]; view.backgroundColo ...