`

redhat5下安装MySQL-5.6,默认密码无法进入的解决办法

 
阅读更多
    redhat5下安装MySQL-5.6,默认装完没有设置mysql的密码,按理说应该mysql的root用户的默认密码为空,但是默认空密码无法进入,报错信息如下:
  Access denied for user 'root'@'localhost' (using password: NO)

各种密码尝试都无法进入mysql。经网上查找资料终于找到解决办法。

解决办法:
找到my.cnf文件,编辑文件,添加如下内容:
  skip-grant-tables
     skip-networking

红色字体为新添加。

[root@localhost /]# vi /usr/my.cnf 

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[mysqld]
[color=red] 
  skip-grant-tables
  skip-networking
[/color]


# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....



重新启动:/etc/init.d/mysql restart
启动OK后,mysql的root用户默认空密码可以正常进入。
0
0
分享到:
评论

相关推荐

    mysql 5.6.38 安装(redhat 6).pdf

    如果在安装过程中遇到包签名验证失败的警告,通常是因为官方的GPG密钥没有被导入到系统中,可以通过安装MySQL官方提供的GPG密钥来解决。 三、启动和配置MySQL服务 MySQL安装完成后,通常服务不会自动启动,需要手动...

    redhat linux下的mysql安装与配置图文教程 (2).pdf

    【Redhat Linux下的MySQL安装与配置】 在Redhat Linux系统中安装和配置MySQL数据库服务器是一项重要的任务,尤其对于那些依赖于Linux环境的企业级应用来说。MySQL是一个流行的关系型数据库管理系统,广泛应用于...

    062904mysql基础与07181

    MySQL的主要版本包括MySQL-5.5、5.6和计划中的6.0。在Linux系统如RedHat上,可以通过`service mysqld start`命令启动MySQL服务。默认的数据库连接端口是3306。用户可以通过`mysql`命令行客户端登录,首次使用通常...

    ansible-role-sonar:Ansible角色-SonarQube

    Ansible角色,在RedHat / CentOS和Debian / Ubuntu Linux服务器上安装 。 要求 需要在服务器上安装unzip实用程序。 另外,不同的SonarQube版本需要不同的Java最低版本: SonarQube 5.0-5.5需要Java 7+ SonarQube ...

    CentOS 7.3.1611编译安装Nginx1.10.3+MySQL5.7.16+PHP7.1.2

    CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。 1、关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2、安装...

    Centos6.5和Centos7 php环境搭建方法

    cat /etc/redhat-release rpm -q centos-release ``` 在CentOS 6.5和7中,最常用的Web服务器是Apache。安装Apache(httpd)非常简单,只需一行命令: ```bash yum install httpd ``` 如果安装过程中出现错误,如...

Global site tag (gtag.js) - Google Analytics