zhangkaitao / es

JavaEE项目开发脚手架(我的公众号:kaitao-1234567,我的新书:《亿级流量网站架构核心技术》)
https://github.com/zhangkaitao/es
Apache License 2.0
2.17k stars 1.59k forks source link

数据库连接不上》》 #45

Closed GodIT closed 11 years ago

GodIT commented 11 years ago

modified es/web/pom.xml--^>profile--^>development---^>connection.admin.url/connection.username/password 这里指定的所有 的 都改掉了,怎么还是连接不上。 image

<profiles>
    <profile>
        <id>development</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <db.name>es</db.name>
            <connection.driver_class>com.mysql.jdbc.Driver</connection.driver_class>
            <connection.admin.url>
                <![CDATA[ jdbc:mysql://localhost:9090?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.admin.url>
            <connection.url>
                <![CDATA[ jdbc:mysql://localhost:9090/${db.name}?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.url>
            <connection.username>root</connection.username>
            <connection.password>root</connection.password>
            <jpa.showSql>true</jpa.showSql>
            <jpa.generateDdl>false</jpa.generateDdl>
            <jpa.database>MYSQL</jpa.database>
            <jpa.databasePlatform>org.hibernate.dialect.MySQL5InnoDBDialect</jpa.databasePlatform>
            <log.dir>D:/Backup/es</log.dir>

            <shiro.uid.cookie.domain></shiro.uid.cookie.domain>
            <shiro.uid.cookie.path>/</shiro.uid.cookie.path>

        </properties>
    </profile>
    <profile>
        <!-- integration test -->
        <id>it</id>
        <properties>
            <db.name>es</db.name>
            <connection.driver_class>com.mysql.jdbc.Driver</connection.driver_class>
            <connection.admin.url>
                <![CDATA[ jdbc:mysql://localhost:9090?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.admin.url>
            <connection.url>
                <![CDATA[ jdbc:mysql://localhost:9090/${db.name}?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.url>
            <connection.username>root</connection.username>
            <connection.password>root</connection.password>
            <jpa.showSql>false</jpa.showSql>
            <jpa.generateDdl>false</jpa.generateDdl>
            <jpa.database>MYSQL</jpa.database>
            <jpa.databasePlatform>org.hibernate.dialect.MySQL5InnoDBDialect</jpa.databasePlatform>
            <log.dir>D:/Backup/es</log.dir>

            <shiro.uid.cookie.domain></shiro.uid.cookie.domain>
            <shiro.uid.cookie.path>/</shiro.uid.cookie.path>

        </properties>
    </profile>

    <profile>
        <!--正式环境-->
        <id>production</id>
        <properties>
            <db.name>es</db.name>
            <connection.driver_class>com.mysql.jdbc.Driver</connection.driver_class>
            <connection.admin.url>
                <![CDATA[ jdbc:mysql://localhost:9090?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.admin.url>
            <connection.url>
                <![CDATA[ jdbc:mysql://localhost:9090/${db.name}?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8 ]]>
            </connection.url>
            <connection.username>root</connection.username>
            <connection.password>root</connection.password>
            <jpa.showSql>false</jpa.showSql>
            <jpa.generateDdl>false</jpa.generateDdl>
            <jpa.database>MYSQL</jpa.database>
            <jpa.databasePlatform>org.hibernate.dialect.MySQL5InnoDBDialect</jpa.databasePlatform>
            <log.dir>/data/backup/es</log.dir>

            <shiro.uid.cookie.domain>sishuok.com</shiro.uid.cookie.domain>
            <shiro.uid.cookie.path>/</shiro.uid.cookie.path>

        </properties>
    </profile>

</profiles>
zhangkaitao commented 11 years ago

<![CDATA[ jdbc:mysql://localhost:9090?autoReconnect=true&useUnicode=true&characterEncoding=utf-8 ]]>

把前边后后边的空格去掉 如

<![CDATA[jdbc:mysql://localhost:9090?autoReconnect=true&useUnicode=true&characterEncoding=utf-8]]>

GodIT commented 11 years ago

首先感谢你回答,但是删除空格依旧是连接不上。 如图: image

zhangkaitao commented 11 years ago

1、你的mysql开的9090端口?
2、普通客户端 如navicat能连上吗

GodIT commented 10 years ago

这个能连上的: image 除了这个有什么注意的吗?真找不到问题所在。。。。

zhangkaitao commented 10 years ago

你加下我qq 314154083 具体讨论