1.通过https://mirrors.tuna.tsinghua.edu.cn镜像源安装了MySQL5.7.22

rpm -ivh --force --nodeps https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/mysql-community-client-5.7.22-1.el7.x86_64.rpm

rpm -ivh --force --nodeps https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/mysql-community-server-5.7.22-1.el7.x86_64.rpm

2.通过/etc/my.cnf配置文件找到MySQL的错误日志存在/var/log/mysql.log里,在该日志里查找到mysql的root用户的临时登录密码

[root@ip-172-31-34-225 log]# cat /var/log/mysqld.log | grep 'temporary password'
2019-02-13T10:32:25.917190Z 1 [Note] A temporary password is generated for root@localhost: a1+J)%zhEURa

3.用临时密码通过命令行登录报错:ERROR 1045 (28000): Unknown error 1045

4.原因是密码错误,参考链接https://blog.csdn.net/nicolelili1/article/details/78833667(为什么初始的临时密码是错误的?这个还没弄明白)

vim /etc/my.cnf

skip-grant-tasbles #添加本行内容,意思是跳过授权表实现免密登录

5.systemctl restart mysqld

6.在命令行输入mysql回车即可登录,登录后设置新的root密码,下次通过新的密码即可登录

mysql> update user set authentication_string = password('XXXXXX') where user = 'root';
Query OK, 1 row affected, 1 warning (0.00 sec)

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

7.vim /etc/my.cnf

#skip-grant-tables #为提高安全性,将该行注释然后重启mysql.

rpm方式安装MySQL后在命令行登录报错:ERROR 1045 (28000): Unknown error 1045的更多相关文章

  1. docker mac 命令行登录报错处理 : Error saving credentials: error storing credentials - err: exit status 1

    参考:https://blog.csdn.net/xufwind/article/details/88756557 比较新版本的docker命令行登录会出现以下错误: Error saving cre ...

  2. linux(centos6.9)下rpm方式安装mysql后mysql服务无法启动

    以下两种方式启动都报错:启动失败: [root@node03 ~]# service mysqld startMySQL Daemon failed to start.Starting mysqld: ...

  3. CentOS7下通过rpm方式安装MySQL及插入中文问题解决 [原创]

    一 CentOS下通过rpm方式安装MySQL CentOS版本:CentOS-7 MySQL版本:MySQL-5.6.22 在网上搜了一下,Linux下安装MYSQL有三种方式: 1) 通过yum命 ...

  4. 安装mysql驱动之 mysqlclient 出现的报错处理(ubuntu16.04)

    首先 更新软件! sudo apt-get update 然后尝试安装mysqlclient,报错 后执行下面的步骤 安装mysql驱动之 mysqlclient 出现的报错信息处理 报错1: OSE ...

  5. Centos7.3离线(rpm方式)安装mysql服务

    1.mysql官网下载安装包,官网地址:www.mysql.com [root@seiang software]# ll total 580020 -rw-r--r--. 1 root root 59 ...

  6. kali linux 安装 Mysql Can't read from messagefile 报错解决方案

    1.下载安装包 下载地点:https://dev.mysql.com/downloads/mysql/ 或者 wget http://dev.mysql.com/get/Downloads/MySQL ...

  7. Linux下用rpm方式安装MySQL

    1.MySQL下载地址. www.mysql.com/downloads/mysql-4.0.html 下载MySQL 5.1版本的2个包(根据你的实际需求下载所需要的包): MySQL-server ...

  8. rpm方式安装mysql

    一.系统标准化采样 1)查看centos系统版本 [root@fp-web-126 ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 ...

  9. Windows上安装Xampp后通过命令行进入MariaDB

    题外话:读<MYSQL必知必会>,书中让我找个数据库服务器练手,我就去下了个Xampp,由于看的08年网易上的动态网站开发,那个时候Xampp中的m代表MYSQL,后来通过命令行进入MYS ...

随机推荐

  1. int a;和 int &a;的区别

    int a的意思是定义一个变量a int &a意思是定义一个引用 //引用相当于指针再取值 他和被引用的变量都是表示同一块内存 引用就是给变量取别名 int b ;int &a=b; ...

  2. windows之anaconda导入torch失败和pip install命令执行read time out

    昨天用jupyter导入torch还好好的呢,今天用就不行了,先是ImportError: DLL load failed: 找不到指定的模块.再是No such comm target regist ...

  3. Matlab高级教程_第四篇:白噪声的MATALB生成方式

    1. 白噪声主要是高斯白噪声. 2. 为什么是高斯白噪声? 高斯白噪声:1)这个噪声它是一个随机信号.2)“白”是指其功率谱的常数,这样他的自相关函数是狄拉克函数(冲激函数),由于它的自相关函数是冲激 ...

  4. iTOP-3399开发板搭建Android编译坏境

    基于迅为iTOP-3399开发板2.1 装 安装 d android  源码依赖包登录进 Ubuntu 系统,输入“ctrl+alt+t”,打开超级终端,使用“su root”命令,切换到 root ...

  5. reactor-core

    <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-core&l ...

  6. 吴裕雄--天生自然TensorFlow高层封装:Keras-CNN

    # 1. 数据预处理 import keras from keras import backend as K from keras.datasets import mnist from keras.m ...

  7. [tire+最短路]Bless You Autocorrect!

    [tire+最短路]Bless You Autocorrect! Typing on phones can be tedious. It is easy to make typing mistakes ...

  8. TOJ-3474 The Big Dance(递归二分)

    链接:https://ac.nowcoder.com/acm/contest/1077/L 题目描述 Bessie and the herd, N (1 <= N <= 2,200) co ...

  9. PAT甲级——1011 World Cup Betting

    PATA1011 World Cup Betting With the 2010 FIFA World Cup running, football fans the world over were b ...

  10. 75)PHP,session在使用时的一些语法问题

    (1)cookie仅能存字符串类型,但是session能存任何数据类型,比如: 然后我在session_2.php中输出这个session_1.php的数据: 结果展示: 我得在浏览器的地址栏中先请求 ...