NutzCN Logo
问答 数据库报错 改配置的配置了
发布于 2693天前 作者 大豪豪 1777 次浏览 复制 上一个帖子 下一个帖子
标签:

Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

dao.js
var ioc = {
        conf : {
            type : "org.nutz.ioc.impl.PropertiesProxy",
            fields : {
                paths : ["custom/"]
            }
        },
        dataSource : {
                factory : "$conf#make",
                args : ["com.alibaba.druid.pool.DruidDataSource", "db."],
                type : "com.alibaba.druid.pool.DruidDataSource",
                events : {
                    create : "init",
                        depose : 'close'
                }
        },
      dao : {
          type : "org.nutz.dao.impl.NutDao",
            args : [{refer:"dataSource"}]
      }
};

DB

db.url=jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&characterEncoding=UTF-8
db.username=root
db.password=123456
db.validationQuery=select 1
db.maxActive=100
db.testWhileIdle=true
db.filters=mergeStat
db.connectionProperties=druid.stat.slowSqlMillis=2000
db.defaultAutoCommit=true
4 回复

忘记启动数据库

mysql忘记启动了吧

添加回复
请先登陆
回到顶部