随笔分类 -  mysql

摘要:select concat('2018 ',mod(floor(1+rand() 10),9),' ',floor(1+rand() 28),' ', floor(8+rand() 10),':',floor(10+rand() 49),':',floor(10+rand() 49)) from d 阅读全文
posted @ 2018-09-21 13:33 乱笙歌 阅读(4370) 评论(0) 推荐(0)
摘要:mysql日期和字符相互转换 date_format(date,'%Y %m %d') str_to_date(date,'%Y %m %d') %Y:代表4位的年份 %y:代表2位的年份 %m:代表月, 格式为(01……12) %c:代表月, 格式为(1……12) %d:代表月份中的天数,格式为( 阅读全文
posted @ 2017-06-26 17:15 乱笙歌 阅读(135) 评论(0) 推荐(0)
摘要:列出数据库:show databases; 选择数据库:use databaseName; 列出表格:show tables; 显示表格列的属性:show columns from tableName; Desc tableName; 执行sql文件:source fileName.txt; 匹配字 阅读全文
posted @ 2017-06-26 17:15 乱笙歌 阅读(181) 评论(0) 推荐(0)
摘要:CAST(expr AS type), CONVERT(expr,type), CONVERT(expr USING transcoding_name) The CAST() and CONVERT() functions take a value of one type and produce a 阅读全文
posted @ 2017-06-26 17:14 乱笙歌 阅读(144) 评论(0) 推荐(0)
摘要:1.导出整个数据库 mysqldump u 用户名 p 数据库名 导出的文件名 mysqldump u wcnc p smgp_apps_wcnc wcnc.sql 2.导出一个表 mysqldump u 用户名 p 数据库名 表名 导出的文件名 mysqldump u wcnc p smgp_ap 阅读全文
posted @ 2017-06-26 17:14 乱笙歌 阅读(111) 评论(0) 推荐(0)
摘要:如何将中文数据插入到mysql数据库。 step1, 要保证数据库支持中文。 create database jd1301db default character set utf8; step2, 数据库连接字符串:jdbc:mysql://localhost:3306/jd1301db?useUn 阅读全文
posted @ 2017-06-26 17:13 乱笙歌 阅读(228) 评论(0) 推荐(0)
摘要:SELECT FROM book limit 2,1 2是index ,1是几条数据 阅读全文
posted @ 2017-06-26 17:13 乱笙歌 阅读(92) 评论(0) 推荐(0)
摘要:MySQL会出现中文乱码的原因不外乎下列几点: 1.server本身设定问题,例如还停留在latin1 2.table的语系设定问题(包含character与collation) 3.客户端程式(例如php)的连线语系设定问题 强烈建议使用utf8!!!! utf8可以兼容世界上所有字符!!!! 一 阅读全文
posted @ 2017-01-15 10:26 乱笙歌 阅读(25656) 评论(0) 推荐(1)
摘要:查看和设置MySQL数据库字符集作者:scorpio 2008 01 21 10:05:17 标签: 杂谈 Liunx下修改MySQL字符集:1.查找MySQL的cnf文件的位置find / iname ' .cnf' print /usr/share/mysql/my innodb heavy 4 阅读全文
posted @ 2017-01-15 10:25 乱笙歌 阅读(462) 评论(0) 推荐(0)