Linux下查看mysql 5.7安装后的root默认临时密码是什么,修改登录密码
cat /var/log/mysqld.log | grep 'temporary password'2020-04-22T23:25:49.208184Z 1 A temporary password is generated for root@localhost: Gpa3D8giTt>z
这个密码是一次性的,只能在ssh上使用,注意立即修改
修改方法,执行
mysql -uroot -p
输入上方获取到的密码
Gpa3D8giTt>z
登录成功后输入
set global validate_password_policy=0;
set global validate_password_length=1;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'kangle';
然后输入quit退出即可
接下来用账号root,新密码kangle即可登录
{:3052:} 报这个错误
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
chungbin 发表于 2024/5/10 15:46
报这个错误
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' ...
这个提示是数据库未安装或者未启动,无法连接到mysql-server
页:
[1]