zoukankan      html  css  js  c++  java
  • CentOS 7 安装MySQL 5.6遇到问题及解决方案

    centos下安装mysql真的没有想象中那么容易,在这里我总结一下遇到的问题

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

    出现这种问题一般是MySQL-server没有安装成功,可以通过yum install MySQL-server-5.6.25-1.el7.x86_64.rpm重新安装

    2. Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

    执行mysql_install_db –user=mysql

    3. rpm安装mysql后/etc/目录下找不到my.cnf

    whereis mysql查看mysql安装目录
      mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
    cp /usr/share/mysql/my-default.cnf /etc/my.cnf

    4.ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

    # /etc/init.d/mysql stop
    # mysqld_safe –user=mysql –skip-grant-tables –skip-Networking &
    # mysql -u root mysql
    mysql> UPDATE user SET Password=PASSWORD(‘newpassword’) where USER=’root’; 
    mysql> FLUSH PRIVILEGES; 
    mysql> quit
    # /etc/init.d/mysql restart

    5.rpm -ivh安装时包 出现 file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64

    [root@localhost install-files]# yum remove mysql-libs  

    6.mysql在linux表明大小写敏感问题

    编辑/etc/my.cnf在[mysqld]下插入lower_case_table_names=1
    修改完成后重启mysql服务
    通过show variables like '%case%',查看是否修改成功

    7.MySQL不能远程连接Host is not allowed to connect to Host ‘10.72.35.8’ is not allowd to connect to this MySQL server

    GRANT ALL PRIVILEGES ON . TO 'root'@'%'WITH GRANT OPTION; 
    FLUSH PRIVILEGES

    8.出现以下错误

    [root@azrlnx06 jirasetup]# rpm -ivh MySQL-server-advanced-5.6.20-1.rhel5.x86_64.rpm 
    Preparing... ################################# [100%]
    Updating / installing...
    1:MySQL-server-advanced-5.6.20-1.rh################################# [100%]
    FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
    Data::Dumper
    [root@azrlnx06 jirasetup]# 

    此时运行 yum install -y perl perl-devel

  • 相关阅读:
    android studio 修改应用程序图标
    [AppDelegate window]: unrecognized selector sent to instance 0x600002b178e0
    Error compiling file: /private/var/folders/tm/rj18p_ls10lb_fsqfc7h4trm0000gn/T/jetty-0.0.0.0-8081-WebRoot-_-any-/jsp/org/apache/jsp/login_jsp.java
    mac下eclipse突然打不开了,直接停在启动页上不动
    iOS下收不到通知,或者只收到一个通知
    名词:箭头函数
    名词:硬编码
    keil5开发工具
    Android系统源码学习步骤 ,linux学习方向
    小白学习Spark系列一:Spark简介
  • 原文地址:https://www.cnblogs.com/niechen/p/6875695.html
Copyright © 2011-2022 走看看