Á½ÖÖת»»mysqlÊý¾Ý±àÂëµÄ·½·¨
±³¾°£ºÄ³¸öϵͳµÄmysqlÊý¾Ý¿âdnname²ÉÓÃĬÈϵÄlatin1×Ö·û¼¯£¬ÏµÍ³Éý¼¶ÐèÒª½«ËùÓÐÊý¾Ýת»»³Éutf-8¸ñʽ£¬Ä¿±êÊý¾Ý¿âΪnewdbname(½¨¿âʱʹÓÃutf8)
·½·¨Ò»£º
²½ÖèÒ» ÃüÁîÐÐÖ´ÐУºmysqldump --opt -hlocalhost -uroot -p*** --default-character-set=lantin1 dbname > /usr/local/dbname.sql
²½Öè¶þ ½« dbname.sqlÎļþÖеÄcreate tableÓï¾äµÄCHARSET=latin1¸ÄΪCHARSET=utf8
²½ÖèÈý ÔÚdbname.sqlÎļþÖеÄinsertÓï¾ä֮ǰ¼ÓÒ»Ìõ'set names utf8;'
²½ÖèËÄ ½«dbname.sqlתÂëΪutf-8¸ñʽ£¬½¨ÒéʹÓÃUltraEditor£¬¿ÉÒÔÖ±½ÓʹÓøñà¼Æ÷µÄ'ת»»->ASCIIµ½UTF-8(Unicode±à¼)'£¬»òÕß½«ÎļþÁí´æΪUTF-8(ÎÞBOM)¸ñʽ
²½ÖèÎå ÃüÁîÐÐÖ´ÐУºmysql -hlocalhost -uroot -p*** --default-character-set=utf8 new_dbname < /usr/local/dbname.sql
×ܽ᣺ÕâÖÖ·½·¨ÓиöÖÂÃüÖ®´¦¾ÍÊǵ±Êý¾ÝÖÐÓдóÁ¿ÖÐÎÄ×Ö·ûºÍÆäËûÌØÊâ·ûºÅ×Ö·ûʱ£¬ºÜÓпÉÄܵ¼ÖÂÔÚ[²½ÖèÎå]ʱ±¨´íµ¼ÖÂÎÞ·¨Õý³£µ¼ÈëÊý¾Ý£¬Èç¹ûÊý¾Ý¿â±È½Ï´ó¿ÉÒÔ·Ö±ð¶ÔÿÕűíÖ´ÐÐÉÏÊö²½Öè
·½·¨¶þ£¨ÍƼö´ó¼ÒʹÓã©£º
ΪÁ˽â¾öµÚÒ»ÖÖ·½·¨ÖÐ×ܽáʱ˵µ½µÄÎÊÌ⣬ÔÚÍøÉÏ¿à¿à²éÕÒÁËÒ»Ìì×ÊÁϲŶ«Æ´Î÷´ÕµÄ¸ã³öÒ»¸ö±È½ÏÎÈÍ׵Ľâ¾ö·½·¨
²½ÖèÒ» ½«´ýµ¼³öµÄÊý¾Ý±íµÄ±í½á¹¹µ¼³ö£¨¿ÉÒÔÓÃPhpmyadmin¡¢mysqldumpµÈ£¬ºÜ¼òµ¥¾Í²»ËµÁË£©£¬È»ºó½«µ¼³öµÄcreate tableÓï¾äµÄCHARSET=latin1¸ÄΪCHARSET=utf8£¬ÔÚÄ¿±ê¿ânewdbnameÖÐÖ´ÐиÃcreate tableÓï¾ä°Ñ±í½á¹¹½¨ºÃ£¬½ÓÏÂÀ´¿ªÊ¼µ¼³ö-µ¼ÈëÊý¾Ý
²½Öè¶þ ÃüÁîÐУº½øÈëmysqlÃüÁîÐÐÏ£¬mysql -hlocalhost -uroot -p*** dbname
²½ÖèÈý Ö´ÐÐSQL select * from tbname into outfile '/usr/local/tbname.sql';
²½ÖèËÄ ½«tbname.sqlתÂëΪutf-8¸ñʽ£¬½¨ÒéʹÓÃUltraEditor£¬¿ÉÒÔÖ±½ÓʹÓøñà¼Æ÷µÄ'ת»»->ASCIIµ½UTF-8(Unicode±à¼)'£¬»òÕß½«ÎļþÁí´æΪUTF-8(ÎÞBOM)¸ñʽ
²½ÖèÎå ÔÚmysqlÃüÁîÐÐÏÂÖ´ÐÐÓï¾ä set character_set_database=utf8; ×¢£ºÉèÖÃmysqlµÄ»·¾³±äÁ¿£¬ÕâÑùmysqlÔÚÏÂÒ»²½¶ÁÈ¡sqlÎļþʱ½«ÒÔutf8µÄÐÎʽȥ½âÊ͸ÃÎļþÄÚÈÝ
²½ÖèÁù ÔÚmysqlÃüÁîÐÐÏÂÖ´ÐÐÓï¾ä load data infile 'tbname.sql' into table newdbname.tbname;
×¢Ò⣺ǧÍò²»ÒªÍüÁ˵ÚËIJ½
²ÉÓõڶþÖÖ·½·¨£¬ËùÓÐÊý¾Ý¾ùÕý³£µ¼È룬ÇÒ¸ñʽת»»³É¹¦Ã»ÓÐÂÒÂë
СµÜµÚÒ»´ÎÔ´´£¬¸÷λÐǪ̈¶àÖ¸½Ì£¬^.^
Ïà¹ØÎĵµ£º
¡ù ¹ØÓÚMySQLµÄ1067´íÎó½â¾ö·½·¨ ¡ù
ÄÚÈÝ£º
*************
1
°²×°MYSQLºó¸ü¸ÄÁËROOTµÄÃÜÂëºóÓÃ
net startmysql
Æô¶¯Ê±ÎÒ¾ÍÓöµ½ÁËÕâÑùµÄÎÊÌ⣮ʹÓÃÒÔÏÂÃüÁîºó
c:\mysql\bin\mysqladmin-u root -p shutdown
ÔÙnet start mysql¾ÍûÓÐÕâ¸ö´íÎóÌáʾÁË!
*************
2
MySQLµÄ1067´íÎó
Q£ºÎÒµÄMysqlÅöµ½ÁË 1 ......
integer »òÕß int
int »òÕß java.lang.Integer
INTEGER
4 ×Ö½Ú
long
long Long
BIGINT
8 ×Ö½Ú
short
short Short
SMALLINT
2 ×Ö½Ú
byte
byte Byte
TINYINT
1 ×Ö½Ú
float
float Float
FLOAT
4 ×Ö½Ú
double
double Double
DOUBLE
8 ×Ö½Ú
b ......
¡¡ÍøÉÏÓкܶàµÄÎÄÕ½ÌÔõôÅäÖÃMySQL·þÎñÆ÷£¬µ«¿¼Âǵ½·þÎñÆ÷Ó²¼þÅäÖõIJ»Í¬£¬¾ßÌåÓ¦ÓõIJî±ð£¬ÄÇЩÎÄÕµÄ×ö·¨Ö»ÄÜ×÷Ϊ³õ²½ÉèÖòο¼£¬ÎÒÃÇÐèÒª¸ù¾Ý×Ô¼ºµÄÇé¿ö½øÐÐÅäÖÃÓÅ»¯£¬ºÃµÄ×ö·¨ÊÇMySQL·þÎñÆ÷Îȶ¨ÔËÐÐÁËÒ»¶Îʱ¼äºóÔËÐУ¬¸ù¾Ý·þÎñÆ÷µÄ”״̬”½øÐÐÓÅ»¯¡£
mysql> show global status;
¡¡¡¡¿ÉÒÔÁгöMySQL·þÎ ......
½«ExcelÊý¾Ýµ¼ÈëMySql
1.½«Ñ¡ÖеÄÊý¾Ý¿ì¶ù¿½±´µ½Ò»¸öTXTÎı¾ÎļþÖУ¨¼ÇµÃ°ÑºóÃæµÄ¿Õ¸ñÏûµô¡£¡££©£¬¼ÙÈç´æµ½“D:\data.txt”Õâ¸öλÖÃÀï¡£
2.¸ù¾ÝÒªµ¼ÈëµÄÊý¾Ý¿ì¶ù½¨Á¢MySqlÊý¾Ý¿âºÍ±í£¬È»ºó½øÈëÃüÁîÌáʾ·ûÀïʹÓÃÃüÁî
load data local infile 'D:\data.txt' into table exceltomysql fields terminated ......
À´Ô´£ºhttp://www.sudone.com/linux/mysql_debug.html
×÷ÕߣºAyou
ÎÒÒ»Ö±ÊÇʹÓÃmysqlÕâ¸öÊý¾Ý¿âÈí¼þ£¬Ëü¹¤×÷±È½ÏÎȶ¨£¬Ð§ÂÊÒ²ºÜ¸ß¡£ÔÚÓöµ½ÑÏÖØÐÔÄÜÎÊÌâʱ£¬Ò»°ã¶¼ÓÐÕâô¼¸ÖÖ¿ÉÄÜ£º
1¡¢Ë÷ÒýûÓн¨ºÃ£»
2¡¢sqlд·¨¹ýÓÚ¸´ÔÓ£»
3¡¢ÅäÖôíÎó£»
4¡¢»úÆ÷ʵÔÚ¸ººÉ²»ÁË£»
1¡¢Ë÷ÒýûÓн¨ºÃ
Èç¹û¿´µ½mysqlÏûºÄµÄcpuºÜ´ó£¬¿ÉÒÔÓ ......