hive连接mysql 报错 readonly server 50C

各位大侠,我搭建了一个hadoop环境,用hive做数据仓库,mysql做hive的元数据仓库,用于定时分析用户数据中的日志文件,但在hive访问mysql的过程中,不定时的报如下错误:

java.sql.SQLException: Query returned non-zero code: 1, cause: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: Could not retrieve transation read-only status server
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:451)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:732)
at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:752)
at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:784)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
at com.sun.proxy.$Proxy0.createTable(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1374)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1407)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:102)
at com.sun.proxy.$Proxy10.create_table_with_environment_context(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_environment_context(HiveMetaStoreClient.java:1884)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_table_with_environment_context(SessionHiveMetaStoreClient.java:96)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:607)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:595)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:90)
at com.sun.proxy.$Proxy11.createTable(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:670)
at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3959)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:295)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1604)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1364)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1177)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:197)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:644)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:628)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
NestedThrowablesStackTrace:
java.sql.SQLException: Could not retrieve transation read-only status server
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:997)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:983)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:928)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:949)
at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3967)
at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3938)
at com.jolbox.bonecp.ConnectionHandle.isReadOnly(ConnectionHandle.java:867)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:422)
at org.datanucleus.store.rdbms.valuegenerator.TableGenerator.createRepository(TableGenerator.java:270)
at org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator.obtainGenerationBlock(AbstractRDBMSGenerator.java:162)
at org.datanucleus.store.valuegenerator.AbstractGenerator.obtainGenerationBlock(AbstractGenerator.java:197)
at org.datanucleus.store.valuegenerator.AbstractGenerator.next(AbstractGenerator.java:105)
at org.datanucleus.store.rdbms.RDBMSStoreManager.getStrategyValueForGenerator(RDBMSStoreManager.java:2005)
at org.datanucleus.store.AbstractStoreManager.getStrategyValue(AbstractStoreManager.java:1386)
at org.datanucleus.ExecutionContextImpl.newObjectId(ExecutionContextImpl.java:3827)
at org.datanucleus.state.JDOStateManager.setIdentity(JDOStateManager.java:2571)
at org.datanucleus.state.JDOStateManager.initialiseForPersistentNew(JDOStateManager.java:513)
at org.datanucleus.state.ObjectProviderFactoryImpl.newForPersistentNew(ObjectProviderFactoryImpl.java:232)
at org.datanucleus.ExecutionContextImpl.newObjectProviderForPersistentNew(ExecutionContextImpl.java:1414)
at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2218)
at org.datanucleus.ExecutionContextImpl.persistObjectWork(ExecutionContextImpl.java:2065)
at org.datanucleus.ExecutionContextImpl.persistObject(ExecutionContextImpl.java:1913)
at org.datanucleus.ExecutionContextThreadedImpl.persistObject(ExecutionContextThreadedImpl.java:217)
at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:727)
at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:752)
at org.apache.hadoop.hive.metastore.ObjectStore.createTable(ObjectStore.java:784)
at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:98)
at com.sun.proxy.$Proxy0.createTable(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1374)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1407)
at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:102)
at com.sun.proxy.$Proxy10.create_table_with_environment_context(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.create_table_with_environment_context(HiveMetaStoreClient.java:1884)
at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.create_table_with_environment_context(SessionHiveMetaStoreClient.java:96)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:607)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:595)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:90)
at com.sun.proxy.$Proxy11.createTable(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:670)
at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3959)
at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:295)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1604)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1364)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1177)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:197)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:644)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:628)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

在网上查询说是mysql驱动包的问题,但更新了mysql驱动之后,依然还是会报这个错误,

有时候能执行成功,有时候执行不成功,不知道各位大侠谁遇到过类似的问题!

5个回答

参考hive 0.13.1 安装指导

问题描述:
执行创建数据库时抛出如下错误:Could not retrieve transation read-only status server

解决方法:
问题原因 是javax.jdo.option.ConnectionURL中配置的数据库名有问题不能配置为hive修改为hive_metadata就ok了

我改过了,目前数据库名称已经为hive_metadata了,但还是报相同的错误,还有其他的问题么,跟各服务器的版本有关系么?

数据库用户权限对不对啊?

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 这个地方其实是没有重试
在jdbc后面加这个
characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
hive连接mysql报错
今天遇到一个问题,执行hive无法连接mysql。纠结好久,各种查找无果。后来发现mysql没有启动!!! service mysqld status mysqld is stopped 启动mysql 成功连接 [root@min1 ~]# service mysqld start Starting mysqld: ...
【报错总结】Hive连接MySQL报错
Hive连接MySQL数据库时的报错及解决方案。
hive安装及连接MySQL
要在hive和MySQL之间建立连接,首先Linux里要有它们一、首先进入MySQL官网下载所需的MySQL yum 仓库:1.下载好之后,就将它上传至Linux中2.接下来运行( rpm -Uvh  mysql57-community-release-el7-11.noarch.rpm)上一步结束后,紧接着安装mysql (yum install mysql-community-server -...
Hive的安装配置和连接mysql
一、基础介绍 Hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件(存储在hdfs中)映射为一张数据库表,并提供类SQL查询功能,通过使用hive的sql脚本来操作数据(hql),本质是将SQL转换为MapReduce程序 。 它包括解释器(把脚本解释成java代码),编译器(编译java代码,其实就是mapreduce代码,提交到hadoop),优化器等。 hive运行时,
Mysql连接报错:out of sync with server
在连接测试的时候,报了一个"out of sync with server"的错,rnrn在进行一次连接测试,报"only byte lengths of 2,4,8 ... is supported"的错rnrn这个该怎么解决?
mysql数据库更新报错,提示readonly,问题分析
项目背景:spring+mybatis,多数据源,T(T1,T2),P(P1,P2),R(R1,R2),其中1表示主库,2表示从库,使用Spring的AbstractRoutingDataSource在主从之间进行切换 最近在查看请求日志时,发现对数据库P1的一个update操作,提示数据库是只读的,错误提示: Error updating database. Cause: java.sql.SQ
Java连接hive报错01
这个错误是hive的版本的包导致的。java.sql.SQLException: Could not establish connection to jdbc:hive2://hadoop2:10000/default: Required field 'serverProtocolVersion' is unset! Struct:TOpenSessionResp(status:TStatus(st
kettle连接hive报错问题
错误连接数据库 [hive2] : org.pentaho.di.core.exception.KettleDatabaseException:  Error occurred while trying to connect to the database Error connecting to database: (using class org.apache.hive.jdbc.Hive...
hive 配置mysql数据库连接报错
FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user 'root'@'hadoop' (using password: YES)rnNestedThrowables:rnjava.sql.SQLException: Access denied for user 'root'@'hadoop' (using password: YES)rnFAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTaskrn
启动hive时 mysql报错
异常 1.启动hive时  mysql报错 java.sql.SQLException: Access denied for user 'hadoop'@'master' (using password: YES)
squirrel-可以连接Hive、mysql
一款可以连接Hive,Mysql等等的数据库可视化工具,由于完全是用Java开发的客户端,安装的时候需要用命令行来安装: java -jar squirrel-sql-3.9.0-standard.jar
hive连接不上mysql
请问hive连接mysql出现这个错误 是什么原因?rn[img=https://img-bbs.csdn.net/upload/201704/13/1492074653_934022.jpg][/img]
安装hive,并连接mysql
安装hive:将hive文件传输到Linux中hadoop用户目录下,然后将其解压至opt目录中解压好后进入其目录中,在一个conf目录下找到hive-default.xml.template这个文件,将其复制并改名为hive-site.xml后进入修改 配置元数据库地址找name  改value第一个:(找不到的话就按n)/javax.jdo.option.ConnectionURLjdbc:m...
【Hive】连接Windows上的MYSQL
hive连接mysql有两种办法:a 在linux虚拟机里安装一个mysql数据库                                              b 用windows的mysql 如何连接windows上的MYSQL A 关闭windows的防火墙(或者对MYSQL服务添加白名单) B 启动MYSQL服务 B 修改windows下mysql的访问权限,使用...
shell脚本配置hive连接mysql
脚本外已经安装好了的MySQL数据库并设置了用户名和密码,导入了jdbd的罐子包,初始化了蜂巢-site.xml中配置文件,本脚本可使没有相关经验的人也能进行“傻瓜式”的安装 脚本思路分两步: 如图1所示,根据输入的用户名密码自动修改蜂房-site.xml中配置文件参数 2,脚本内运行蜂房,并检查的MySQL中是否存在蜂巢元数据库对应的表,判断后直接返回成功或者失败的汉字标识     r...
报错:1130-host MySql server
报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用l
jsp 连接mysql报错
myeclipse报错rnrn严重: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.rn2010-5-20 14:35:20 org.apache.catalina.loader.WebappClassLoader clearReferencesStopTimerThreadrn严重: A web application appears to have started a TimerThread named [MySQL Statement Cancellation Timer] via the java.util.Timer API but has failed to stop it. To prevent a memory leak, the timer (and hence the associated thread) has been forcibly cancelled.rnrnrn请问这是怎么回事?但是我能够正常存取数据库rnrnrnrn我用的代码为:rn[code=Java]rnpublic class Dbunit rnrn private static Connection conn = null;rn private static Statement state = null;rn private static ResultSet rst = null;rnrn rn public static void addunit(Testunit t) rn try rn conn = getConnection();rn state = conn.createStatement();rn String sql = "insert into _unit values("+t.getNum()+",'"+t.getName()+"','"+t.getAdd()+"'," +rn "'"+t.getGetdate()+"','"+t.getSenddate()rn +"',"+t.getCost()+",'"+t.getAcceptor()+"','"+t.getAcceptdate()+"')";rn //System.out.println(sql);rn state.executeUpdate(sql);rn catch (Exception e) rn e.printStackTrace();rn finally rn try rn state.close();rn conn.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rnrn public static ArrayList lookforTestunits(String sql) rnrn ArrayList a = new ArrayList();rnrn try rnrn conn = getConnection();rn state = conn.createStatement();rn // String o="select * from person where pname like '%"+s+"%'";rn rst = state.executeQuery(sql);rn //System.out.println(sql);rnrn while (rst.next()) rn Testunit p = new Testunit();rn p.setAcceptdate(rst.getString("acceptdate"));rn p.setAcceptor(rst.getString("acceptor"));rn p.setAdd(rst.getString("unitadd"));rn p.setCost(rst.getFloat("testcost"));rn p.setGetdate(rst.getString("date0"));rn p.setName(rst.getString("unitname"));rn p.setNum(rst.getInt("unitcardno"));rn p.setSenddate(rst.getString("date1"));rn rn a.add(p);rn // System.out.println(p.getTitle() + " " + p.getCont());rn rnrn rnrn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn try rn rst.close();rn state.close();rn conn.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rnrn rnrn return a;rnrn rnpublic static Connection getConnection() rn Connection conn = null;rn String driverName = "com.mysql.jdbc.Driver";rn String userName = "root";rn String userPasswd = "mysql";rn String dbName = "sampletest";rn // String tableName="person";rn String port = "3306";rn String url = "jdbc:mysql://localhost:" + port + "/" + dbName + "?user="rn + userName + "&password=" + userPasswdrn + "&useUnicode=true&characterEncoding=utf-8";//rn try rn Class.forName("com.mysql.jdbc.Driver").newInstance();rn conn = DriverManager.getConnection(url);rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return conn;rn rnrnrn[/code]rnrnrn
mysql 连接报错
MySQL 8.0.11 error connect to caching_sha2_password the specified module could not be found ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
eclipse连接mysql报错
在连接数据库的测试过程中报错,不知道该怎么解决?rn错误: 找不到或无法加载主类 jdbc.sqltest
MySQL 连接报错
错误信息:rnERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)rnrn
连接mysql报错
2010-9-17 14:41:17 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performancrne in production environments was not found on the java.library.path: D:\tomcat6jrndk6mysql51\tomcat6jdk6mysql5\tomcat-6.0.16-asso\jdk1.6\jre\bin;.;C:\WINDOWS\Sun\rnJava\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\tomcat6jdk6mysql51\tomcat6jdk6mysql5\rntomcat-6.0.16-asso\jdk1.6\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32rn\Wbemrn2010-9-17 14:41:17 org.apache.coyote.http11.Http11Protocol initrn信息: Initializing Coyote HTTP/1.1 on http-8081rn2010-9-17 14:41:17 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 715 msrn2010-9-17 14:41:18 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2010-9-17 14:41:18 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/6.0.16rnlog4j:WARN No appenders could be found for logger (consult.util.HibernateThreadFrnilter).rnlog4j:WARN Please initialize the log4j system properly.rnlog4j:WARN No appenders could be found for logger (consult.util.HibernateThreadFrnilter).rnlog4j:WARN Please initialize the log4j system properly.rnnull邮件服务启动失败.rn2010-9-17 14:41:34 org.apache.catalina.core.StandardContext addApplicationListenrnerrn信息: The listener "org.springframework.web.context.ContextLoaderListener" is alrnready configured for this context. The duplicate definition has been ignored.rn2010-9-17 14:41:41 org.apache.coyote.http11.Http11Protocol startrn信息: Starting Coyote HTTP/1.1 on http-8081rn2010-9-17 14:41:41 org.apache.jk.common.ChannelSocket initrn信息: JK: ajp13 listening on /0.0.0.0:8018rn2010-9-17 14:41:41 org.apache.jk.server.JkMain startrn信息: Jk running ID=0 time=0/31 config=nullrn2010-9-17 14:41:41 org.apache.catalina.startup.Catalina startrn信息: Server startup in 23163 msrnselect distinct(a.userid),a.userno,username,a.pwd from sys_users a where usernrno='admin'rncom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character setrn: 'macce'rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rnrn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructrnorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCrnonstructorAccessorImpl.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.Util.getInstance(Util.java:381)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)rn at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)rn at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionIrnmpl.java:1751)rn at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImprnl.java:3425)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2045)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:718)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rnrn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructrnorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCrnonstructorAccessorImpl.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:302)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.javarn:282)rn at java.sql.DriverManager.getConnection(DriverManager.java:582)rn at java.sql.DriverManager.getConnection(DriverManager.java:185)rn at com.Hwsoft.oa.util.DbUtil.openConnection(DbUtil.java:19)rn at com.Hwsoft.oa.util.BaseDao.queryOne(BaseDao.java:116)rn at com.Hwsoft.oa.dao.impl.sys.UserDaoImpl.checkLogin(UserDaoImpl.java:10rn1)rn at com.Hwsoft.oa.servlet.Login.doPost(Login.java:75)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:206)rn at com.Hwsoft.oa.filter.EncodingFilter.doFilter(EncodingFilter.java:25)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplrnicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFrnilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVrnalve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVrnalve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jrnava:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jrnava:102)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:rn568)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValrnve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.javrna:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.javarn:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.procernss(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44rn7)rn at java.lang.Thread.run(Thread.java:619)rnrn这是我连接mysql数据库用户名密码登陆时报的错,请问是什么原因我是用ssh做的
EF连接MYSQL报错
我调了半天 实在调不出来了rn[img=https://img-bbs.csdn.net/upload/201411/04/1415115556_27129.png][/img]rnContext出错rnrn[code=html]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn[/code]
asp连接mysql 报错
下面的一段代码报如下错误,望高人指点迷津rnrnMicrosoft VBScript 编译器错误 error '800a0409' rnrn未结束的字符串常量 rnrn/kwj/connmysql.asp, line 9rnrnrnrnrnrn  MySQL连接测试rn  rnrnrn  rn <% rn strconnection="dsn=mysqltest;rn  Driver=MySQL ODBC 5.1 Driver;rn  server=localhost;uid=root;pwd=root;database=test"rn rn rn  set conn = server.createobject("adodb.connection") rn  conn.open strconnectionrn  sql = "select * from user"rn  set rs = conn.execute(sql) rn  if not rs.bof then rnrn %>rnrn  rn  rn   namern   sexrn  rn <% rn  do while not rs.eof rn %> rn  rn   <%=rs("name")%> rn   <%=rs("sex")%> rn  rn <% rn   rs.movenext rn  loop rn %> rn  rnrn <% rn  else rn   response.write("sorry, no data found.") rn  end if rn  rs.close rn  conn.close rn  set conn = nothing rn  set rs = nothing rn %>rnrnrn
Navicat连接MySQL报错
Navicat连接MySQL报错:client does not support authentication protocol requested by server;consider upgrading MySQL client.的解决记录: 1、打开 2、输入命令如下: 第一步:输入use mysql; 第二步:输入alter user 'root'@'localhost' iden...
hibernate连接mysql报错
环境hibernate4.1.2,mysql5.0.8rnrn我的mysql地址是没有错的,我简单的用JDBC测试过地址,但是配到hibernate.cfg.xml一运行就说我地址错误,请各位大侠帮忙解决问题谢谢..rnrnhibernate.cfg.xml配置rnrnrnrn rn rn com.mysql.jdbc.Driverrn jdbc:mysql://localhost/hibernatern rootrn rootrnrn rn 1rnrn rn org.hibernate.dialect.MySQLDialectrnrn rn rn org.hibernate.cache.internal.NoCacheProviderrnrn rn truernrn rn rnrnrnrnrn错误信息:rnERROR: No suitable driver found for jdbc:mysql://localhost/hibernaternException in thread "main" org.hibernate.exception.JDBCConnectionException: Could not open connectionrn at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131)rn at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)rn at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)rn at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)rn at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)rn at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)rn at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)rn at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)rn at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1363)rn at Test.main(Test.java:23)rnCaused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/hibernatern at java.sql.DriverManager.getConnection(DriverManager.java:602)rn at java.sql.DriverManager.getConnection(DriverManager.java:154)rn at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:192)rn at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:278)rn at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297)rn ... 5 morern
Hibernate连接Mysql报错
21:18:11,781 ERROR DriverManagerConnectionProvider:88 - JDBC Driver class not found: com.mysql.jdbc.jdbcDriverrnjava.lang.ClassNotFoundException: com.mysql.jdbc.jdbcDriverrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)rn at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)rn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Class.java:169)rn at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)rn at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)rn at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137)rn at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:79)rn at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:425)rn at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)rn at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)rn at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)rn at com.lyc.sql.LoginSQl.login(LoginSQl.java:18)rn at com.lyc.Action.LoginAction.execute(LoginAction.java:26)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)rn at java.lang.Thread.run(Thread.java:619)rn21:18:11,796 INFO DriverManagerConnectionProvider:170 - cleaning up connection pool: nullrnrn 我已经倒入驱动包 驱动包用JDBC连接数据库 无问题!rn
navicat连接mysql报错
转载请标明出处:https://blog.csdn.net/weixin_41965979/article/details/80819740 本文出自付付讶的博客 解决办法; 1:进入mysql的client-Unicode 2:输入你安装mysql时配置的密码 3:然后输入ALTER USER fu@localhost IDENTIFIED WITH mysql_native_p...
Java连接Mysql报错
Java连接Mysql报错集锦 一.错误: 1.Error:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 2.Cause:数据库连接的jar包没有正确的导入: 3.Solution: 1、没有导入包 2、导入的包的路径是不对的 就是将mysql的jar包放到你的lib目录下就可以了,可以通过build ...
druid连接mysql报错
Wed Mar 28 09:36:31 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.rn三月 28, 2018 9:36:31 上午 com.alibaba.druid.pool.DruidDataSource errorrn严重: create connection SQLException, url: jdbc:mysql://localhost:3306/blog, errorCode 1045, state 28000rnjava.sql.SQLException: Access denied for user '13760'@'localhost' (using password: YES)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)rn at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)rn at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205)rn at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2236)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2035)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:790)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)rn at sun.reflect.GeneratedConstructorAccessor18.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:423)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)rn at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1513)rn at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578)rn at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466)
连接远程mysql报错
10060:远程防火墙未关闭 临时关闭防火墙:serviceiptablesstop serviceip6tablesstop 永久关闭防火墙:chkconfigiptablesoff ...
qt 连接mysql报错
我用QSQLITE驱动连接mysql时,报错下面的错,但是我用terminal时候却是ok的(最下面)。rnrnnear "SHOW":syntax error Unable to execute statement.rnrn------------------------------------ 程序 ---------------------------------------rn[code=C/C++]rn QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");rnrnrn db.setHostName("incam1");rn db.setDatabaseName("film_log");rn db.setPort(3306);rn db.setUserName("foundercam");rn db.setPassword("incam1");rn if(!db.open())rn rn QMessageBox::critical(this,tr("database error"),db.lastError().text(),QMessageBox::Ok);rn return;rn rnqDebug() << db.isValid();rn qDebug() << db.database();rnrn QSqlQuery query;rn//query.exec("SELECT job_name FROM 2010ldi");rn query.exec("SHOW DATABASES");rnrn if(!query.isActive())rn rn QMessageBox::critical(this,tr("database error"),query.lastError().text(),QMessageBox::Ok);rn return;rn rnrn while(query.next())rn rn QString line = query.value(1).toString();rn qDebug() << "line" << line;rn rn[/code]--------------------------------------------------------------------------rn------------------------- terminal -------------------------------rnWelcome to the MySQL monitor. Commands end with ; or \g.rnYour MySQL connection id is 28rnServer version: 5.0.45 Source distributionrnrnCopyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.rnThis software comes with ABSOLUTELY NO WARRANTY. This is free software,rnand you are welcome to modify and redistribute it under the GPL v2 licensernrnType 'help;' or '\h' for help. Type '\c' to clear the current input statement.rnrnmysql> show databases;rn+--------------------+rn| Database |rn+--------------------+rn| information_schema |rn| film_log |rn| mysql |rn| test_db |rn+--------------------+rn4 rows in set (0.00 sec)rnrnmysql> rn
连接MySql报错
[img=https://img-bbs.csdn.net/upload/201905/15/1557908895_541693.jpg][/img]
linux 连接mysql报错
各位大侠救救我哦,搞了一天了,火大!rn报错:rn/tmp/ccKxvD8n.o(.text+0x22): In function `main':rn: undefined reference to `mysql_init'rn/tmp/ccKxvD8n.o(.text+0x6f): In function `main':rn: undefined reference to `mysql_real_connect'rn/tmp/ccKxvD8n.o(.text+0xa8): In function `main':rn: undefined reference to `mysql_close'rncollect2: ld returned 1 exit statusrn网上查了下,感觉都对的,不知道为何,我的编译命令如下rn gcc -o testMysql -lmysqlclient -lz -I /usr/include/mysql/ -L /usr/lib/mysql/ testMysql.crn用的是mysql 5.0.22 server,clent 和develrn程序是exc用户的rnmysql是root用户下的rn我将程序改成root用户的运行编译还是不行rn对应的目录均安装正确我已检查过了rn程序如下:rnrn#include rn#include rn#include rnint main(int argc,char * argv[])rn MYSQL * conn_ptr;rn conn_ptr=mysql_init(NULL);rn if(!conn_ptr)rn fprintf(stderr,"mysql_init failed\n");rn return EXIT_FAILURE;rn rn conn_ptr=mysql_real_connect(conn_ptr,"192.168.240.101","tianjin","tianjin","tjdb2",0,NULL,0);rn if(conn_ptr)rn printf("connection success\n");rn elsern printf("connection failed\n");rn rn mysql_close(conn_ptr);rn return EXIT_SUCCESS;rnrn rn rnrnrn
【mysql】连接报错
mysql运行报The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone 解决方法: 运行语句:set GLOBAL time_zone='+8:00';
web工程下连接mysql 报错!!!!!!
环境: rn MyEclipse6.0,Tomcat6.0,MySQL5.0 自己测试东西,客户端和服务端都在本机 数据库也在本机rn我的web工程发布后,页面不能操作数据库,注意是连接正常,是不能做操作。我在程序里添加了一个main方法后在控制台运行 没有任何问题。rnrn我的语句:rn         conn = DBUtil.getConnection();rnrn String sql = "select * from student";rn System.out.println(sql);rn try rn PreparedStatement pstmt = conn.prepareCall(sql);  ///////这里出错了rn // set valuesrn pstmt.setString(1, username);rn pstmt.setString(2, password);rnrn ResultSet rs = pstmt.executeQuery();rnrn // 判断rn if (rs.next()) rn login = true;rn rnrn pstmt.close();rn catch (SQLException e) rn e.printStackTrace();rn //System.out.println(e.getMessage());rn finally // set nothingrn if (conn != null) rn try rn conn.close();rn catch (SQLException e) rn e.printStackTrace();rn rn rn rnrnweb访问时报的错误是:   (如果我是查询就 报: "table.student" does not exist )rnrn   com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: FUNCTION * does not existrn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)rn at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)rn at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)rn at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)rn at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1269)rn at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)rn at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)rn at com.mysql.jdbc.CallableStatement.(CallableStatement.java:453)rn at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)rn at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)rn at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)rn at com.bobo.student.dao.StudentManager.checkUser(StudentManager.java:28)rn at com.bobo.student.web.LoginCheck.doPost(LoginCheck.java:28)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)rn at java.lang.Thread.run(Unknown Source)rnrn我在main中测试 :DBUtil.getConnection().createStatement().execute("select * from student");  rn没有任何问题!!!!所以我觉得应该不时驱动问题!! 我坛子里也逛了 好像说是什么MYSQL权限问题!!!rn
连接 mysql 报错
连接mysql报错如下:rnrnMySQLDriverCS.MySQLException: MySQLDriverCS Exception: rnMySQLDriverCS Error: can't connect.Access denied for user: 'ODBC@localhost' (Using password: NO)rnrnapp.cofig:rn[code=C#]rnrnrn rn rn rn rn rn rnrn[/code]rnrn本机使用 url 测试过localhost 和127.0.0.1 都报错。rnrn程序中的调用如下:rn[code=C#]rnstring url = System.Configuration.ConfigurationManager.AppSettings["url"];rn string database = System.Configuration.ConfigurationManager.AppSettings["database"];rn string uname = System.Configuration.ConfigurationManager.AppSettings["uname"];rn string psd = System.Configuration.ConfigurationManager.AppSettings["psd"];rnrnSqlConnection conn = new SqlConnection(@"data source= rn " + url + ";uid=" + uname + ";pwd=" + psd + ";database=" + database);rn conn.Open();rn[/code]rn
DBlinq 连接MySql 报错!
UserSystem us1 = new UserSystem();rn us1.UsID = 4;rn us1.UsName = "呵呵呵额";rn ticket.UserSystem.InsertOnSubmit(us1);rn ticket.SubmitChanges();rn rnrn这只是一个测试用的数据,但是当执行到:ticket.SubmitChanges();时 报错rnrnrn无法将类型为“MySql.Data.MySqlClient.MySqlTransaction”的对象强制转换为类型“System.Data.Common.DbTransaction”rnrn怎样解决,问题很急
JSP连接mysql报错
代码如下rn<%@ page language="java" contentType="text/html; charset=GB2312"rn pageEncoding="ISO-8859-1"%>rnrn<%@ page import="java.io.*" %>rn<%@ page import="java.util.*" %>rn<%@ page import="java.sql.DriverManager" %>rn<%@ page import="java.sql.*" %>rn<%@ page import="com.mysql.jdbc.Driver" %>rnrnrnrn rn dbaccess.jsprnrnrn<%rntryrn Connection con;rn Statement stmt;rn ResultSet rs;rn Class.forName("com.mysql.jdbc.Driver");rn DrvierManager.registerDriver(new com.mysql.jdbc.Drvier());rn String dbUrl=rn "jdbc:mysql://localhost:3306/bookdb?userUnicode=true&characterEncoding=GB2312";rn String dbUser="root";rn String dbPwd="123456";rn con = java.sql.DriverManager.getConnection(dbUrl,dbUser,dbPwd);rn //创建一个SQL声明rn stmt = con.createStatement();rn //增加新记录rn stmt.executeUpdate("insert into BOOKS (ID,NAME,TITLE,PRICE) values('999','Tom','Tomcat Bible',44.5)");rn rn //查询记录rn rs = stmt.executeQuery("select ID,NAME,TITLE,PRICE from BOOKS");rn //输出查询结果rn out.println(" ");rn while (rs.next())rn String col1 = rs.getString(1);rn String col2 = rs.getString(2);rn String col3 = rs.getString(3);rn float col4 = rs.getFloat(4);rn //打印所显示的数据rn out.println(" "+col1+" "+col2+" "+col3+" "+col4+"");rn rn out.println("");rnrn //删除新增加的记录rn stmt.executeUpdate("delete from BOOKS where ID='999'");rnrn //关闭数据库连接rn rs.close();rn stmt.close();rn con.close();rn catch(Exception e)out.println(e.getMessage());rnrn %>rn rn rnrn运行报如下错误rnmessage Unable to compile class for JSP: rnrndescription The server encountered an internal error that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 22 in the jsp file: /dbaccess.jsprnDrvierManager cannot be resolvedrn19: Statement stmt;rn20: ResultSet rs;rn21: Class.forName("com.mysql.jdbc.Driver");rn22: DrvierManager.registerDriver(new com.mysql.jdbc.Drvier());rn23: String dbUrl=rn24: "jdbc:mysql://localhost:3306/bookdb?userUnicode=true&characterEncoding=GB2312";rn25: String dbUser="root";rnrnWEB-INF lib 下已经有驱动,求大神帮忙rn[img=https://img-bbs.csdn.net/upload/201608/21/1471783626_478281.jpg][/img]rn
连接mySQL报错的问题
[img=https://img-bbs.csdn.net/upload/201407/30/1406699876_135688.jpg][/img]rnrn“Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message:Access denied for user 'root'@'localhost' (using password:YES)”rnrn前提:使用的系统是xp 2002 64位,非管理员用户。rnrn这个具体是什么原因造成的?怎么解决?
mysql server连接问题
各位高人们,我遇到一个应该是简单,但是对我来说很烦的问题。baidu,google都查不出原因。rnrn我装的mysql和php,当我试图连接的时候出现了错误。rnrn我的mysql连接错误rnrn[color=#FF0000]Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could be made because the target machine actively (trying to connect via tcp://localhost:3306) in D:\server\sites\portfolio\hireme\hireme_content.php on line 38rnrnWarning: mysql_connect() [function.mysql-connect]: No connection could be made because the target machine actively refused it. in D:\server\sites\portfolio\hireme\hireme_content.php on line 38rnCould not connect: No connection could be made because the target machine actively refused it. [/color]rnrn我的php 代码rn[color=#339966][/color]rnrn我在mysql workbench下面重复检查了一下是在port 3306下面的。用户名密码也不会错,mysql workbench连到数据库一切正常。rnrn希望高人给与指点。谢谢了。rnrnrnrnrnrnrnrn
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview