zoukankan      html  css  js  c++  java
  • ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    Centos7.5  刚安装的mariadb数据库报错

    报错:

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    

    原因一:没有启动数据库

    解决方法:
        systemctl start mariadb
        systemctl enable mariadb
    

    原因二:未知

    解决方法:
    [root@db01 ~]# vim /etc/my.cnf
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    skip-grant-tables  #在配置文件中加入这一条
    [root@db01 ~]# systemctl restart mariadb    #重启数据库
    [root@db01 ~]# mysql  #登录成功
    Welcome to the MariaDB monitor.  Commands end with ; or g.
    Your MariaDB connection id is 2
    Server version: 5.5.60-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    MariaDB [(none)]> 
    
    

      

  • 相关阅读:
    记一次测试服务器被黑
    那些H5用到的技术(5)——视差滚动效果
    POJ1179 Polygon
    Cookies
    SGU167 I-country
    POJ1704
    POJ3233 Matrix Power Series
    TYVJ2002 扑克牌
    Tyvj1933绿豆蛙的归宿
    支配树学习笔记
  • 原文地址:https://www.cnblogs.com/lvhanzhi/p/10397889.html
Copyright © 2011-2022 走看看