zoukankan      html  css  js  c++  java
  • centos8 mysql8安装

     参考:

    https://blog.csdn.net/qq_39038465/article/details/81663540

    https://blog.csdn.net/qq_41525746/article/details/109995429?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-0&spm=1001.2101.3001.4242

    https://blog.csdn.net/huryer/article/details/106608119

    https://www.jb51.net/article/186499.htm

    https://blog.csdn.net/weixin_40780777/article/details/100553505

    1、下载rpm包,安装Yum Repository

    wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

     2、使用rpm来安装MySQL

    yum install mysql80-community-release-el8-1.noarch.rpm

     3、使用yum安装mysql服务

    yum repolist enabled | grep "mysql.*-community.*"

    rpm -ivh mysql80-community-release-el8-1.noarch.rpm

    4、查看mysql状态 systemctl list-unit-files|grep mysqld

    systemctl enable mysqld.service

    ps -ef|grep mysql

     5、获取临时密码:grep 'temporary password' /var/log/mysql/mysqld.log

    注意这个地方的路径,跟网络搜到的不一致,目录多了个mysql

    6、发现临时密码不存在,需要初始化:mysqld:mysqld --initialize --user=mysql

    然后再获取临时密码即可得到:grep 'temporary password' /var/log/mysql/mysqld.log

     7、登录mysql:

    mysql -u root -p回车输入密码后报错:

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    各种看都试了,最后看下面连接

    https://www.cnblogs.com/wangpingcong/p/14000678.html

    原来是服务没有启动,运行systemctl start mysqld.service命令,看到下图active(running)再登录就好了

     8、接下来就是修改默认密码,开始操作数据库吧!!!!!

  • 相关阅读:
    C语言预处理
    C语言结构体对齐
    C语言共用体、大小端、枚举
    C语言内存分配方法。
    C与指针(结构体指针,函数指针,数组指针,指针数组)定义与使用
    C语言中函数的传入值与传出值
    #define与typedef在重定义类型中的区别
    宏定义在位运算中的运用
    wait函数
    exit()与_exit()区别
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/14485092.html
Copyright © 2011-2022 走看看