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

MysqlÊý¾ÝÀàÐÍ


ÊýÖµÀàÐÍ
¡¡¡¡MySQL
µÄÊýÖµÊý¾ÝÀàÐÍ¿ÉÒÔ´óÖ»®·ÖΪÁ½¸öÀà±ð£¬Ò»¸öÊÇÕûÊý£¬ÁíÒ»¸öÊǸ¡µãÊý»òСÊý¡£Ðí¶à²»Í¬µÄ×ÓÀàÐͶÔÕâЩÀà±ðÖеÄÿһ¸ö¶¼ÊÇ¿ÉÓõģ¬Ã¿¸ö×ÓÀàÐÍÖ§³Ö²»Í¬´óСµÄÊý¾Ý£¬²¢ÇÒ
MySQL ÔÊÐíÎÒÃÇÖ¸¶¨ÊýÖµ×Ö¶ÎÖеÄÖµÊÇ·ñÓÐÕý¸ºÖ®·Ö»òÕßÓÃÁãÌî²¹¡£
¡¡¡¡±íÁгöÁ˸÷ÖÖÊýÖµÀàÐÍÒÔ¼°ËüÃǵÄÔÊÐí·¶Î§ºÍÕ¼ÓõÄÄÚ´æ¿Õ¼ä¡£
ÀàÐÍ
´óС
·¶Î§£¨ÓзûºÅ£©
·¶Î§£¨ÎÞ·ûºÅ£©
ÓÃ;
TINYINT
1 ×Ö½Ú
(-128£¬127)
(0£¬255)
СÕûÊýÖµ
SMALLINT
2 ×Ö½Ú
(-32 768£¬32 767)
(0£¬65 535)
´óÕûÊýÖµ
MEDIUMINT
3 ×Ö½Ú
(-8 388 608£¬8 388 607)
(0£¬16 777 215)
´óÕûÊýÖµ
INT»òINTEGER
4 ×Ö½Ú
(-2 147 483 648£¬2 147 483 647)
(0£¬4 294 967 295)
´óÕûÊýÖµ
BIGINT
8 ×Ö½Ú
(-9 233 372 036 854 775 808£¬9 223 372 036 854
775 807)
(0£¬18 446 744 073 709 551 615)
¼«´óÕûÊýÖµ
FLOAT
4 ×Ö½Ú
(-3.402 823 466 E+38£¬1.175 494 351
E-38)£¬0£¬(1.175 494 351 E-38£¬3.402 823 466 351 E+38)
0£¬(1.175 494 351 E-38£¬3.402 823 466 E+38)
µ¥¾«¶È
¸¡µãÊýÖµ
DOUBLE
8 ×Ö½Ú
(1.797 693 134 862 315 7 E+308£¬2.225 073 858 507
201 4 E-308)£¬0£¬(2.225 073 858 507 201 4 E-308£¬1.797 693 134 862
315 7 E+308)
0£¬(2.225 073 858 507 201 4 E-308£¬1.797 693 134
862 315 7 E+308)
Ë«¾«¶È
¸¡µãÊýÖµ
DECIMAL
¶ÔDECIMAL(M,D) £¬Èç¹ûM>D£¬ÎªM+2·ñÔòΪD+2
ÒÀÀµÓÚMºÍDµÄÖµ
ÒÀÀµÓÚMºÍDµÄÖµ
СÊýÖµ
INT ÀàÐÍ
¡¡¡¡ÔÚ MySQL ÖÐÖ§³ÖµÄ 5 ¸öÖ÷ÒªÕûÊýÀàÐÍÊÇ
TINYINT£¬SMALLINT£¬MEDIUMINT£¬INT ºÍ
BIGINT¡£ÕâЩÀàÐÍÔںܴó³Ì¶ÈÉÏÊÇÏàͬµÄ£¬Ö»ÓÐËüÃÇ´æ´¢µÄÖµµÄ´óСÊDz»ÏàͬµÄ¡£
¡¡¡¡MySQL ÒÔÒ»¸ö¿ÉÑ¡µÄÏÔʾ¿í¶ÈָʾÆ÷µÄÐÎʽ¶Ô SQL
±ê×¼½øÐÐÀ©Õ¹£¬ÕâÑùµ±´ÓÊý¾Ý¿â¼ìË÷Ò»¸öֵʱ£¬¿ÉÒÔ°ÑÕâ¸öÖµ¼Ó³¤µ½Ö¸¶¨µÄ³¤¶È¡£ÀýÈ磬ָ¶¨Ò»¸ö×ֶεÄÀàÐÍΪ
INT(6)£¬¾Í¿ÉÒÔ±£Ö¤Ëù°üº¬Êý×ÖÉÙÓÚ 6
¸öµÄÖµ´ÓÊý¾Ý¿âÖмìË÷³öÀ´Ê±Äܹ»×Ô¶¯µØÓÿոñÌî³ä¡£ÐèҪעÒâµÄÊÇ£¬Ê¹ÓÃÒ»¸ö¿í¶ÈָʾÆ÷²»»áÓ°Ïì×ֶεĴóСºÍËü¿ÉÒÔ´æ´¢µÄÖµµÄ·¶Î§¡£
¡¡¡¡ÍòÒ»ÎÒÃÇÐèÒª¶ÔÒ»¸ö×ֶδ洢һ¸ö³¬³öÐí¿É·¶Î§µÄÊý×Ö£¬MySQL
»á¸ù¾ÝÔÊÐí·¶Î§×î½Ó½üËüµÄÒ»¶Ë½Ø¶ÌºóÔÙ½øÐд洢¡£»¹ÓÐÒ»¸ö±È½ÏÌرðµÄµØ·½ÊÇ£¬MySQL
»áÔÚ²»ºÏ¹æ¶¨µÄÖµ²åÈë±íÇ°×Ô¶¯ÐÞ¸ÄΪ 0¡£
¡¡¡¡UNSIGNED
ÐÞÊηû¹æ¶¨×Ö¶ÎÖ»±£´æÕýÖµ¡£ÒòΪ²»ÐèÒª±£´æÊý×ÖµÄÕý¡¢¸º·ûºÅ£¬¿ÉÒÔÔÚ´¢Ê±½ÚÔ¼Ò»¸ö“λ”µÄ


Ïà¹ØÎĵµ£º

mysql hibernateÖ÷¼üÅäÖÃ

  ÔÚ½üÆÚµÄÏîĿά»¤¹¤×÷ÖУ¬Ê±³£³öÏÖÖ÷¼üÖظ´µÄÒì³£¡£¾­¹ýһϵÁÐ×ÊÁϵIJéѯ֮ºó£¬·¢ÏÖʱhibernateÓ³ÉäÎļþÅäÖÃÎÊÌâ¡£
  mysqlÌṩÖ÷¼ü“×Ô¶¯ÔöÁ¿”µÄÅäÖã¬Ö¸¶¨¸ÃÀàÐ͵ÄÖ÷¼ü£¬mysqlÄܹ»×Ô¶¯¼ÓÒ»¡£
  ÔÚhibernateÓ³ÉäÎļþÖУ¬¹ØÓÚÖ÷¼üµÄÅäÖò»ÄÜÊÇ
<generator class="increment"&g ......

MySQLѧϰ±Ê¼Ç

Ò»¡¢MySQL»ù±¾ÃüÁºÏ£º
1¡¢  create database mydata£»//´´½¨Êý¾Ý¿â
2¡¢  use mydata; //ÔÚmydataÕâ¸öÊý¾Ý¿âϹ¤×÷
3¡¢  create table dept    //ÔÚmydataÊý¾Ý¿âÏ´´½¨±ídept
(
deptno int primary key,
dname varchar(14),
loc varchar(13)
);
 
create table emp  / ......

mysql ¶¨Ê±Êý¾Ý±¸·Ý

1.±àдshell½Å±¾
vi /data/www/project_name/bin/mysql_backup.sh
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by liuzheng

#ϵͳ±äÁ¿¶¨Òå
DBName=test
DBUser=root
DBPasswd=123456
BackupPath=/tmp/mysql_backup/

NewFile="$BackupPath"db$(date +%y%m%d ......

MySQL¿ª·¢Ð¡½á

       ×î½üÕýÔÚ½øÐÐÒ»¸ö¶þ´Î¿ª·¢½Ó¿ÚµÄÏîÄ¿£¬ÔÚ¿ª·¢¹ý³ÌÖз¢ÏÖ£ºÎÒÃÇ֮ǰʹÓõĴ¦Àí¿Í»§¶ËºÍWEBÖ®¼ä±àÂë¼æÈÝÎÊÌâµÄ·½·¨ÊÇ´æÔÚÎÊÌâµÄ¡£ÓÉÓÚΪÁËÖ§³Ö¶àÓïÑÔ£¬Êý¾Ý¿â±íÖÐÀàÐÍΪvarcharµÄ×ֶΣ¬ËûÃǵÄ×Ö·û¼¯¶¼ÉèÖóÉÁËutf8¡£Ö®Ç°µÄ×ö·¨ÊÇ¿Í»§¶Ë½«×Ö·û´®µÄ±àÂë¸Ä³Éutf8±àÂ룬Ȼºó½«¸Ãutf8±àÂëµÄ× ......

mysql µÄdelimiter

ÎÒÔÚ EMS SQL Manager 2005 for MySQL Õâ¸ö MySQL ͼÐοͻ§¶ËÏ¿ÉÒÔ˳ÀûÔËÐС£µ«ÊÇÔÚ SQLyog MySQL GUI v5.02 Õâ¸ö¿Í»§¶Ë¾Í»á³ö´í¡£×îºóÕÒµ½Ô­ÒòÊÇûÓÐÉèÖúà delimiter µÄÎÊÌ⡣ĬÈÏÇé¿öÏ£¬delimiter “;” ÓÃÓÚÏò MySQL Ìá½»²éѯÓï¾ä¡£ÔÚ´æ´¢¹ý³ÌÖÐÿ¸ö SQL Óï¾äµÄ½áβ¶¼Óиö “;”£¬Èç¹ûÕâʱºò£¬Ã¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ