Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Javaµ÷Óô洢¹ý³Ì(MySqlÊý¾Ý¿â)

Ò»¡¢½¨±í
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `ID` int(11) NOT NULL auto_increment,
  `NAME` varchar(16) NOT NULL default '',
  `REMARK` varchar(16) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
 
¶þ¡¢½¨Á¢´æ´¢¹ý³Ì
1¡¢»ñÈ¡Óû§ÐÅÏ¢
CREATE DEFINER=`root`@`localhost` PROCEDURE `getUserList`()
BEGIN
  select * from user;
END;
2¡¢Í¨¹ý´«Èë²ÎÊý´´½¨Óû§
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertUser`(nameVar varchar(16),remarkVar varchar(16))
BEGIN
  insert into user(name,remark) values(nameVar,remarkVar);
END;
 
Èý¡¢µ÷ÓÃ
1¡¢»ñÈ¡Óû§ÐÅÏ¢
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost/temp?user=root&password=root";
Connection conn = DriverManager.getConnection(url);
String proc = "call getUserList()";
CallableStatement cs = conn.prepareCall(proc);
rs = cs.executeQuery();
while(rs.next()){
    System.out.println(rs.getString(2)+" "+rs.getString(3));
}
2¡¢Í¨¹ý´«Èë²ÎÊý´´½¨Óû§
Connection conn = DriverManager.getConnection(url);
String proc = "call insertUser(?,?)";
CallableStatement cs = conn.prepareCall(proc);
cs.setString(1, "LINRZ");
cs.setString(2, "REMARK");
cs.execute();


Ïà¹ØÎĵµ£º

MySQLÃüÁî

1.Á¬½ÓMySQLÊý¾Ý¿â
echo on¡¡¡¡
cd c:\Program Files\MySQL\MySQL Server 5.2\bin
mysql -uroot -ppass
2¡¢ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
3¡¢ÏÔʾ¿âÖеÄÊý¾Ý±í£º
use mysql; //´ò¿ª¿â£¬
show tables;
4¡¢ÏÔʾÊý¾Ý±íµÄ½á¹¹£º
describe ±íÃû;
5¡¢½¨¿â£º
create database ¿âÃû;
6¡¢½¨±í£º
use ¿âÃû;
creat ......

Mysql for linux mysql×Ô¶¯±¸·Ý½Å±¾

¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......

[Injection]¶ÔMYSQL 5.0·þÎñÆ÷ÒÔÉÏ°æ±¾×¢Èë


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 ......

ÔÚmysqlÊý¾Ý¿âÖÐÈÕÆÚÓëlongÐ͵Äת»¯

1¡¢ÔÚmysql Êý¾Ý¿âÖУ¬“2009-09-15 00£º00£º00”ת»¯ÎªÁÐΪ³¤ÕûÐ͵ĺ¯Êý£º
select unix_timstamp("2009-09-15 00£º00£º00")*1000,
ÕâÀïҪעÒ⣬mysqlÊý¾Ý¿âÖеij¤ÕûÐÍ£¬±ÈjavaÖеij¤ÕûÐÍÉÙÁËÃëºóÃæµÄºÁÃëÊý£¬ËùÒÔÒª³ËÒÔ1000£¬ÕâÑùÖ»Óм¸ºÁÃëÖ®²î
2¡¢ÔÚmysqlÊý¾Ý¿âÖУ¬“1252999488000”£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ