MariaDB忘记root密码
来源:互联网 发布:淘宝店铺扣分24分 编辑:程序博客网 时间:2024/05/29 09:30
[root@localhost ~]# ll /etc/my.cnf
-rw-r--r--. 1 root root 570 Jun 8 22:25 /etc/my.cnf
[root@localhost ~]# chmod 744 /etc/my.cnf
[root@localhost ~]# ll /etc/my.cnf
-rwxr--r--. 1 root root 570 Jun 8 22:25 /etc/my.cnf
在MariaDB配置文件/etc/my.cnf [mysqld]中加入skip-grant-tables一行:
[root@localhost ~]# vim /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables #加入这一行
# Disabling symbolic-links is recommended to prevent assorted security risks
......
重启服务:
[root@localhost ~]# systemctl restart mariadb.service
进入MariaDB修改root密码:
[root@localhost ~]$ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> update mysql.user set password=password('12345')where user='root' and host='localhost';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 0 Warnings: 0
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit
Bye
[root@localhost ~]# systemctl restart mariadb.service
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> exit
[root@localhost ~]# vim /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#skip-grant-tables #注释掉
# Disabling symbolic-links is recommended to prevent assorted security risks
......
[root@localhost ~]# chmod 644 /etc/my.cnf
[root@localhost ~]# ll /etc/my.cnf
-rw-r--r--. 1 root root 570 Jun 8 22:30 /etc/my.cnf
[root@localhost ~]#
- MariaDB忘记root密码
- MariaDB忘记root密码
- MariaDB忘记root密码
- MariaDB忘记root密码
- mariadb root忘记密码修改
- MariaDB忘记root密码,修改root密码
- centos7下,mariadb忘记root密码怎么办?
- mysql/mariadb忘记密码
- Mariadb修改root密码
- mysql(mariadb)忘记密码
- XAMPP Mysql/MariaDB 忘记密码
- 忘记ROOT密码怎么办
- MySQL忘记root密码
- Linux 忘记root密码
- MYSQL忘记root密码
- mysql root 密码忘记????
- mysql忘记root密码
- CentOS忘记root密码
- 流瞬ElectroMagneticWorks(EMWorks).EMS.2017.SP1.4.for.SW2011-2018.Win64三维电磁场仿真软件 EMS帮助设计人员计算的电、磁、机械和
- spring maven
- PAT考试乙级1045(C语言实现)重点题目(思路)
- Android中的AsyncTask(异步任务)和接口回调使用详解
- Java面试题全集上
- MariaDB忘记root密码
- 动态爬虫[闲谈1]
- Qt--日志
- Java单例模式--产生固定数量的实例学习笔记
- ccf-2016-09-4-交通规划
- Unity游戏引擎挖坑记之3d游戏2d显示管理(血条、飘血)(一)
- 设计模式—代理模式
- fastjson 过滤掉多余的字段
- CodeForces 893C Rumor