


This article mainly tells you the actual steps to reset the root password in the MAC system MySQL. It often happens that you forget the MySQL root password in actual operations. The following is the summary of this tutorial. Detailed content introduction.
MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently a product of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is the best RDBMS (Relational Database Management System) application software.
MySQL is a relational database management system. A relational database stores data in different tables instead of placing all data in one large warehouse, which increases speed and flexibility.
The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts a dual licensing policy and is divided into community version and commercial version. Due to its small size, fast speed, low total cost of ownership, and especially the characteristics of open source, MySQL is generally chosen as the website database for the development of small and medium-sized websites.
After installing MySQL on Mac, the software will generate a default password for us. However, when I use Navicat to establish a connection, it prompts that the password is invalid. I have no choice but to change the database default password.
Next, record the entire root password modification process.
The mysql service must be stopped before starting the following steps!
cd /usr/local/mysql/bin/ sudo su ./mysqld_safe --skip-grant-tables & //这一步的作用是跨过权限验证 ./mysql -uroot //以root身份登录,因为第三步的原因不需要密码了。这之后的命令就不需要在前面加./mysql了 use mysql; update user set authentication_string='123456' where User='root';
The versions circulating on the Internet are all set password =‘’. When writing this way, an error is always reported saying that the ‘password’ column does not exist!
Finally, I used the sql command to find out that there is only the authentication_string field and no password field.
After executing the previous step, I thought I could log in, but during the navicat connection test, an error message appeared:
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.
So the following steps are needed
cd /usr/local/mysql/bin/ sudo su ./mysql -uroot -p123456 set password = password('123456')
Username: root, password :12345
Modification successful
Supplement:Although the above modification was successful, it still took many detours. The above just records the whole process. Below we will The simplest and most effective way to summarize
is that this process is sad. There is so much information on the Internet. The key is that everyone has their own wrong methods. After trying for a long time, no one is right. I am about to break the psychological defense line. When I went to read the MySQL documentation, I made the change successfully. No article gave me the complete answer. I consulted several guides and built the car behind closed doors. Give yourself a thumbs up. Without further ado, just follow me step by step.
1. Close the mysql server
sudo /usr/local/mysql/support-files/mysql.server stop
You can also close it in MySQL in the system preferences.
2.cd /usr/local/mysql/bin Enter the directory
##3.sudo su Obtain permissions
4. ./mysqld_safe --skip-grant-tables & Restart the server
alias mysql=/usr/local/mysql/bin/mysql6. Enter mysql to enter mysql7.use mysql to enter 8.
flush privileges;Probably just get the permissions, otherwise he won’t let you change it.
set password for 'root'@'localhost'=password('new password'); Complete the modification
The above is the detailed content of Detailed explanation of the solution to forgetting the MySQL root password in MACOS. For more information, please follow other related articles on the PHP Chinese website!

Docker 命令在终端窗口中输入,如 Linux 和 macOS 上的“终端”或 Windows 上的“命令提示符”。步骤包括:1. 打开终端窗口;2. 输入 Docker 命令(如 docker run);3. 按 Enter 执行命令。提示:可以使用 docker --help 获取帮助,某些命令需要 root 权限。

在 Visual Studio Code 中运行 JavaScript 代码有以下三种方法:运行选定代码块。使用调试器。使用命令行导航到脚本所在目录并运行 node filename.js。

macOS 是 Apple 专为 Mac 电脑设计的操作系统,由 Darwin、Aqua、Finder、Dock 等组件组成。它以其用户友好性、稳定性和强大的功能而著称,提供无缝集成和强大的安全功能,使其成为 Mac 用户的理想选择。

本篇文章给大家带来了关于PHPMyAdmin的相关知识,其中主要介绍了如何在MAC下配置PHPMyAdmin,下面一起来看一下,希望对大家有帮助。

VS Code 主要由以下语言开发:TypeScript:核心组件JavaScript:补充功能Electron:跨平台 GUIC++:性能相关功能支持多种其他语言(如 Python、Java、C#)

Python 下载后消失可能是由于:1. 安装路径不正确;2. 未添加到环境变量;3. 未正式安装;4. 防病毒软件干扰;5. 文件损坏;6. 下载不完整。

访问网站出现 nginx,原因可能是:服务器维护、服务器繁忙、浏览器缓存、DNS 问题、防火墙阻止、网站错误配置、网络连接问题或网站已关闭。尝试以下解决方案:等待维护结束、非高峰时段访问、清除浏览器缓存、刷新 DNS 缓存、禁用防火墙或防病毒软件、联系网站管理员、检查网络连接或使用搜索引擎或 Web 存档查找其他网站副本。如果问题仍然存在,请与网站管理员联系。

在 VS Code 中,通过设置“文件编码”为“UTF-8”,即可设置中文编码格式,确保中文字符的正确显示和处理,提升开发效率。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use
