在本地写了一个nutz框架信息,然后部署到没有eclipse的tomcat上就报错,数据库连接不上,显示《using password no!!!但是单独写一个mysql连接就能在tomcat上连接数据库
24 回复
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:
265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Sourc
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.jav
:325)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(Dr
idDataSource.java:1888)
2017-08-09 10:52:57,051 com.alibaba.druid.pool.DruidDataSource$CreateConnection
hread.run(DruidDataSource.java:1890) ERROR - create connection error, url: jdbc
mysql://localhost:3306/public_0_1
java.sql.SQLException: Access denied for user ''@'localhost' (using password: No
)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(My
sqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:
265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Sourc
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.jav
:325)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(Dr
idDataSource.java:1888)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:
265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Sourc
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.jav
:325)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(Dr
idDataSource.java:1888)
2017-08-09 10:52:57,051 com.alibaba.druid.pool.DruidDataSource$CreateConnection
hread.run(DruidDataSource.java:1890) ERROR - create connection error, url: jdbc
mysql://localhost:3306/public_0_1
java.sql.SQLException: Access denied for user ''@'localhost' (using password: N
)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(M
sqlIO.java:1659)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:
265)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
at sun.reflect.GeneratedConstructorAccessor36.newInstance(Unknown Sourc
)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.jav
:325)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnect
on(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(Dr
idDataSource.java:1888)
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
backendDataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('db.backend.url')"},
username : {java:"$conf.get('db.backend.username')"},
password : {java:"$conf.get('db.backend.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('db.backend.validationQuery')"},
maxActive : {java:"$conf.get('db.backend.maxActive')"}
}
},
backendDao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"backendDataSource"}]
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"backendDataSource"}]
},
gameServerDataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('db.game_server.url')"},
username : {java:"$conf.get('db.game_server.username')"},
password : {java:"$conf.get('db.game_server.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('db.game_server.validationQuery')"},
maxActive : {java:"$conf.get('db.game_server.maxActive')"}
}
},
gameServerDao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"gameServerDataSource"}]
},
daoData: {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"gameServerDataSource"}]
},
publicServerDataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('db.public.url')"},
username : {java:"$conf.get('db.public.username')"},
password : {java:"$conf.get('db.public.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('db.public.validationQuery')"},
maxActive : {java:"$conf.get('db.public.maxActive')"}
}
},
daoPublic:{
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"publicServerDataSource"}]
},
playerInfoServerDataSource:{
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('fot.url')"},
username : {java:"$conf.get('fot.username')"},
password : {java:"$conf.get('fot.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('fot.validationQuery')"},
maxActive : {java:"$conf.get('fot.maxActive')"}
}
},
daoPlayerInfo:{
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"playerInfoServerDataSource"}]
},
logDao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"playerInfoServerDataSource"}]
},
};
添加回复
请先登陆