English 中文(简体)
Debian(MySQL)午餐会的问题
原标题:Problem with lunching Java app (Spring, Hibernate) on Debian (MySQL)

</bean id="mySqlDataSource" > class="org.springframework.jdbc.datasource.DriverManagerDataSource">

     &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/>
     &lt;property name="url" value="jdbc:mysql://127.0.0.1:3306/mysqljava"/>
     &lt;property name="username" value="mysqljava"/>
     &lt;property name="password" value="the_bbt"/>
 &lt;/bean>

<bean id="mySqlSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="mySqlDataSource"/>

    <property name="mappingResources">
        <list>
              <value> hibernate/SimpleEntity.hbm.xml</value>
        </list>
    </property>

    <property name="hibernateProperties">
        <value>
            hibernate.dialect=org.hibernate.dialect.MySQLDialect
            hibernate.show_sql=true
            hibernate.hbm2ddl.auto=create
            hibernate.current_session_context_class=thread
        </value>
    </property>

</bean>

above my Spring config, why my app throws:

 [java] 02.12.2010 18:29:13 org.hibernate.cfg.SettingsFactory buildSettings
 [java] WARNING: Could not obtain connection to query metadata
 [java] java.sql.SQLException: Access denied for user  root @ localhost  (using password: YES)
 [java]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)

<和Windows上的任何问题!

问题回答

您需要把数据来源的贵国数据库存取证书混为一谈。

如果您配置了用户名/密码,那么在安装灯塔时,可能不会建立数据库?

Are you sure you gave the root user enough rights relative to the host localhost ? You can check via MySQL Workbench or any other manager you have available, if you don t like the SQL command line.

你们是否允许我的奇拉贾瓦用户进入我的谢q。

请从根基用户手中接手。

CREATE DATABASE mysqljava;
GRANT ALL PRIVILEGES ON mysqljava.* TO  mysqljava @ localhost  IDENTIFIED BY  the_bbt  WITH GRANT OPTION;

然后把羊/我sqljava用户连接起来:

mysql -umysqljava -pthe_bbt
use mysqljava;
SHOW TABLES;

并显示我的结果。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...