用VC来连接远程MYSQL时,出现如标题一样的错误,网上搜索了此错误产生的原因,最后自己找到了解决办法。

此错误产生的原因:

异常原因在于服务器端的密码管理协议陈旧,使用的是旧有的用户密码格式存储;但是客户端升级之后采用了新的密码格式。mysql5.6版本遇到这种不一致的情况就会拒绝连接。

详见mysql手册“Server Command Options”一节中“--secure-auth"选项的说明:http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth

解决方法思路两种:

1、服务器端升级启用secure_auth选项;

2、客户端连接时off掉secure_auth。

解决方法:

一般连接远程主机,修改服务器段显得不现实,这离给出在客户端的解决办法;

连接时,讲secure_auth参数设置为否,不使能即可;

命令行时:mysql -p10.51.1.11 -P3308 -uroot --secure_auth=off,

在VC编程中:

mysql_init(&mysql);//初始化

mysql.options.secure_auth=false; // 关闭secure_auth

vc++>>Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enable的更多相关文章

  1. ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

    mysql安全机制的问题 解决: mysql -P 3306 -h host -u account --secure_auth=off -pmysql -P 端口号 -h 主机地址 -u 账号 --s ...

  2. mysql问题Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)的解决方法

    在mysql命令行界面输入 mysql> set old_passwords=0;mysql> SET PASSWORD FOR hhds_test=PASSWORD('hhds_test ...

  3. mysql连接错误解决(ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled))

    当使用mysql的新版本是,连接老版本的mysql,就会有可能报: ERROR 2049 (HY000): Connection using old (pre-4.1.1) authenticatio ...

  4. Go丨语言对数据库操作报错 panic: dial tcp 127.0.0.1:3306: connectex: No connection could be made because the target machine actively refused it.

    panic: dial tcp 127.0.0.1:3306: connectex: No connection could be made because the target machine ac ...

  5. No connection could be made because the target machine actively refused it [::1]:808

    No connection could be made because the target machine actively refused it [::1]:808 1.首先查看端口占用情况, 在 ...

  6. k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?

    k8s坑The connection to the server localhost:8080 was refused - did you specify the right host or port ...

  7. pg_dump: [archiver (db)] connection to database “dbase” failed: FATAL: Peer authentication failed for user “postgres”

    "Peer authentication" means that it's comparing your database username against your Linux ...

  8. mysql: Error Codes and Messages

    Appendix B. Error Codes and MessagesTable of Contents B.1. Server Error Codes and MessagesB.2. Clien ...

  9. MYSQL之错误代码----mysql错误代码与JAVA实现

    原文地址:MYSQL之错误代码----mysql错误代码与JAVA实现作者:戒定慧 his chapter lists the errors that may appear when you call ...

随机推荐

  1. Excel顺序生成序号,不能有数字4出现

    A1填写:1 A2填写:=--SUBSTITUTE(A1+1,4,5) 然后下拉A3之后的单元格 需求应用场合:生成员工序号忌讳出现4的.

  2. java中与数据库的连接

    package unitl01; import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet; ...

  3. MySQL数据库权限操作指南

    -- 创建用户 CREATE USER 'dongrichtest' IDENTIFIED BY 'dongrichtest'; -- 新增后删除需要刷新权限 FLUSH PRIVILEGES; -- ...

  4. thinkphp 介绍

    一.ThinkPHP的介绍             MVC  M - Model 模型                工作:负责数据的操作  V - View  视图(模板)        工作:负责 ...

  5. 事件委托能够优化js性能

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. Python 中的map和reduce学习笔记

    map和reduce都是Python中的内置函数 map函数接受两个参数,第一个参数是函数,第二个参数是列表,将函数依次作用于列表中的元素,并返回一个元素 reduce同样以函数和列表作为参数,区别在 ...

  7. php curl

    这几天在帮一些同学处理问题的时候,突然发现这些同学是使用file_get_contents()函数来采集页面内容的,貌似都没有curl的概念亦或是对这种工具特别不敏感, 本文我来给大家详细介绍下cUR ...

  8. C#中页面之间跳转方法比较

    一直以来,各种跳转方法混用,浑浑噩噩没有仔细去了解过每个跳转方法的区别 1.<a herf="default.asp"></a>  超链接跳转 2.< ...

  9. ecshop后台分页浅析

      既然是分页,道理都是一样的,不过ecshop前台分页的函数和后台分页的函数不同,后台分页函数为page_and_size(),在admin/includes/lib_main.php里.都是用aj ...

  10. 关于unity中C#使用WaitForSeconds的方法

    //我有一段这样的代码,我要实现3秒后执行内容,JS是这样写的 function Update () { load (); } function load (){ //等待3秒执行语句 yield W ...