文档首页> 数据管理服务 DAS> 常见问题> 连接管理> GaussDB(for MySQL)实例连接失败怎么办
更新时间:2023-12-07 GMT+08:00

GaussDB(for MySQL)实例连接失败怎么办

  1. 报错信息:Access denied for user 'user_name'@'100.xxx.xx.xx' (using password: YES)。
    1. 报错原因:GaussDB(for MySQL)数据库用户名或密码不对。
      解决方法:请确认数据库用户名和密码是否正确,如果您不确认密码是否正确,可以在GaussDB控制台重置实例密码。

      修改密码可能会影响业务,请谨慎操作。

      如果确认账户名和密码正确,可以通过客户端或命令行工具登录数据库,执行select * from mysql.user where user = 'user_name'命令查看用户信息,如果存在100.%网段的用户,则DAS只能通过100.%网段的数据库用户去连接数据库。user_name @%与user_name @100.%是两个用户,其密码和权限都是独立的,请确认输入的密码是否是user_name @100.%用户的密码。

    2. 报错原因:DAS服务器的IP地址不在您输入用户的白名单中。
      解决方法:使用客户端或命令行工具登录到数据库,创建DAS可以访问的数据库用户。
      create user 'user_name'@'100.%' identified by 'password';
      grant all privileges on *.* to 'user_name'@'100.%';
      1. DAS服务器IP地址所在网段为100.%,请根据实际使用需要添加白名单。
      2. 请根据实际使用需要给user_name@100.%用户赋予权限。
  2. 报错信息: Trying to connect with ssl, but ssl not enabled in the server

    报错原因: 使用SSL用户登录,服务端没有开启SSL功能。

    解决方法:请执行如下语句查询用户是否是SSL用户,如果是,则在GaussDB(for MySQL)实例详情页面,将SSL开关打开。其中,ssl_type字段有值即表示此用户是SSL用户。

    select user, host, ssl_type from mysql.user where user = 'user_name';
  3. 报错信息: Client does not support authentication protocol requested by server. plugin type was = 'sha256_password'

    报错原因: DAS暂不支持密码的加密方式为sha256_password的数据库用户连接登录。

    解决方法:请执行如下语句将密码的加密方式改为mysql_native_password。

    alter user 'user_name'@'%' identified with mysql_native_password by 'password';
  4. 报错信息: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server

    报错原因: DAS服务器与实例网络不通。

    解决方法:请联系技术支持协助处理。

连接管理 所有常见问题

more