linux安裝mysql時候報錯解決方案

安裝教程:https://www.jianshu.com/p/d49bd39e23a3

 

1、執行命令:mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backu
     報錯:mv: cannot stat ‘/etc/yum.repos.d/CentOS-Base.repo’: No such file or directory

     解決方案:http://mirrors.163.com/.help/centos.html

     說明:將備份好CentOS-Base.repo(沒有該文件網上下載一份放入到該文件夾下面)

      執行命令:mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

           下載對應版本repo文件, 放入/etc/yum.repos.d/(操作前請做好相應備份既是上一步的操作執行命令)

            按照如下步驟生成緩存(1、yum clean all    ;2、yum makecache  )

            注:yum 不能安裝應用查看本文章的第二點

 

2、執行yum 不能安裝應用,

     提示There are no enabled repos Run "yum repolist all"

     解決方案:

 

 

3、執行命令:./scripts/mysql_install_db --user=mysql
     報如下錯誤:

sh: ./bin/my_print_defaults: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory  
    FATAL ERROR: Neither host 'ize0bao3ojq3h2z' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

     解決方案: 

 

 

4、執行命令:./scripts/mysql_install_db --user=mysql
     報如下錯誤:

WARNING: The host 'ize0bao3ojq3h2z' could not be looked up with ./bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !

     解決方案: https://blog.51cto.com/00127129/1679241
     編輯hosts文件:vim /etc/hosts

     添加如下命令: 當前主機的IP地址 + 當前的機器名 (例如:120.88.78.186 localhost)

 

5、

6、

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章