mysql 5-7-11 安装 卡在没有口令登录不了了

MySql 码拜 8年前 (2016-05-27) 748次浏览
http://blog.csdn.net/lppklm/article/details/50977775
是按照这个进行安装的
之前的虚拟机  自带 mysql老版本 5-1-73
本人是按照上边的网址进行的替换my.cnf   和init.d/mysqld 文件的方式

但是 到了输入登录口令这里 过不去了
ERROR 2002 (HY000): Can”t connect to local MySQL server through socket “/var/lib/mysql/mysql.sock” (2)
本人于是在网上查, 感觉这个说的应该是本人这种情况
http://www.linuxidc.com/Linux/2014-10/107901.htm
本人也是 修改了sock =  这行, 还有添加no-auto-rehash
可是 错误依旧似乎mysql 仍旧到 原来的var/lib/mysql/ 下寻找 mysql.sock 文件
[root@localhost etc]# vi my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It”s a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# 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 = …..
# datadir = …..
# port = …..
# server_id = …..
no-auto-rehash
socket = /tmp/mysql.sock
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
skip-grant-tables
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
no-auto-rehash
socket = /tmp/mysql.sock
skip-grant-tables
~

解决方案

20

5.7升级了认证方式   安装完后mysql会自动生成随机密码 通过查看mysql日志获取随机密码  登录后或 mysql_secure_installation再修改密码

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明mysql 5-7-11 安装 卡在没有口令登录不了了
喜欢 (0)
[1034331897@qq.com]
分享 (0)