mysql can't create table errno 150
1¡¢Íâ¼üµÄÒýÓÃÀàÐͲ»Ò»Ñù£¬Ö÷¼üÊÇintÍâ¼üÊÇchar
2¡¢ÕÒ²»µ½Ö÷±íÖÐ ÒýÓõÄÁÐ
3¡¢Ö÷¼üºÍÍâ¼üµÄ×Ö·û±àÂë²»Ò»ÖÂ
4.»¹ÓÐÒª½¨Á¢Íâ¼üµÄ»°£¬ÒªÏȽ¨Á¢Ë÷Òý¡£Ã»Óн¨Á¢Ë÷ÒýÒ²»á³ö´í¡£
ÎÒµÄÎÊÌâ½â¾ö·½°¸ÊÇÔÚsqlºóÃæ¼ÓÉÏÁËÈçϾ仰,ok!³É¹¦µ¼Èë½Å±¾
ENGINE=MyISAM DEFAULT CHARSET=utf8;
charset¶ÔÓ¦µÄ»»³ÉÄãµÄÖ÷¼ü±íµÄ×Ö·û¼¯!
Ïà¹ØÎĵµ£º
ÈÕÆÚº¯Êý£º
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
http://hi.baidu.com/yase_guoguo/blog/item/171c2d4feea83c01b2de0527.html
SQL ʱ¼ä±È½Ï
select * from useroperation where '2009-10-26 00:00:00' < date; //dateµÄÀàÐÍÊÇdatetime
select * from useroperation where D ......
1.ÔÚ´´½¨±íµÄͬʱ´´½¨Ë÷Òý
CREATE TABLE material(id INT NOT NULL, name char(40) NOT NULL, resistance INT, INDEX index1(id,name), UNIQUE INDEX index2(name))
µÚÒ»¸öË÷Òý£¬ÃûΪindex1£¬ÓÉidºÍnameÁ½¸ö×Ö¶Î×é³É¡£µÚ¶þ¸öË÷ÒýÖ»°üº¬name£¬²¢Ö¸Ã÷name×ֶεÄÖµ±ØÐëÊÇΨһµÄ¡£
2.²åÈëÊý¾Ý£¬¿ÉÒÔͨ¹ýÆäËûij ......
ÓÉÓÚMySQLÄ¿Ç°×ֶεÄĬÈÏÖµ²»Ö§³Öº¯Êý£¬ËùÒÔÒÔ
create_time datetime default now()
µÄÐÎʽÉèÖÃĬÈÏÖµÊDz»¿ÉÄܵġ£
´úÌæµÄ·½°¸ÊÇʹÓÃTIMESTAMPÀàÐÍ´úÌæDATETIMEÀàÐÍ¡£
TIMESTAMPÁÐÀàÐÍ×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£
Èç¹ûÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏ ......
»·¾³ rhel5.4
×°ºÃgcc ºÍÏàÓ¦µÄ¿â¡£ÎÒÕâ±ßÓöµ½curses¡£DebianϵͳµÄ»°Ðè°²×°apt-get install libncurses5-dev¡£
ÏÂÔØmysqlÔ´Âë°ü£¬ÎÒ×Ô¼ºÔÚmyslq¹Ù·½ÍøÕ¾ÉÏÏÂÁËÒ»¸ö“mysql-5.0.87.tar.gz”
cd /usr/local/src/
½â°ü tar zxvf mysql-5.0.87.tar.gz
cd mysql-5.0.87
./configure --prefix=/usr/local/servic ......
ÔÚ MySQLÏ£¬ÔÚ½øÐÐÖÐÎÄÄ£ºý¼ìË÷ʱ£¬¾³£»á·µ»ØһЩÓëÖ®²»Ïà¹ØµÄ¼Ç¼£¬Èç²éÕÒ "%a%" ʱ£¬·µ»ØµÄ¿ÉÄÜÓÐÖÐÎÄ×Ö·û£¬È´Ã»ÓÐa×Ö·û´æÔÚ¡£±¾ÈËÒÔÇ°Ò²ÔøÓöµ½¹ýÀàËÆÎÊÌ⣬¾ÏêϸÔĶÁMySQLµÄManual£¬·¢ÏÖ¿ÉÒÔÓÐÒ»ÖÖ·½·¨ºÜ·½±ãµÄ½â¾ö²¢µÃµ½ÂúÒâµÄ½á¹û¡£
¡¡¡¡Àý×Ó£º
¡¡¡¡Ï£Íûͨ¹ý“±êÌ┶ÔÐÂÎÅ¿â½øÐмìË÷£¬¹Ø¼ü×Ö¿ÉÄÜ°üº¬Ê ......