MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed
MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed
1.安装完MySQL设置root密码报错如下
[root@vm172--- data]# mysqladmin -uroot password "linux@123"
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
2.停止MySQL服务
[root@vm172--- ~]# systemctl stop mysqld.service
3 安全模式启动
[root@vm172--- mysql]# mysqld_safe --skip-grant-tables &
[]
[root@vm172--- mysql]# :: mysqld_safe Logging to '/var/log/mysqld.log'.
:: mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
4 无密码root帐号登陆
[root@vm172--- mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6.-log MySQL Community Server (GPL) Copyright (c) , , 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
5 手动update修改密码
mysql> update user set password=password("linux@123") where user='root' and host='localhost';
Query OK, row affected (0.00 sec)
Rows matched: Changed: Warnings:
mysql> flush privileges;
Query OK, rows affected (0.00 sec)
mysql> quit
Bye
重新使用密码登录
[root@vm172--- mysql]# mysql -uroot -plinux@
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
Server version: 5.6.-log MySQL Community Server (GPL) Copyright (c) , , 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>
6 正常重新启动
[root@vm172--- ~]# service mysqld start
#查看进程
[root@vm172--- ~]# ps -ef|grep mysql
root : pts/ :: tail -f -n /var/log/mysqld.log
mysql : ? :: /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql : ? :: /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root : pts/ :: grep --color=auto mysql
#查看端口号
[root@vm172--- ~]# netstat -lntup|grep
tcp 0.0.0.0: 0.0.0.0:* LISTEN /mysqld
至此mysql密码修改完成。
MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed的更多相关文章
- MySQL忘记密码,或:root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案
MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案 1 登陆失败,mysqladmin修改密码失败 ...
- MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案!
-- ==================================================================== -- mysqladmin: connect to s ...
- mysql修改密码与password字段不存在mysqladmin connect to server at localhost failed
mysqladmin: connect to server at 'localhost' failed 停止mysql服务 systemctl stop mysql 安全模式启动 chown -R m ...
- mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
就当作自己忘记Mysql密码把,忘记密码的解决方法 一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Acce ...
- MYSQL登录错误:mysqladmin: connect to server at ‘localhost’ failed
一.mysql登录错误 mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user ...
- mysqladmin: connect to server at 'localhost' failed
1:mysqladmin: connect to server at 'localhost' failed 2: 3: 4:
- MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案
===========================================================二,忘记本地root的登录密码解决过程:1.编辑/mysql/my.ini在[my ...
- MariaDB:登陆报错:mysqladmin: connect to server at 'localhost' failed
见图: 解决办法: /etc/init.d/mysqld stop mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended ...
- mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
注:本文来源于< mysql5.7设置简单密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy r ...
随机推荐
- vue的$nextTick使用总结,this.$refs为undefined的解决办法,element Ui的树形控件setCheckedKeys方法无法使用
其实这3个讲的是一个问题,先说下问题,我在watch里设置一个监听,当弹窗打开时,自动添加树形的默认选中项, 但奇怪的是this.$refs为undefined,自然setCheckedKeys无法使 ...
- 自学python之路(day3)
基础数据类型---字符串str 1.字符串的索引和切片 索引即下标,就是字符串组成的元素从第一个开始,初始索引为0以此类推. a = 'ABCDEFGH' print(a[0]) print(a[1] ...
- python基础15上_迭代器_生成器
# 迭代器和生成器 # 迭代器: # 双下方法 : 很少直接调用的方法.一般情况下,是通过其他语法触发的 # 可迭代的 —— 可迭代协议 含有__iter__的方法('__iter__' in dir ...
- 2017-10-22模拟赛T2 或(or.*)
题面 [题目描述]你需要构造一个长度为 n 的数列 X,当中的数字范围从 0 到 2^30-1.除此之外你需要满足 m 个条件,第 i 个条件为 X[li]|X[li+1]|……|X[ri]=pi.| ...
- python基础语法二
迭代 test = "妹子有种冲我来" #可迭代对象 == 被for进行循环获取 for item in test: print(item) break #练习题: test = ...
- Linux 驱动——Button驱动5(atomic)原子量
button_drv.c驱动文件: #include <linux/module.h>#include <linux/kernel.h>#include <linux/f ...
- 【oracle入门】数据库系统范式
为了规范关系数据模型,关系型数据库系统在设计时必须遵守一定的规则,这种规则成为关系型数据库范式. 1.第一范式1NF 如果字段中的值已经是无法再分割的值,则符合第一范式,即1NF. 2.第二范式2NF ...
- Linux系统安装与初用
1.结合实验尝试,并查阅资料,总结在实验准备中提出的7个问题. (1).Linux的发行版本.内核版本:二者区别与联系. 核心版本主要是Linux的内核,发行版本是各个公司推出的版本,他们与核心版本是 ...
- Java NIO 入门
本文主要记录 Java 中 NIO 相关的基础知识点,以及基本的使用方式. 一.回顾传统的 I/O 刚接触 Java 中的 I/O 时,使用的传统的 BIO 的 API.由于 BIO 设计的类实在太 ...
- 垃圾回收(GC Garbage collection)
JS有自动垃圾清理机制, 如果有不需要用的对象,只需要设置对象=null即可 Var a = new object() a = null