vs2010用C语言为什么连接不上mysql
MYSQL *mysql;
mysql=mysql_init(NULL);
if(!mysql_real_connect(mysql,"localhost","root","0412qwer","xs",3306,NULL,0))
 AfxMessageBox(_T("数据库连接失败"));
else
{AfxMessageBox(_T("数据库连接成功"));}
0

1个回答

1.首先检查一下是否启动了mysql的server服务器;
2.如果服务器启动了,再检查口令是否正确设置;
3.如果口令也设置正确,最后检查权限设置是否争取。

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么连接不上mysql
异常信息 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'add, cq, czzhzh, Dac, dqrq, hm, jgm, jxbz, jyrq, khrq, kzz, qxr, qxrrcye, sjyrq,' at line 1rnrnrn 表结构:rn [code=Java]rn DROP TABLE IF EXISTS `dlxmxdjb`;rn CREATE TABLE `dlxmxdjb` (rn `zh` varchar(30) NOT NULL DEFAULT '' COMMENT '子分户账户',rn `czzhzh` varchar(30) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '财政专户帐号',rn `sjzh` varchar(30) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '上级账户',rn `jgm` varchar(20) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '所属机构码',rn `hm` varchar(100) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '户名',rn `add` varchar(100) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '地址',rn `ye` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '余额',rn `zrye` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '昨日余额',rn `qxrrcye` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '起息日日初余额',rn `zjlb` char(2) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '开户证件类别',rn `zjh` varchar(20) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '开户证件号',rn `khrq` date DEFAULT NULL COMMENT '开户日期',rn `xhrq` date DEFAULT NULL COMMENT '销户日期',rn `jyrq` date DEFAULT NULL COMMENT '交易日期',rn `qxr` date DEFAULT NULL COMMENT '起息日',rn `jxbz` char(2) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '计息标志',rn `zhnll` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '账户年利率',rn `cq` char(2) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '账户存期',rn `dqrq` date DEFAULT NULL COMMENT '到期日期',rn `sjyye` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '上次交易余额',rn `sjyrq` date DEFAULT NULL COMMENT '上次交易日期',rn `kzz` char(100) CHARACTER SET gbk NOT NULL DEFAULT '' COMMENT '帐号控制字',rn `Dac` varchar(100) CHARACTER SET gbk NOT NULL DEFAULT ' ' COMMENT 'DAC',rn PRIMARY KEY (`zh`),rn UNIQUE KEY `Pindex_dlxmxdjb` (`zh`)rn ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='利息明细登记表';rn [/code]rnrn 网上查了一下 有一个和我出现了一样的错误 是因为字段中有MySQL的关键字 我找不到是哪一个
为什么连接不上MYSQL
第一次写PHP 即遇到困惑 郁闷rnrn以上程序运行时一片空白 什么都没有rn其他一般的PHP程序可以运行的rnrn发生了什么事??
用C语言连接mysql
Windows下 用C语言连接mysql
用c语言连接mysql
安装mysql,请自行百度 安装mysql.h函数库 sudo apt-get install libmysqlclient-dev执行之后就可以看到/usr/include/mysql目录了 然后开始我们的链接. 首先看我的数据库mysql> show databases; +--------------------+ | Database | +-------------
用java连接mysql为什么连接不上啊?
package wyf.fg;rnimport java.sql.*;rnpublic class queryData rn /**rn * @param argsrn */rn public static void main(String[] args) rn // TODO Auto-generated method stubrn Connection con=null;rn Statement stmt;rn ResultSet rs;rn String sqlString="select* from student";rn String sd;rn tryrn Class.forName("com.mysql.jdbc.Driver");rn con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");rn stmt=con.createStatement();rn rs=stmt.executeQuery(sqlString);rn while(rs.next())rn sd=rs.getString(1);rn System.out.println(sd);rn rn //System.out.print");rn catch(Exception e)rn e.printStackTrace();rn finallyrn tryrn con.close();rn catch(SQLException e)rn e.printStackTrace();rn rn rnrnrn不可以截图,就复制了下来,向大家帮帮忙啊,研究了几天了。。用的连接包也没有显示版本。。
Vs2010连接不上SQL2008
Vs2010连接SQL2008数据库时,总是sa登录失败.求教高手解决?
mysql 连接不上?
我的mysql 为什么连接不上呀?rn是我连本机器 本机IP:192。168。1。54rn user:rootrn pwd:空rn rn它提示我的错误代码1130:连接数据库失败,没有连接数据库的权限rn这是为什么呀?
连接不上MySql
用管理员身份运行PowerShell bash sudo service mysql status, 可以看到服务器状态已停止 sudo service mysql start
连接不上mysql
[root bin]#./mysqlrnERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
连接不上MySQL!!!!!!!!!
我的操作系统是WINDOWS 2K P,WEB服务器是APACHE+PHP+MySQL。以前使用一切正常,可是最近用APACHE调用PHP却连接不上MySQL服务器了,而用MySQL自带的客户端软件(mysql.exe)却可以正常使用,请问各位大虾如何解决???
MySQL连接不上
电脑还原后重装MySQL,重装时步骤可能和以前不太一样(端口变成了8089),数据库安装算是成功吧,MySQL数据库显示正常。但用以前的程序改端口连接不上了,不知什么原因,希望各路高手为我解题。rn[code=Java]The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2209)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:776)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)rn at java.sql.DriverManager.getConnection(DriverManager.java:582)rn at java.sql.DriverManager.getConnection(DriverManager.java:154)rn at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)rn at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)rn at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)rn at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)rn at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)rn at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)rn ... 26 morernCaused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure[/code]
mysql连接不上
mysql连接不上,日志中的错误信息:Can't open and lock privilege tables: Table 'mysql.host' doesn't exist,网上查了下可以将老的数据权限表复制到当前的数据目录,不过老的被删除了啊,请教各位有还有什么办法么,难道只能重装了?
vs2010 连接 oracle连接不上。
rn无论怎么设置C#连接oracle连接不上,rnrn如设置目标平台为x86.[img=https://img-bbs.csdn.net/upload/201610/22/1477109561_696441.jpg][/img]rn也试过设置为64位。rn依然提示rn“尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行,将出现此问题。”[img=https://img-bbs.csdn.net/upload/201610/22/1477109668_927403.jpg][/img]rnrn操作系统为win7 64位的系统。 oracle[img=https://img-bbs.csdn.net/upload/201610/22/1477109824_767813.jpg][/img]客户端为 64位的。 使用eclipse连接oracle是可以的。
为什么我的LINU下的MYSQL连接不上
我在Linux上安装了MYSQL 3.23.55。我运行了服务器程序,用PS命令也看到了服务器在运行中,可是我在Windows的客户端上却无法连接上数据库!请问这个是为什么呢?难道我没有安装正确?我是按照它的说明装的啊!
为什么我连接不上mysql?
-
连接不上服务器的MYSQL?为什么?WHY?
连接不上服务器的MYSQL?为什么?WHY?rnrn服务器里的DEDE站都连接没问题,localhost:3306的rnrn我在我本地写1个文件,链接到服务器上的MYSQL, XXX.XXX.XXX:3306rn链接不上,我想应该是MYSQL需要设置一下,请问怎么设置rnrnNAVCAT也链接不上
c语言连接mysql
c语言连接mysql
C语言连接Mysql
用于C语言与MySQL连接的详细文档,上面有VC与数据库连接的配置,很实用
C语言 之MySQL连接
测试环境: CentOS6.5(64位) MySQL(5.6) 第一步:CentOS 搭建MySQL 数据库 具体安装步骤请查考:CentOS6.5 源代码安装MySQL 第二步:编写C语言简单连接MySQL #include #include #include "/usr/local/mysql/include/mysql.h" int main(voi
C语言连接mysql
必要条件: 1.使用带MySQLConectionfor C/C++ 的MySQL安装包。 2.在项目属性中VC++目录,包含目录中选择mysql的include文件夹,库目录,选择mysql的lib文件夹,连接器输入的附加依赖项,增加libmysql.lib C代码里include头文件mysql.h,并且在之前要include头文件winsock.h MYSQL *pConn=mysq...
C语言连接 mysql
我有一组数据, 内容大概是 坐标,时间,距离rn然后想存进mysql中rn我安装了mysql后,从网上找了些代码,试着用C运行rn我将C connector下的头文件都放在了代码所在文件夹下,并且将include的方式改成了include "*.h"rn但是一直报错,说error synatx before ‘*’ tokenrn谁能告诉我怎么用C 连上mysql将坐标之类的数据存进去rn怎么解决这一溜排的 synatx error啊rn烦死了烦死了烦死了烦死了
为什么我用tomcat连接不上mysql的url
什么也写好的,但测试连接出现以下情况:rnÎҵIJâÊÔ¿ªÊ¼rnCannot create JDBC driver of class '' for connect URL 'null'rn另处我也用localhost方式连不上mysql如下:rnhttp://localhost:3306/rn但用localhost方式能连上tomcat:rnhttp://localhost:8080/
linux下用c语言实现与mysql的连接!!
在做学生信息管理系统~~!麻烦高手指点如何用c语言连接mysql数据库~~!!多谢!!~~
linux下用c语言连接mysql
linux下用c语言连接mysql,都是一些C语言连接在linux系统下连接mysql的代码
navicat连接不上mysql
我这有2个Mysql,一开始把mysql启动了,把端口占用了,其实应该启动mysql80 解决:百度搜索2059 https://blog.csdn.net/kwy15732621629/article/details/80059416 原因:8.0版本太高了 ...
Linux下连接不上MySQL
我用的是MySQL3.23.55,也装了Connector/J3.0,运行时tomcat显示”Server configuration denies access to data source”,可我已经把Connector中的jar文件放到了Tomcat下的/common/lib的下面,也执行了“grant all privileges on guest.* to root@localhost identified by [password];”,为什么呢?哪位能够指点迷津。
远程连接mySQL连接不上!
现象:在自己电脑可以连上,在自己电脑的虚拟机里面也可以连接上,但是程序拷贝到其他电脑上连接就连接不上,不知道问题出在哪里了,请高手指教:
PHP连接不上mysql
rnrn应该没什么问题吧,可是怎么一直报错,ACCESS DENIEDrnrn";rn$amount_sql = "SELECT MAX(PATH_ID) FROM pathwayrn LIMIT 1;";rn$result_amount = mysql_query($amount_sql);rn$pathway_array = mysql_fetch_assoc($result_amount);rn$pathway_amount = $pathway_array['PATH_ID'];rn?>rn下面为报错的内容!rnWarning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\pathway\colon bacillus system.php on line 36rnrnWarning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\pathway\colon bacillus system.php on line 36rnrnWarning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pathway\colon bacillus system.php on line 37
mysql一直连接不上
我昨天写的php还可以对mysql进行操作,今天重启电脑以后就一直显示unable to connectrn
hive连接不上mysql
请问hive连接mysql出现这个错误 是什么原因?rn[img=https://img-bbs.csdn.net/upload/201704/13/1492074653_934022.jpg][/img]
局域网连接不上mysql
我用Navicat连接局域网的mysql,出现错误:Host:192.168.1.240 is not allowed to connect to this mysql serverrn192.168.1.240 进入客户端,修改了mysql数据库中user表的user=root的host为%,还是不行。在我的电脑上telnet 192.168.1.240 3306 出现了一下错误:192.168.1.188 is not allowed to connect to this mysql serverrn失去了跟主机的联系。rnrnrn请问高手这个改怎么解决。我现在用Navicat连不上这个数据库了
phpmyadmin连接不上mysql
环境:windows2003+IIS6+mysql6+phpmyadmin10.1rnrnmysql已经安装好,并能在命令行下正常登录使用;rnrn rn显示有内容rnrn rn显示成功;rnrnrnrn但phpmyadmin出现以下结果:rn____________________________________________________________________rn欢迎使用 phpMyAdmin 2.10.1rnrnphpMyAdmin 试图连接到 MySQL 服务器,但服务器拒绝连接。您应该检查 config.inc.php 中的主机、用户名和密码,并且确定这些信息与 MySQL 服务器的管理员所给出的信息一致。rnrn错误rnMySQL 返回: rnrn#1045 - Access denied for user 'root'@'localhost' (using password: NO) rn____________________________________________________________________rnrn但config.inc.php我已经设置完了,填写都应该是正确的。rnrnrn rnrnrn
MySQL外网连接不上
遇到如上问题,一直以为是root帐号没有远程访问的权限。 可是修改了user表里面的root的Host为%并没有暖用。 找了很久原因,用netstat -tunlp命令看了下监听的端口情况 发现: tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      8954/mysqld
(急)mySQL连接不上?
调试程序时出现了下面的问题:(MySQL服务是启动了的)rnrnrnWarning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in D:\MYOA\webroot\liuyanban\index.php on line 2rnrnWarning: mysql_select_db() [function.mysql-select-db]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 3rnrnWarning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 3rnrnWarning: mysql_query() [function.mysql-query]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 4rnrnWarning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 4rnrnWarning: mysql_query() [function.mysql-query]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 6rnrnWarning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 6rnrnWarning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\MYOA\webroot\liuyanban\index.php on line 7rn
php连接不上mysql
使用下面语句测试,结果浏览器什么也不显示rnrn';rnif(mysqli_connect_errno())rnrn echo "连接失败";rnrnrnelsern echo "连接成功";rn$link->close();rn?>rnrn
eclpise连接不上mysql
七月 25, 2017 5:33:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule beginn警告: [SetPropertiesRule]Server/Service/Engine/Host/Context Setting property 'source' to 'org.eclipse.jst.jee.server:1' did not find a matching property.n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Server version: Apache Tomcat/9.0.0.M21n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Server built: May 4 2017 22:42:36 UTCn七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Server number: 9.0.0.0n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: OS Name: Windows 10n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: OS Version: 10.0n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Architecture: x86n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Java Home: C:\Program Files\Java\jre1.8.0_131n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: JVM Version: 1.8.0_131-b11n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: JVM Vendor: Oracle Corporationn七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: CATALINA_BASE: E:\Java 项目\.metadata\.plugins\org.eclipse.wst.server.core\tmp0n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: CATALINA_HOME: F:\java web\apache-tomcat-9.0.0.M21n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Command line argument: -Dcatalina.base=E:\Java 项目\.metadata\.plugins\org.eclipse.wst.server.core\tmp0n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Command line argument: -Dcatalina.home=F:\java web\apache-tomcat-9.0.0.M21n七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Command line argument: -Dwtp.deploy=E:\Java 项目\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebappsn七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Command line argument: -Djava.endorsed.dirs=F:\java web\apache-tomcat-9.0.0.M21\endorsedn七月 25, 2017 5:33:54 下午 org.apache.catalina.startup.VersionLoggerListener logn信息: Command line argument: -Dfile.encoding=UTF-8n七月 25, 2017 5:33:54 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEventn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/client;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Java\jdk1.8.0_131\bin;C:\Program Files\Java\jdk1.8.0_131\jre\bin;F:\eclipse;;.]n七月 25, 2017 5:33:54 下午 org.apache.coyote.AbstractProtocol initn信息: Initializing ProtocolHandler ["http-nio-8181"]n七月 25, 2017 5:33:55 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelectorn信息: Using a shared selector for servlet write/readn七月 25, 2017 5:33:55 下午 org.apache.coyote.AbstractProtocol initn信息: Initializing ProtocolHandler ["ajp-nio-8009"]n七月 25, 2017 5:33:55 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelectorn信息: Using a shared selector for servlet write/readn七月 25, 2017 5:33:55 下午 org.apache.catalina.startup.Catalina loadn信息: Initialization processed in 1874 msn七月 25, 2017 5:33:55 下午 org.apache.catalina.core.StandardService startInternaln信息: Starting service [Catalina]n七月 25, 2017 5:33:55 下午 org.apache.catalina.core.StandardEngine startInternaln信息: Starting Servlet Engine: Apache Tomcat/9.0.0.M21n七月 25, 2017 5:33:55 下午 org.apache.coyote.AbstractProtocol startn信息: Starting ProtocolHandler ["http-nio-8181"]n七月 25, 2017 5:33:55 下午 org.apache.coyote.AbstractProtocol startn信息: Starting ProtocolHandler ["ajp-nio-8009"]n七月 25, 2017 5:33:55 下午 org.apache.catalina.startup.Catalina startn信息: Server startup in 920 msnjava.lang.ClassNotFoundException: com.mysql.jdbc.Drivern at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)n at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1109)n at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:123)n at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:60)n at java.lang.Class.forName0(Native Method)n at java.lang.Class.forName(Unknown Source)n at org.apache.jsp.AddBook_jsp._jspService(AddBook_jsp.java:137)n at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)n at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)n at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)n at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)n at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)n at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)n at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)n at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)n at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1366)n at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)n at java.lang.Thread.run(Unknown Source)n
python2 连接不上MySQL
import MySQLdbrnimport osrnimport sysrnreload(sys)rnsys.setdefaultencoding('utf-8')rnrnconn=MySQLdb.connect(host="127.0.0.1",port=3306,user="root",passwd="697090",db="traffic",charset="utf8")rnrnrnOperationalError Traceback (most recent call last)rn in ()rn 1 rn----> 2 conn=MySQLdb.connect(host="127.0.0.1",port=3306,user="root",passwd="697090",db="traffic",charset="utf8")rnrnD:\softsetup\Anaconda2\lib\site-packages\MySQLdb\__init__.pyc in Connect(*args, **kwargs)rn 79 """Factory function for connections.Connection."""rn 80 from MySQLdb.connections import Connectionrn---> 81 return Connection(*args, **kwargs)rn 82 rn 83 connect = Connection = ConnectrnrnD:\softsetup\Anaconda2\lib\site-packages\MySQLdb\connections.pyc in __init__(self, *args, **kwargs)rn 191 autocommit = kwargs2.pop('autocommit', False)rn 192 rn--> 193 super(Connection, self).__init__(*args, **kwargs2)rn 194 self.cursorclass = cursorclassrn 195 self.encoders = dict([ (k, v) for k, v in conv.items()rnrnOperationalError: (1251, 'Client does not support authentication protocol requested by server; consider upgrading MySQL client')rn
本机的mysql连接不上?
本机的mysql数据库已建好,服务也开了,可是用下面的代码连接却失败,请问是什么原因?rn rn Class.forName("com.mysql.jdbc.Driver");rn Connection con1=DriverManager.getConnection("jdbc:mysql://localhost:3306/cel","root","");rnrn运行时抛出这个异常:java.sql.SQLException: Communication link failure: Bad handshakernrnrn
MySQL总是连接不上
MySQL 4.1.13+win2003+apache2+php rn 数据库总是出现连接不上的,运行SHOW STATUS语句 Connections 的值一直在增加,max_Connections已经改到最大了,mysql错误提示:mysql服务器挂起,wait timeout值为3600!rn请问有没有遇到同样情况的朋友,请达人赐教!
连接Mysql数据库连接不上?
On Error GoTo err1rn Dim GConn As ADODB.Connectionrn Set GConn = New ADODB.Connectionrn Dim lRs As ADODB.Recordset '数据库记录集对象rn Set lRs = New ADODB.Recordsetrn rn GConn.CursorLocation = adUseClientrn GConn.ConnectionString = "DRIVER=MySQL ODBC 3.51 Driver;SERVER=localhost; DATABASE=test;UID=root;PWD=123456; OPTION=3"rnrn GConn.Openrnrn MsgBox "连接成功"rn exit subrnErr1rn MsgBox "连接失败"rnrnrn会出现 [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序rnrn请问是否是我安装的mysql中,没有安装它的直接连接数据库的驱动程序rn我在ODBC中,想添加一个ODBC,但确实没有发现它有任何带有mysql之类的字符串rn请问如何解决这个问题?谢谢!