昨天MySQL无法远程登录,授权为远程登录后,本地无法登录了
关掉MySQL,
不加载权限方式重新启动
使用无密码方式登录MySQL查看用户表
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
+------+-----------+
删除 | root | % |这一行的权限,
关闭数据库,正常启动
正常登录
D:\mysql-5.6.10-winx64\bin>mysql -uroot -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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> grant all privilege on *.* to root@'%' identified by "root";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL serv
er version for the right syntax to use near 'privilege on *.* to root@'%' identified by "root"' at line 1
mysql> grant all on *.* to root@'%' identified by "root";
Query OK, 0 rows affected (0.00 sec)
grant all on *.* to root@'%' identified by "root"; flush privileges;
Enter password: **** ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
关掉MySQL,
不加载权限方式重新启动
D:\mysql-5.6.10-winx64\bin>mysqld --skip-grant-tables
使用无密码方式登录MySQL查看用户表
D:\mysql-5.6.10-winx64\bin>mysql -u root use mysql; select user,host from user;
+------+-----------+
| user | host |
+------+-----------+
| root | % |
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
+------+-----------+
删除 | root | % |这一行的权限,
关闭数据库,正常启动
delete from user where host='%'; exit; D:\mysql-5.6.10-winx64\bin>mysqladmin -uroot shutdown; D:\mysql-5.6.10-winx64\bin>mysqld
正常登录
引用
D:\mysql-5.6.10-winx64\bin>mysql -uroot -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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> grant all privilege on *.* to root@'%' identified by "root";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL serv
er version for the right syntax to use near 'privilege on *.* to root@'%' identified by "root"' at line 1
mysql> grant all on *.* to root@'%' identified by "root";
Query OK, 0 rows affected (0.00 sec)
发表评论
-
linux 安装mysql多个实例
2020-03-13 15:47 373mysql5.7.28多实例 安装mysql,不要启动 创 ... -
mongodb安全验证 密码登录
2020-03-09 16:07 6971、创建用户 cd /d C:\Program Files\ ... -
索引的创建对查询性能影响
2019-08-19 15:14 631索引的正确使用,对查询的性能影响很大 原查询,要2分多 ... -
mysql查询性能优化,650秒优化到0.18秒
2019-08-14 17:57 29开发人员技术水平不一,写出的sql执行性能怎么样,完全靠运气, ... -
MySQL 高可用集群架构 MHA 详解
2018-03-09 09:28 755MySQL 高可用集群架构 MHA ... -
B+tree 索引
2018-03-09 09:11 696mysql和oracle都用到B+tree ... -
怎么查看和修改 MySQL 的最大连接数
2018-03-09 08:47 1068通常,mysql的最大连接数默认是100, 最大可以达到163 ... -
mysql 删除重复记录 保留一条
2018-01-25 10:47 1128-- 方法一 /** 错误码: 1093 You ... -
rsync备份和删除指定文件
2018-01-02 10:23 1992文件异地备份时,需要将本地文件合并到服务器上,且不能删除服务器 ... -
windows mysql定时备份任务
2017-11-03 16:12 966mysqlbak.cmd echo off set tx ... -
mysql 1418错误原因及解决
2017-09-30 11:14 1066SET GLOBAL log_bin_trust_functi ... -
windows上oracle11配置监听器
2017-08-23 14:00 1696oracle11 windows版安装后默认通过计算机名 ... -
centos yum 安装mysql
2016-08-11 10:08 495查看这篇文章 http://dev.mysql.com/dow ... -
expdp\impdp及exp\imp
2016-08-03 14:29 715作者写的文章很实用 ht ... -
oracle drop记录
2016-07-21 14:07 1515数据库中缺表了,查一下是什么时候删除的 select * ... -
powerdesigner 16 从数据库生成表结构无响应
2016-07-15 09:35 1277怪事了,powerdesigner从数据库反向生成表结构是,卡 ... -
oracle 删除和重建表空间脚本
2016-07-07 11:23 2565调试数据库生成脚本,需要频繁重建表空间 /** ... -
plsql11 x64 安装和配置 解决OCI: not initialized
2016-06-18 09:38 16692下载了instantclient-basic-windows. ... -
oracle instantclient和plsql配置
2016-05-23 14:47 7071、下载instantclient 下载后多解压到某文件夹下 ... -
oracle AL32UTF8 zhs16gbk 安装字符编码
2016-05-23 14:30 1498NLS_LANG是环境变量,包括3部分NLS参数:NLS_LA ...
相关推荐
MySQL root密码正确,却怎么也无法从本地登录MySQL,提示 代码如下: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES) 这里后来经高人指点才发现mysql库中的user表缺少...
主要介绍了MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES,需要的朋友可以参考下
主要介绍了mysql本地登录无法使用端口号登录的解决方法,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
mysql登录方式和本地免密登录方式.docx
C#连接本地MySQL数据库源码.
## mysql登陆方法:(单、多实例,本地、远程登录) ## 修改mysql提示符 ## 修改密码 ## root密码丢失找回 ## SQL结构化查询语言,是对关系型数据库进行操作、管理的语言 # DQL数据查询语言 select .......[where...
让他只可以在localhost上登录,并可以对数据库mydb进行查询、插入、修改、删除的操作(localhost指本地主机,即MYSQL数据库所在的那台主机),这样用户即使用知道test2的密码,他也无法从internet上直接访问数据库,...
Mysql 8.0.28 启动服务,并添加自启动 登录并重置密码,开放远程链接 开放端口 防火墙开启 1、开启端口3306 firewall-cmd --zone=public --add-port=3306/tcp --permanent; 2、重启防火墙 firewall-cmd --reload ...
mysql, 登录 Express + Passport + MySQL 使用MySQL完成 node-身份验证的完整指南整个 scotch.io 教程系列的代码: 使用MongoDB完成 node 认证的完整指南当前版本数据库被移植到 MySQL我们将使用护照在本地对用户...
mysql用户本地登录 mysql数据库常用操作 创建存储过程 mysql用户管理 本地数据备份
Navicat for MySQL,连接mysql客户端绿色版软件
3.浏览器中输入本地路由:登录界面为:localhost:3000/www.login.html ,其中“3000”这个可能会因不同的编程软件而不同,这里我用的是HbuilderX,然后登陆使用,还有其他乱七八糟的功能靠各位探索了 ps:如果...
我们可以使用linux的scp命令(scp无法在windows使用),加上mysql自带的mysqldump,能很快的完成数据库的迁移 将本地的数据库(music_db)导出为sql文件(music_db.sql) mysqldump -uroot -p music_db > music_db.sql 用...
问题:MySQL命令行登录 解决: 命令 行登录语法: mysql –u用户名 [–h主机名或者IP地址] –p密码 说明:用户名是你登录的用 户,主机名或者IP地址为可选项,如果是本地连接则不需要,远程连接需要...
android的登陆和注册(mysql的数据库 把ip改成自己的ip就能用) 带数据库 服务端
02-登录MySQL知识深入讲解.avi 03-学会使用MySQL数据库的帮助.avi 04-修改mysql密码多方法实战及注意-排错.avi 05-找回丢失的mysql密码实战.avi 06-多实例找回丢失的mysql密码.avi 07-SQL语言介绍及分类详解.avi 08-...
连接Mysql代码在server/conf/conf.js配置信息改为自己的。表创建在server/malldata.sql文件内直接复制插入。数据库名是malldata,不懂用数据库去百度很容易 cd vueMall npm install express: cd server npm install...