常见错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 密码输入错误;无法远程连接,授权root用户 flush privileges;

1、下载zip:https://dev.mysql.com/downloads/file/?id=474263

2、安装、启动、修改密码、支持远程连接

C:\Users\Administrator>cd C:\Users\Administrator\Downloads\mysql-5.6.39-winx64\m
ysql-5.6.39-winx64\bin

C:\Users\Administrator\Downloads\mysql-5.6.39-winx64\mysql-5.6.39-winx64\bin>mys
qld install
Service successfully installed.

C:\Users\Administrator\Downloads\mysql-5.6.39-winx64\mysql-5.6.39-winx64\bin>net
start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

C:\Users\Administrator\Downloads\mysql-5.6.39-winx64\mysql-5.6.39-winx64\bin>mys
ql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.39 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> show databases;

C:\Users\Administrator>mysql -u root -p
Enter password: **********
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

C:\Users\Administrator>mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.39 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> use mysql;
Database changed
mysql> show tables;

mysql> update user set host = '%' where user = 'root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
mysql> select * from user where user='root';

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

将相应用户数据表中的host字段改成'%';

  1. update user set host='%' where user='root';

ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会

  1. flush privileges;

重新远程连接OK

window 安装mysql的更多相关文章

  1. window安装mysql

    window安装mysql 1. 官网下载mysql zip安装包,然后解压到你想安装的目录,假设解压的目录是P:\mysql 解压完的目录:bin docs include lib share CO ...

  2. window安装MySQL 5.5教程

    window安装MySQL 5.5教程 1.官网下载MySQL 5.5 下载地址:https://dev.mysql.com/downloads/mysql/5.5.html#downloads 2. ...

  3. window 安装Mysql 5.6 发生系统错误 1067

    问题: #安装MySQL服务:mysqld -install MySQL5 D:\Program Files\mysql_5.6.24_winx64\bin>mysqld -install My ...

  4. (转载)window安装mysql

    一.MYSQL的安装 1.打开下载的mysql安装文件mysql-5.5.27-win32.zip,双击解压缩,运行“setup.exe”. 2.选择安装类型,有“Typical(默认)”.“Comp ...

  5. window安装mysql(详细步骤)

    前两天电脑炸了,就重新装了系统重新安装了一遍mysql. 首先 你需要有一个安装包哈哈哈,mysql的安装包. 最好不要安装在c盘呦~ 来进入正题吧... ********************** ...

  6. window安装mysql教程

    1.下载mysql安装包到指定文件: 比如如图我把下载的mysql zip的内容解压到这个文件里面,具体文件内容如下: my.ini 需要自己创建,里面的内容如下: [mysqld] #basedir ...

  7. MySQL Community Server 5.5.56 ZIP Archive 绿色解压版 window安装步骤

    MySQL Community Server 5.5.56  ZIP Archive  绿色解压版 window安装步骤 首先 准备好启动配置文件my.ini [mysqld] #设置字符集为utf8 ...

  8. Window下MySql 5.6 安装后内存占用很高的问题

    Window下MySql 5.6 安装后内存占用很高的问题 刚刚准备玩一把mysql,初学者 环境是window 7和window sever 2008, mysql是最新的5.6, 发现的问题是安装 ...

  9. Window 下 MySQL 环境的安装

    Window 下 MySQL 环境的安装 简介: MySQL 是最流行的关系型数据库管理系统,在WEB应用方面 MySQL 是最好的RDBMS(Relational Database Manageme ...

随机推荐

  1. Redis和Memcache区别,优缺点对比

    1. Redis和Memcache都是将数据存放在内存中,都是内存数据库.不过memcache还可用于缓存其他东西,例如图片.视频等等. 2.Redis不仅仅支持简单的k/v类型的数据,同时还提供li ...

  2. sxstrace启动.bat

    @echo offset dd=%date:~8,2%set mm=%date:~5,2%set yy=%date:~0,4%set Tss=%TIME:~6,2%set Tmm=%TIME:~3,2 ...

  3. 【oracle常见错误】oracle监听程序配置/“ORA-12541: TNS: 无监听程序”

    问题描述 在用PL/SQL Developer连接Oracle 11g时报错“ORA-12541: TNS: 无监听程序”,如下图所示.可以按照如下的步骤进行解决. 解决方案 监听程序配置 从开始菜单 ...

  4. py目录

    Python开发[第二篇]:初识Python Python开发[第三篇]:Python基本数据类型 Python开发[第四篇]:Python基础之函数   &&[4.1]算法递归 冒泡 ...

  5. Django Forms 表单

    环境 python 3.7 服务端  views.py from django import forms # 引入 froms 模块 from django.forms import widgets ...

  6. ajax用FormData方式提交

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. Linux网络编程学习(二) ----- 进程控制(第三章)

    1.进程和程序 程序是一个可执行文件,而一个进程是一个执行中的程序实例.一个进程对应于一个程序的执行,进程是动态的,程序是静态的,多个进程可以并发执行同一个程序.比如几个用户可以同时运行一个编辑程序, ...

  8. indexOf() 如何判断一个元素在指定数组中是否存在? 找出指定元素出现的所有位置? indexOf()方法 是正序查找,lastIndexOf()是倒叙查找

    indexOf()方法返回在数组中可以找到一个给定元素的第一个索引,如果不存在,则返回-1. let a = [2, 9, 7, 8, 9]; a.indexOf(2); // 0 a.indexOf ...

  9. grains和pillar的联合使用

    在编写sls文件的时候,对于不同的客户端,在配置管理的时候,其安装的环境,配置文件和启动的服务都相同: 如果完全是不同的环境,建议写单独的sls文件,不要混合在一起; 如果是相同的环境,只不过对于不同 ...

  10. python学习笔记(三)- 字典、集合

    字典:key-value形式 1)取数据方便   #字典里面没有重复的key 2)查询速度快 #字典是无序的 一.定义一个字典 infos = { 'name':'王小明', 'sex':'male' ...