Navicat 连接VMware中Ubuntu 下的mysql5.7遇到的坑

1.用Navicat连接虚拟机下的mysql出现问题: 2003- Can't connect MySQL Server on '192.168.*.*'(10038).

解决方案:

方法:直接授权(推荐)

  从任何主机上使用root用户,密码:youpassword(你的root密码)连接到mysql服务器:
  # mysql -u root -proot 
  mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

2. 由于操作错误,再次登录出现问题:“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)”。

解决方案:

1、跳过密码进行登录

  修改mysql配置文件   在[mysqld]的段中加上两句:

    skip-name-resolve   
    skip-grant-tables   

2. 登录mysql,修改密码

/usr/bin/mysql登入mysql

use mysql ;   
update mysql.user set authentication_string=password('root') where user='root';
flush privileges;   
quit 

3. 重启mysql服务

  service mysql restart

原文地址:https://www.cnblogs.com/charliePU/p/7429251.html