Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

mysql ÖеÄÊý¾ÝÀàÐÍ

2010-06-01 10:23
Êý¾ÝÀàÐÍ
ÃèÊö
×Ö½Ú
ÍƼöʹÓÃ
SMALLINT
ÕûÊý£¬´Ó-32000µ½ +32000·¶Î§
2
´æ´¢Ïà¶Ô±È½ÏСµÄÕûÊý¡£
±ÈÈç: Äê¼Í£¬ÊýÁ¿
INT
ÕûÊý£¬´Ó-2000000000 µ½ +2000000000 ·¶Î§
4
´æ´¢ÖеÈÕûÊý
ÀýÈç: ¾àÀë
BIGINT
²»ÄÜÓÃSMALLINT »ò INTÃèÊöµÄ³¬´óÕûÊý¡£
8
´æ´¢³¬´óµÄÕûÊý
ÀýÈç: ¿Æѧ/ÊýѧÊý¾Ý
FLOAT
µ¥¾«¶È¸¡µãÐÍÊý¾Ý
4
´æ´¢Ð¡ÊýÊý¾Ý
ÀýÈç:²âÁ¿£¬Î¶È
DOUBLE
Ë«¾«¶È¸¡µãÐÍÊý¾Ý
8
ÐèҪ˫¾«¶È´æ´¢µÄСÊýÊý¾Ý
ÀýÈç:¿ÆѧÊý¾Ý
DECIMAL
Óû§×Ô¶¨Ò徫¶ÈµÄ¸¡µãÐÍÊý¾Ý
±äÁ¿;È¡¾öÓÚ¾«¶ÈÓ볤¶È
ÒÔÌرð¸ßµÄ¾«¶È´æ´¢Ð¡ÊýÊý¾Ý¡£
ÀýÈç:»õ±ÒÊý¶î£¬¿ÆѧÊý¾Ý
CHAR
¹Ì¶¨³¤¶ÈµÄ×Ö·û´®
Ìض¨×Ö·û´®³¤¶È(¸ß´ï255×Ö·û)
´æ´¢Í¨³£°üº¬Ô¤¶¨Òå×Ö·û´®µÄ±äÁ¿
ÀýÈç: ¶¨ÆÚº½Ïߣ¬¹ú¼Ò»òÓʱà
VARCHAR
¾ßÓÐ×î´óÏÞÖƵĿɱ䳤¶ÈµÄ×Ö·û´®
±äÁ¿; 1 + ʵ¼Ê×Ö·û´®³¤¶È (¸ß´ï 255 ×Ö·û)
´æ´¢²»Í¬³¤¶ÈµÄ×Ö·û´®Öµ(¸ß´ïÒ»¸öÌض¨µÄ×î´óÏÞ¶È).
ÀýÈç:Ãû×Ö£¬ÃÜÂ룬¶ÌÎıêÇ©
TEXT
ûÓÐ×î´ó³¤¶ÈÏÞÖƵĿɱ䳤¶ÈµÄ×Ö·û´®
Variable; 2 +聽 actual string length
´æ´¢´óÐÍÎı¾Êý¾Ý
ÀýÈç: ÐÂÎŹÊÊ£¬²úÆ·ÃèÊö
BLOB
¶þ½øÖÆ×Ö·û´®
±äÁ¿£»2 + ʵ¼Ê×Ö·û´®³¤¶È
´æ´¢¶þ½øÖÆÊý ......

MySQLϵͳ½á¹¹Í¼

 
½ü¶Îʱ¼äͻȻ¶ÔMYSQLÕâ¸ö¿ªÔ´Êý¾ÝÓÐÁËÐËȤ£¬Ö÷ÒªÊÇÆäÊÇ¿ªÔ´Ãâ·Ñ£¬ÏëÏëÒÔºóÎÞÂÛÊǹ«Ë¾×öÏîÄ¿»¹ÊǸöÈË×öЩ¼òµ¥µÄСϵͳ£¬¶¼¿ÉÒÔÑ¡Ôñ£¬ÓÚÊÇ»¨Á˵ãʱ¼äÑо¿ÁËÏ£¬ÏÖÔÚ·ÖÏíÏÂ×Ô¼ºµÄѧϰÐĵ᣽ñÌì¿´ÁËдÆäϵͳµÄ×é³ÉºÍÕûÌå½á¹¹£¬ÏÖÔÚ°ÑÕûÌåµÄ½á¹¹ÓÃVISIO»­ÁËÏ£¬È»ºóÖðÒ»½âÊÍ£¬²¢²ûÊöÏÂÎÒµÄÀí½â£¬Ï±ßÊÇMySQLϵͳ½á¹¹Í¼µÄÕûÌå½á¹¹Í¼£º
 
......

mysql С¼¼ÇÉ£¬×Ö·û¼¯£¬»·¾³±äÁ¿

Ò»¡¢MySql£¬ÓÃcmdÃüÁîÌáʾÐÐÁ¬½ÓÊý¾Ý¿â£¬·¢ÏÖ²éѯÊý¾Ý¿âÖеÄÖÐÎijöÏÖÂÒÂ룬¶øÊý¾Ý¿âÀïÃæ´æµÄÊÇutf8£¬¶¼ÊÇÕýÈ·µÄ
ÓÚÊÇÉÏÍøËÑË÷һϣ¬
ÕÒµ½Ïà¹ØÉèÖ÷½·¨ÈçÏ¡£
1¡¢MySQLÊÇÓÐһЩ»·¾³±äÁ¿¿ÉÒÔÉèÖã¬
¿ÉÊäÈ룺show variables;¿É²é¿´µ±Ç°µÄ»·¾³±äÁ¿ÉèÖã»
2¡¢ÕâЩ±äÁ¿µ±ÖÐÓÐÒ»²¿·ÖÓë×Ö·ûÏà¹ØµÄÉèÖã¬
¿ÉÊäÈ룺show variables like ´character%´;²é¿´£»
3¡¢ÆäÖÐcharacter_set_results¾ö¶¨·µ»Ø½á¹ûµÄ±àÂ룬
windowsÏÂÉèΪgb2312¼´¿ÉÕý³£ÏÔʾÖÐÎÄ£»
ÉèÖ÷½·¨£ºset character_set_results=gb2312;£¬È»ºó»Ø³µ¼´¿É£»
4¡¢µ±È»£¬Èç¹ûÏëͨ¹ýÃüÁîÌáʾÐд°¿ÚÀ´ÊäÈëÖÐÎÄÐÞ¸ÄÊý¾Ý¿âÄÚÈÝ£¬
Ôò¿ÉÒÔÊÔÊÔÉèÖÃset character_set_connection=gb2312;
ÒÔ¼°set character_set_client=gb2312;
˵Ã÷£º
ÒÔÉÏÔÚÃüÁîÌáʾÐд°¿ÚÖÐÉèÖõÄÖµ£¬
ÆäÓÐЧÆÚ½ö½öΪ±¾´ÎÁ¬½ÓÓÐЧ£¬
¼´¶Ï¿ª±¾´ÎÁ¬½ÓÖ®ºó£¬
ÖØÐÂÁ¬½Ó½øÀ´£¬
ËùÓÐËùÉèÖõıäÁ¿ÓÖ»Ö¸´µ½Ä¬ÈϵÄÖµÁË¡£
¶þ¡¢´ÓDOSÇл»µ½mysql£º»·¾³±äÁ¿ÉèÖõÄÎÊÌâ
ÔÚWindowsXPÖдò¿ªDOS£¬Í¨¹ýÊäÈëÃüÁî“mysql -u root -p”Çл»µ½mysqlÏ£¬Çл»Ê§°Ü£¬ÈçÏÂËùʾ£º
Microsoft Windows XP [°æ±¾ 5.1.2600]
(C) °æȨËùÓÐ 1985-2001 Micros ......

MySQL Óû§¹ÜÀí

Ê×ÏÈÒªÉùÃ÷һϣºÒ»°ãÇé¿öÏ£¬ÐÞ¸ÄMySQLÃÜÂ룬ÊÚȨ£¬ÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ġ£
²âÊÔ»·¾³£ºWIN32 mysql5.0.45
×¢£º±¾²Ù×÷ÊÇÔÚWINÃüÁîÌáʾ·ûÏ£¬phpMyAdminͬÑùÊÊÓá£
    Óû§£ºphplamp  Óû§Êý¾Ý¿â£ºphplampDB
1.н¨Óû§¡£
//怬MYSQL
@>mysql -u root -p
@>ÃÜÂë
//´´½¨Óû§
mysql> insert into mysql.user(Host,User,Password) values("localhost","phplamp",password("1234"));
//Ë¢ÐÂϵͳȨÏÞ±í
mysql>flush privileges;
ÕâÑù¾Í´´½¨ÁËÒ»¸öÃûΪ£ºphplamp  ÃÜÂëΪ£º1234  µÄÓû§¡£
È»ºóµÇ¼һÏ¡£
mysql>exit;
@>mysql -u phplamp -p
@>ÊäÈëÃÜÂë
mysql>µÇ¼³É¹¦
2.ΪÓû§ÊÚȨ¡£
//µÇ¼MYSQL£¨ÓÐROOTȨÏÞ£©¡£ÎÒÀïÎÒÒÔROOTÉí·ÝµÇ¼.
@>mysql -u root -p
@>ÃÜÂë
//Ê×ÏÈΪÓû§´´½¨Ò»¸öÊý¾Ý¿â(phplampDB)
mysql>create database phplampDB;
//ÊÚȨphplampÓû§ÓµÓÐphplampÊý¾Ý¿âµÄËùÓÐȨÏÞ¡£
>grant all privileges on phplampDB.* to phplamp@localhost identified by '1234';
//Ë¢ÐÂϵͳȨÏÞ±í
mysql>flush privileges;
mysql>ÆäËü²Ù×÷
/*
Èç¹ûÏëÖ¸¶¨²¿·ÖȨÏÞ¸øÒ ......

mysql noinstall°æ°²×°

mysql noinstall°æ°²×°
1¡¢Èí¼þµÄÏÂÔØ
¡¡¡¡µ½mysqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØMySQLµÄ½âѹ°ü£¬Èçmysql-noinstall-5.0.51b-win32.zip
¡¡¡¡È»ºó½«Æä½âѹµ½ÄãÏ£ÍûÊý¾Ý¿âËùÔÚµÄij¸öλÖã¬ÈçC:\
¡¡¡¡ÕâÑùÔÚC:ÅÌÏÂÃæ¾ÍÓÐÁËC:\mysql-5.0.51b-win32ÕâÑùµÄÒ»¸öĿ¼£¬ÀïÃæ¾ÍÊÇMySQLÊý¾Ý¿âµÄÈ«²¿ÄÚÈÝ¡£
2¡¢ÅäÖÃ
¡¡¡¡Ê×ÏÈÎÒÃÇÀ´¿´MySQLµÄ¸ùĿ¼£¬ÀïÃæÓжà¸öÎļþÃûÈçmy-****.iniÐÎʽµÄÎļþ£¬Õâ¾ÍÊÇMySQLÅäÖõÄÑùÀýÎļþ£¬Äã¿ÉÒÔÑ¡È¡ÆäÖÐÒ»¸ö£¬½«ÆäÃû×Ö¸ÄΪmy.ini£¬MySQLÆô¶¯µÄʱºò¾ÍÊǶÁÈ¡Õâ¸ömy.iniÎļþÀ´¾ö¶¨Êý¾Ý¿âµÄ¸÷Ïî²ÎÊý¡£
¡¡¡¡ÔÚmy.iniÎļþÖÐÐèÒª½øÐÐÅäÖõÄÖ÷ÒªÊÇÁ½¸ö·½Ã棬һ¸öÊÇ¿Í»§¶Ë£¬Ò»¸öÊÇ·þÎñÆ÷¶Ë¡£
¡¡¡¡* ¿Í»§¶ËÅäÖÃ
¡¡¡¡# CLIENT SECTION
#-----------------------------------------------------
[client]
port = 3306
[mysql]
default-character-set = gbk
¡¡¡¡ÐèÒªÅäÖõÄÖ÷ÒªÊÇÁ½Ïһ¸öÊÇ¿Í»§¶Ë¶Ë¿Ú£¬Ò»¸öÊÇĬÈϵÄ×Ö·û¼¯(gbk¾ÍÊÇÉèÖóÉÁËÖÐÎÄ)£¬ÕâÀï¶Ë¿ÚÑ¡ÓÃĬÈϵÄ3306£¬×Ö·û¼¯¿ÉÒÔ¸ù¾ÝÐèÒªÐÞ¸ÄΪUTF-8»òGBK¡£
¡¡¡¡* ·þÎñÆ÷¶ËÅäÖÃ
#SERVER SECTION
#-----------------------------------------------------
[mysqld]
port = 3306
basedir= "C:/mysql-5.0.51b ......

mysqlº¯Êý

now()º¯ÊýÒÔ`yyyy-mm-dd hh:mm:ss·µ»Øµ±Ç°µÄÈÕÆÚʱ¼ä£¬¿ÉÒÔÖ±½Ó´æµ½datetime×Ö¶ÎÖС£
curdate()ÒÔ’yyyy-mm-dd’µÄ¸ñʽ·µ»Ø½ñÌìµÄÈÕÆÚ£¬¿ÉÒÔÖ±½Ó´æµ½date×Ö¶ÎÖС£
curtime()ÒÔ’hh:mm:ss’µÄ¸ñʽ·µ»Øµ±Ç°µÄʱ¼ä£¬¿ÉÒÔÖ±½Ó´æµ½time×Ö¶ÎÖС£ ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [11] [12] [13] [14] 15 [16] [17] [18] [19] [20]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ