ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES
解决方法:
利用mysql安装时的默认用户名登录mysql后, 输入以下命令修改root密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
2. 授予用户权限
GRANT ALL PRIVILEGES ON *.* TO 'jiang'@'%' IDENTIFIED BY '1';
flush privileges;
下面的内容没有用到
一.有时可以直接输入命令: mysql进入数据库
启动数据库:# mysqld_safe &
二.查看用户命令:
mysql> 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
mysql> select host,user from mysql.user;//show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
rows in set (0.00 sec) mysql>
删除用户
mysql>Delete FROM user Where User='test' and Host='localhost'; mysql>flush privileges; mysql>drop database testDB; //删除用户的数据库 删除账户及权限:>drop user 用户名@'%'; >drop user 用户名@ localhost;
创建用户
mysql> create user 'root'@'%' identified by '';# %代表所有端口
Query OK, rows affected (0.07 sec) mysql> select host,user from mysql.user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | root |
| % | usrabc |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+------------------+
rows in set (0.00 sec)
查看数据库列表:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
row in set (0.00 sec) mysql>
ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES的更多相关文章
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因
在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...
- mysql 链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES))
mysql链接失败(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)) 修改: # ...
- 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案
本机是centos 6.5 安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...
- MySQL学习笔记——ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Enter password: E ...
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE)
安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using ...
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO
MySQL安装完server端和客户端后,登录Mysql时报错:[root@rhel204 MySQL 5.6.23-RMP]# mysqlERROR 2002 (HY000): Can't conn ...
- [mysql] ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
用mysql -u root -p显示ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...
- mysql全局权限账户%登录不上ERROR 1045 (28000): Access denied for user 'mhz'@'localhost' (using password: YES)
mysql全局权限账户%登录不上ERROR 1045 (28000): Access denied for user 'mhz'@'localhost' (using password: YES) 解 ...
随机推荐
- Css - 元素的显示模式
Css - 元素的显示模式 块元素(block) 块元素是指: 1.独占一行,每个div上下之间没有留白,上面的div的底部与下面的div的顶部紧紧靠在一起没有任何缝隙 2.可设置宽高,默认宽度是父元 ...
- Light oj 1099 - Not the Best 次短路
题目大意:求次短路. 题目思路:由于可能存在重边的情况所以不能采用邻接矩阵储存图,我用了邻接表来存图. 由起点S到终点E的次短路可能由以下情况组成: 1.S到v点的次短路 + v到E的距离 2.S到v ...
- HDU 4857 逃生(拓扑排序)
拓扑排序 一.定义 对一个有向无环图(Directed Acyclic Graph简称DAG)G进行拓扑排序,是将G中所有顶点排成一个线性序列,使得图中任意一对顶点u和v,若<u,v> ∈ ...
- shell编程 之 流程控制(条件语句和循环语句)
1 if ...else... 基本格式: if condition then commend else commend fi 当然也可以写到一行,用[ ]表明边界,用:表示分行.比如: if [ $ ...
- WC2019 游记
Day 0 早上奇迹般的六点半起床平常这时候我还没睡呢 早餐在武汉站吃了一碗28的番茄牛肉米线,结果上菜后我把所有非米线的固体(包括番茄和牛肉)全挑出去了 高二大佬:一个愿宰一个愿挨 在高铁上待了四个 ...
- ActiveMQ使用
一.Windows安装ActiveMQ 1.下载解压 2.启动服务 二.Linux安装ActiveMQ 1.下载解压 2.启动访问 三.队列模式 1.创建maven项目 2.生产者 3.消费者 四.主 ...
- 开源的API文档工具框架——Swagger简介
初次接触Swagger是在2017年5月,当时公司正好要对整套系统架构进行重新设计,有同事推荐用这个技术框架来规范后台接口的API文档.当时因为架构重构,涉及改造的技术点太多,一时也就没太多精力,把S ...
- 用WMI监控IIS
参考网站:http://blog.chinaunix.net/uid-7910284-id-5774420.html 参考官方文档:https://docs.microsoft.com/en-us/p ...
- windows网络相关的命令
一.netstat命令 显示协议统计信息和当前 TCP/IP 网络连接. NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] ...
- vue 不常见操作
对 v-html 的扩展操作, 问题产生背景, 在vue 项目中,用v-html渲染 html字符串,这里面包括a 标签等内容,因为某种需求,a 的默认跳转不符合要求,要经过自己定义的方法跳转. 原 ...