
mysql
文章平均质量分 69
0_o_c
这个作者很懒,什么都没留下…
展开
-
windows error 1045 (28000) access denied for user 'root'@'localhost' (using password: YES)
转自http://stackoverflow.com/questions/9382219/error-1045-28000-access-denied-for-user-rootlocalhost-using-password-ye"mysql -u root"use mysqlupdate user set authentication_string=password('yo转载 2016-03-16 01:29:21 · 1982 阅读 · 0 评论 -
中文乱码 unknown column in 'where clause'
来自:http://zhidao.baidu.com/link?url=3fIU5UHGwpKaK9-4zN3jGt74Epuc1F97X4W1WL3xKRsYgNO5SqTdtyGjNCNZxy7qVwnMRDVtrGC07KKKYuFlHa例如,其中college为中文时,加引号不会出现乱码,不加引号会出现乱码:String hql="from JobInfo where coll原创 2016-04-11 23:34:38 · 2877 阅读 · 0 评论 -
mysql 统计一个表中各类别的数目,并保存
下图为用户听歌记录表recordTime: 下图为歌曲表music: 现在需要计算每首歌被听数,并将其保存到歌曲表中,mysql语句为:UPDATE music D LEFT JOIN (SELECT B.musicId, count(*) AS s_sum FROM recordTime B GROU原创 2017-06-17 01:23:36 · 3116 阅读 · 0 评论 -
mysql 插入中文 ERROR 1366 (HY000): Incorrect string value: '\xE7\x8E\x9E\x97' for column
1、已建立的表无法插入中文字符串,原因是因为数据表中的内容为latin1字符集,由下图的的资料可知,latin1字符集为8bit,这说明它是不能表示中文的,故而当然会报改错:下面是具体问题,如果不修改name的字符集latin1,插入中文给name时,将会报错 Incorrect string value: '\xE7\x8E\x8B\xE6\x9E\x97',下图改了那么,没有改ed原创 2016-09-23 22:55:15 · 43250 阅读 · 11 评论 -
mysql中union、union all的用法实例
1、建表数据:create table a(fname varchar(30),lname varchar(30),addr varchar(30))insert into a values ("a_fname1","a_lname1","a_addr1");insert into a values ("a_fname2","a_lname2","a_addr2");insert into a原创 2017-11-01 18:07:14 · 2321 阅读 · 0 评论