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

ÔÚMYSQLÖвåÈ뵱ǰʱ¼ä

NOW()º¯ÊýÒÔ`'YYYY-MM-DD HH:MM:SS'·µ»Øµ±Ç°µÄÈÕÆÚʱ¼ä£¬¿ÉÒÔÖ±½Ó´æµ½DATETIME×Ö¶ÎÖС£
CURDATE()ÒÔ’YYYY-MM-DD’µÄ¸ñʽ·µ»Ø½ñÌìµÄÈÕÆÚ£¬¿ÉÒÔÖ±½Ó´æµ½DATE×Ö¶ÎÖС£
CURTIME()ÒÔ’HH:MM:SS’µÄ¸ñʽ·µ»Øµ±Ç°µÄʱ¼ä£¬¿ÉÒÔÖ±½Ó´æµ½TIME×Ö¶ÎÖС£
Àý£ºinsert into tablename (fieldname) values (now())


Ïà¹ØÎĵµ£º

MySQLѧϰ(5)IN,GRANT,MD5,EXISTS

1.INµÄÓ÷¨
IN(value,value1,...) valuesµÄ¸öÊý¸úmax_allowed_packetÏà¹Ø£¬SELECT 2 IN (2,4,'STRING');
NOT IN(value,..)ºÍINÓï·¨Ò»Ñù¡£
2.IF NOT EXISTS
CREATE ... IF NOT EXISTS stm; ...¿ÉÒÔʹDATABASE,TABLE,EVENT¡£ÈçCREATE TABLE IF NOT EXISTS t(id INT); 
3.MD5,MySQLÊý¾Ý¿âÌṩÁËmd5¼ÓÃܹ¦Ä ......

windowsµÄ64λƽ̨railsÁ¬½ÓmysqlµÄ·½·¨


°²×°mysql
gem install mysql
ʹÓÃmysql£¬È磬rake db:migrate
»á±¨´í£º
E:\study\ruby\rails_space>rake db:migrate
(in E:/study/ruby/rails_space)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
193: ......

JDBCÁ¬½ÓMySQLÊý¾Ý¿âʵÏÖÔöɾ²é¸Ä

package com.qll.operate;
import java.sql.*;
public class OperateUser {
 String driver = "com.mysql.jdbc.Driver";
 String url = "jdbc:mysql://localhost:3306/test";
 String name = "root";
 String password = "123456";
 static Connection conn = null;
 Statement st = ......

mysql ´æ´¢¹ý³Ì ÓαêµÄÀý×Ó

create procedure getInfor2()
BEGIN
declare _abc varchar(200);
declare stopFlag int;
DECLARE cursor_name CURSOR
FOR
select zhuanyuan from server;
DECLARE CONTINUE HANDLER FOR NOT FOUND set stopFlag=1;
OPEN cursor_name;
REPEAT
FETCH cursor_name INTO _abc;
begin
if _abc='root'
the ......

¾ßÓиºÔؾùºâ¹¦ÄÜMySQL·þÎñÆ÷¼¯Èº²¿ÊðʵÏÖ

À´×Ô£ºhttp://it.china-b.com/zx/linuxsjk/20090525/24129_1.html
ÕªÒª£ºMySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â
ÖÎÀíϵͳ£¬ÊÊÓÃƽ̨¶à£¬¿ÉÀ©Õ¹ÐÔÇ¿¡£ÔÚʵ¼ÊÉú²ú»·¾³ÖУ¬²¿ÊðºÍʵÏÖ¾ßÓÐÒ»¶¨¸ºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷¼¯Èº£¬¶ÔÓÚÌá¸ßÓû§Êý¾Ý¿â
Ó¦ÓÃϵͳµÄÐÔÄÜ¡¢ËٶȺÍÎȶ¨ÐÔ¾ßÓÐÃ÷ÏÔµÄ×÷Óᣱ¾ÎļòÒª½éÉÜÁËÔÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ