在mysql数据库中日期与long型的转化
1、在mysql 数据库中,“2009-09-15 00:00:00”转化为列为长整型的函数:
select unix_timstamp("2009-09-15 00:00:00")*1000,
这里要注意,mysql数据库中的长整型,比java中的长整型少了秒后面的毫秒数,所以要乘以1000,这样只有几毫秒之差
2、在mysql数据库中,“1252999488000”(java中的long型数据)转化为日期:
select from_unixtime(1252999488);
注意:要将最后三位去掉
相关文档:
方法一:建一个拼音表 t_cosler ,存放每个字母开头的第一个汉字的编号和最后一个汉字的编号。
BatchFile code
+------+--------+-------+
| f_PY | cBegin | cEnd |
+------+--------+-------+
| A | 45217 | 45252 |
| B | 45253 | 45760 |
.....
| Z | 54481 | 55289 |
+------+--------+------- ......
在mysql数据库中,使用的是latin字符集,所以无法正常的支持中文字符,中文在数据库中显示为乱码“?”号。为了让mysql可以正常使用中文,尤其是当使用jsp连接mysql的时候,我们需要使用gbk的字符集,因此我们要对mysql进行以下设置,以便其有效的支持中文:
IXDBA.NET技术社区
1.修改my.cnf文件
my.cnf文件是 ......
mysql 5.0存储过程学习总结
一.创建存储过程
1.基本语法:
create procedure sp_name()
begin
………
end
2.参数传递
二.调用存储过程
1.基本语法:call sp_name()
注意:存储过程名称后面必须加括号,哪怕该存储过程没有参数传递
三.删除存储过程
1.基本语法:
drop procedure sp_name// ......
mysql设置密码和修改密码:
/usr/local/mysql/bin/mysqladmin -uroot password 123456 第一次设密码。
mysqladmin -uroot -p password mypasswd 修改密码
输入这个命令后,需要输入root的原密码,然后root的密码将改为mypasswd。
就是mysql5导出的有default-charact的设置,mysql4不支持,需要加skip-opt参数,如:
my ......
by ZaraByte
How to do a SQL Injection for MYSQL Server 5.0+
1. Find a vulnerable add a ‘ at the end of the site example: news.php?id=1 add a ‘ at the end of the 1 and see if you get a syntax error
2. order by #–
Keep upping the # until you get an error.
3. union all select 1 ......