Reset MySQL / MariaDB password on OSX(在 OSX 上重置 MySQL/MariaDB 密码)
问题描述
在遵循 本指南.它一直工作正常,但是今天 root 密码已过期,我似乎无法使用任何 -skip-grant-tables --skip-networking 类型选项重置它.
I have installed MariaDB via Homebrew after following this guide. It has been working fine, however today the root password has expired and I cannot seem to reset it with any of the —skip-grant-tables —skip-networking type options.
到目前为止我已经尝试过:
So far I have tried:
brew services stop mariadb
mysqld_safe --skip-grant-tables --skip-networking
mysql_secure_installation
也试过
mysql_secure_installation --connect-expired-password
这给了我:
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
/usr/local/Cellar/mariadb/10.3.13_1/bin/mysql: unknown option '--connect-expired-password'
Password update failed!
Cleaning up...
我还添加了:
[mysqld]
default_password_lifetime=0
skip-grant-tables
到/usr/local/etc/my.cnf
仍然不允许我使用上述命令更新 root 密码.Brew Doctor 干净利落地回来了,我已经没有东西可以尝试了.
Still doesn't let me update the root password with the above commands. Brew doctor comes back clean and I'm running out of things to try.
推荐答案
登录
mysql -uroot
那就做吧
set password = password("your_password");
这篇关于在 OSX 上重置 MySQL/MariaDB 密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 OSX 上重置 MySQL/MariaDB 密码
基础教程推荐
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 无法解决整理冲突 2021-01-01
