1、打开终端,输入命令:cd /usr/local/mysql/bin

2、mysql -uroot -p,用这条命令登陆时报错信息:

报错:Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 3、打开终端输入:sudo mysqld_safe --skip-grant-tables
输出
Password:
Logging to '/usr/local/mysql/data/localhost.err'.
2018-10-10T03:21:40.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 4、打开一个新的终端,输入:mysql -u root ,会看到以下输出。
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.7.23 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 5、终端输入 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 6、修改密码:UPDATE mysql.user SET authentication_string=PASSWORD('你的密码') WHERE User='root';
Query OK, 1 row affected, 1 warning (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 1
												

mac 中登陆mysql忘记密码解决办法的更多相关文章

  1. 十五、mac 中登陆mysql忘记密码解决办法

    mac 中登陆mysql忘记密码解决办法 1.打开终端,输入命令:cd /usr/local/mysql/bin 2.mysql -uroot -p,用这条命令登陆时报错信息: 报错:Enter pa ...

  2. mac中登陆mysql忘记密码解决办法

    1.打开终端,输入命令:cd /usr/local/mysql/bin 2.mysql -uroot -p,用这条命令登陆时报错信息: 报错:Enter password: ERROR 1045 (2 ...

  3. MySQL忘记密码解决办法

    一.windows下mysql忘记root密码的解决方法 详细出处参考:http://www.jb51.net/article/21984.htm 1,停止MYSQL服务,CMD打开DOS窗口,输入 ...

  4. mac mysql忘记密码解决办法

    http://www.jb51.net/article/87580.htm http://blog.csdn.net/soft2buy/article/details/50223373

  5. MySQL 忘记密码解决办法

    第一步: 关闭MySQL服务.  第二步: 打开DOS窗口,在里面输入安装MqSQL的目录本机为:C:\Program Files\MySQL\MySQL Server 5.6\bin 第三步: 在命 ...

  6. mysql忘记密码解决的办法

    [很管用]忘记mysql root密码解决办法 1.编辑MySQL配置文件: 首先停止mysql服务, 然后开始编辑mysql配置文件:vi /etc/my.cnf在[mysqld]配置段添加如下一行 ...

  7. CentOS忘记mariadb/mysql root密码解决办法

    本文不再更新,可能存在内容过时的情况,实时更新请访问原地址:CentOS忘记mariadb/mysql root密码解决办法: 这里有两种方式实现修改mariadb root密码. mariadb版本 ...

  8. CentOS 6忘记密码解决办法,root和普通用户均可

    转自nui111的文章:http://blog.csdn.net/nui111/article/details/28007357 说明 操作系统:CentOS 6.0 遇到问题:忘记管理员账号root ...

  9. MAC下的mysql忘记密码该怎么办??

    不要着急,不要慌,好多人会忙手忙脚,以为自己安装了一个假软件,其实是你打开的方式不对而已! step1: 苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务(点击 ...

随机推荐

  1. 设计模式のChainOfResponsibilityPattern(责任链模式)----行为模式

    一.产生背景 职责链模式是一种行为模式,为解除请求的发送者和接收者之间的耦合,而使多个对象都有机会处理这个请求.将这些对象连接成一条链,并沿着这条链传递该请求,直到有一个对象处理它.避免请求发送者与接 ...

  2. mumu安卓模拟器使用教程

    安装教程: 1http://mumu.163.com/  在这网址里面下载 2.安装 我的是mac 安装时需要输入你的你电脑密码  但是也报错,你点击旁边的提示就会告诉去安全与隐私里点击允许就好了 很 ...

  3. Python3爬虫 利用百度地图api得到城市经纬度

    有2种方式,第一种是利用urllib , 方法1:利用urllib , 先把url 转成urlcode,然后读取网页,读到网页再用json读取内容,比较麻烦. 可以在浏览器输入,看一下格式. http ...

  4. 写了12年JS也未必全了解的连续赋值运算

    引子 var a = {n:1}; var b = a; // 持有a,以回查 a.x = a = {n:2}; alert(a.x);// --> undefined alert(b.x);/ ...

  5. ECO开放平台对接文档说明

    应用集成: http://open.teewon.net:1000/static/index.html#/docs/flow/integrate统一认证集成文档: http://open.teewon ...

  6. Redis可视化客户端管理及监控工具TreeNMS

    https://www.cnblogs.com/li150dan/p/9529054.html

  7. 漏洞扫描,linux配置规范处理

    #!/bin/bash ## set shortest length of password filename=/etc/login.defs if [ -f "$filename" ...

  8. Python中print和return的区别

    有趣的事,Python永远不会缺席! 如需转发,请注明出处:小婷儿的python  https://www.cnblogs.com/xxtalhr/p/10742671.html 一.解释 1.ret ...

  9. k8s 节点的 NodeAffinity 使用

    apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 kind: Deployment metadata: name: vi ...

  10. 多个jdk 变更 引起 tomcat插件 启动不了 The JRE could not be found.Edit the server and change the JRE location.

    The JRE could not be found.Edit the server and change the JRE location. 在Windows->Preferences-> ...