
sql
蓝天逐日者
老学生。
展开
-
mySQL 新添加的用户无法登陆的解决办法!
比如我在root账户下新建了一个 用户 :shatian 密码:123456但使用用户登陆失败: C:\Users\user>mysql -u shatian-pEnter password: *******ERROR 1045(28000):Access denied for user 'shatian'@'localhost'(using password:YES)解决方法: 增加普通用户后,原创 2016-04-13 09:41:00 · 361 阅读 · 0 评论 -
sqlite timestamp 时间字段查询语句的写法
在sqlite里对timestamp字段进行where语句查询时,请首先确定存储的时间格式是否是ISO 8601标准的时间字符串,也就是2011-04-10T15:45:58,或者是* 2011-04-10T 14:25:10.487如果你的timestamp字段写入的是2011-04-11 15:45:58,可以肯定告诉你,你再怎么按时间查询都是有很大问题,明明表里有就是查不出来,所以写入新纪录原创 2016-04-13 09:43:50 · 8839 阅读 · 0 评论 -
android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed错误原因
情况1:你定义的字段为 not null而插入时对应的字段却没值。情况2:你定义的字段设定PRIMARY,而插入的值已经在表中存在。原创 2016-04-13 09:43:53 · 803 阅读 · 0 评论 -
java.lang.IllegalStateException: Make sure the Cursor is initialized correctly before accessing...
java.lang.IllegalStateException: Couldn't read row 0, col 2 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.这个错误是使用Dao获取数据库数据时,有的字段是无效的,重新检查下sql的字段名,和原创 2016-08-01 17:35:44 · 871 阅读 · 0 评论 -
Exception : java.lang.IllegalStateException:getDataBase called recursively
今天要把一个sql脚本文件文件读取到sqlite中:try {InputStream in = AppContext.getInstace().getAssets().open("citys.sql");SQLiteDatabase database = getWritableDatabase();BufferedReader bufferedReader = new Buffered...原创 2018-11-02 15:21:05 · 470 阅读 · 0 评论