我是新手!帮帮忙吧!
我的项目在本地机运行好使!传到空间就说数据库连不上了!息: using JDK 1.4 java.sql.Timestamp handling
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.News -> news
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.NewsType -> news_type
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.Users -> users
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.CourseType -> course_type
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.Students -> students
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.UsersType -> userstype
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.Registerinformation -> registerinformation
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.Person -> person
2010-3-2 8:44:11 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
信息: Mapping class: com.songdao.entity.Note -> note
2010-3-2 8:44:11 org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
信息: Building new Hibernate SessionFactory
2010-3-2 8:44:11 org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
信息: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2010-3-2 8:44:11 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 0, SQLState: null
2010-3-2 8:44:11 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: Cannot create PoolableConnectionFactory (Access denied for user: '[email protected]' (Using password: YES))
2010-3-2 8:44:11 org.hibernate.cfg.SettingsFactory buildSettings
警告: Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user: '[email protected]' (Using password: YES))
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
的异常,并且我空间的数据库用户名和数据库密码都和空间的一致啊!
这是我数据库链接那块代码:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  <property name="driverClassName" value="com.mysql.jdbc.Driver">
  </property>
  <property name="url" value="jdbc:mysql://localhost:3306/zku0y1_db">
  </property>
  <property name="username" value="zku0y1"></property>
  <property name="password" value="u3y8s9y4"></property>
 </bean>
这是我空间的数据库资料:
数据库名称: zku0y1_db 
用户名: zku0y1 
数据库密码: u3y8s9y4 急!希望能加qq:331345491

解决方案 »

  1.   

    严重: Cannot create PoolableConnectionFactory (Access denied for user: '[email protected]' (Using password: YES)) 
    应该是root没有远程连接的权限。你看下 
    use mysql select Host,User,Password from user; 看看结果就知道了。
    如果没有远程连接的权限请参考
    grant all on yourdb.* to yourUsername@yourHost identified by "yourPassword";
    flush privileges;//使权限立刻生效
      

  2.   

    虽然不知道怎么解决,但是感觉可能是连接的问题。先把连接改了试试,localhost肯定不行的