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

MYSQLµÄ×Ö·û¼¯——×Ö·û¼¯ºÍУ¶Ô¹æÔò


1.ʲô½Ð×ö×Ö·û¼¯
×Ö·û¼¯¾ÍÊÇÒ»Ì×·ûºÅºÍ×Ö·û±àÂëµÄ¼¯ºÏ¡£
2.ʲô½Ð×öУ¶Ô¹æÔò
У¶Ô¹æÔò¾ÍÊÇÔÚ×Ö·û¼¯ÄÚÓÃÓڱȽÏ×Ö·ûµÄÒ»Ì×¹æÔò¡£
MYSQL5.1Êý¾Ý¿â¿ÉÒÔ×öµ½
·  Ê¹ÓöàÖÖ×Ö·û¼¯À´´æ´¢×Ö·û´®
·  Ê¹ÓöàÖÖУ¶Ô¹æÔòÀ´±È½Ï×Ö·û´®
·  ÔÚͬһ̨·þÎñÆ÷¡¢Í¬Ò»¸öÊý¾Ý¿â»òÉõÖÁÔÚͬһ¸ö±íÖÐʹÓò»Í¬×Ö·û¼¯»òУ¶Ô¹æÔòÀ´»ìºÏ×Ö·û´®
·  ÔÊÐí¶¨ÒåÈκ춱ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò
MYSQLÄܶ¨ÒåÏÂÃæ4ÖÖ¼¶±ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò£º
1.·þÎñÆ÷¼¶±ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£ºmysqld --default-character-set=latin1 --default-collation=latin1_swedish_ci
2.Êý¾Ý¿â¼¶±ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£º½¨Á¢¿âʱ£ºCREATE DATABASE db_name DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
Ð޸Ŀâʱ£ºALTER DATABASE db_name DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
3.±í¼¶±ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£º
½¨±í£ºCREATE TABLE tbl_name (column_list)  [DEFAULT CHARACTER SET charset_name [COLLATE collation_name]]
¸Ä±í£ºALTER TABLE tbl_name  [DEFAULT CHARACTER SET charset_name] [COLLATE collation_name]
4.Á춱ðµÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£ºcol_name {CHAR | VARCHAR | TEXT} (col_length) [CHARACTER SET charset_name [COLLATE collation_name]]
Á¬½Ó×Ö·û¼¯ºÍУ¶Ô¹æÔò
Õû¸öÁ¬½Ó¹ý³Ì°üÀ¨2¸ö½×¶Î£¬¿Í»§¶Ë·¢ËÍÇëÇ󣬷þÎñÆ÷¶ËÏìÓ¦ÇëÇó¡£ÆäÖÐÉæ¼°ÁË3ÖÖÁ¬½Ó¹ý³ÌÖеÄ×Ö·û¼¯ºÍУ¶Ô¹æÔò£º
1.µ±´Ó¿Í»§¶Ë·¢Ë͸ø·þÎñÆ÷¶ËµÄÇëÇóÊôÓÚÄÄÖÖ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£ºSET character_set_client = x;
2.·þÎñ¶ËÊÕµ½ÇëÇóºó£¬Ó¦¸Ã½«ÇëÇóת»»ÎªÄÄÖÖ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£ºSET character_set_results = x;
3.·þÎñ¶Ë·¢Ëͽá¹û¼¯»òÕß´íÎóÐÅÏ¢¸ø¿Í»§¶ËÓÃÄÄÖÖ×Ö·û¼¯ºÍУ¶Ô¹æÔò
ÉèÖ÷½·¨£ºSET character_set_connection = x;
×ÛºÏÉèÖ÷½Ê½£ºSET NAMES 'x'
Õâ¸öÓï¾äµÈ¼ÛÓÚÉÏÃæ3ÌõÓï¾äµÄ¼¯ºÏ£¬Ò²¾ÍÊÇ3ÖÐÇé¿ö¶¼Ê¹ÓÃÏàͬµÄ×Ö·û¼¯µÄʱºò£¬¿ÉÒÔÓÃÕâÒ»¾ä´úÌæÉÏÃæ3¾ä¡£
ÕâÑù´ó¼ÒÓ¦¸Ã¶Ô×Ö·û¼¯ºÍУ¶Ô¹æÔòÓÐЩÁ˽âÁË°É¡£
ÎÒÀ´½âÊÍһϴó¼ÒΪʲô»á³öÏÖÂÒÂëµÄÎÊÌâ¡£ÆäʵҲ¾ÍÊÇ3¸öÁ¬½Ó¹ý³ÌÖеÄ×Ö·û¼¯ºÍУ¶Ô¹æÔòÉ趨²»Æ¥Åä¡£
ÀýÈ磺Êý¾Ý¿â¶¨ÒåµÄ×Ö·û¼¯ÎªGB2312£¬¿ÉÊÇÒ³ÃæÒªÇóÏÔʾutf-8µÄ£¬ÄÇô¹âÅäÖÃSET NAMES 'utf8'ÊDz»Äܽâ¾öÎÊÌâµÄ¡£Ê×ÏÈ´Ó


Ïà¹ØÎĵµ£º

myeclipse mysql²»ÈòåÈëÖÐÎÄ

 Ê×ÏÈ¿´¿´ jspÎļþ java³ÌÐòÀïÓÐûÓÐrequest.setCharacterEncoding("UTF-8");
  ×Ö·û±àÂëÎÊÌ⣬Êý¾Ý²åÈë¿âÖÐʱ£¬java±àÂëºÍÊý¾Ý¿â±àÂë²»Ò»Ö£¬µ¼Ö²åÈëÊý¾Ý¿âΪÂÒÂ룬¿´µ½Îª£¿£¿£¿£¿µÄÐÎʽ  
  ½«ÄãµÄjspÒ³Ãæ±àÂë¸ÄΪGBK£¬Êý¾Ý¿â¶ÔÓ¦±íµÄ±àÂëÒ²¸ÄΪGBK
  ±àÂëÒ»Ö£¬¾Í²»»á³öÏÖÂÒÂëÎÊÌâÁ ......

Linux ƽ̨Ï MYSQL°²×° Æô¶¯ mysqlÃüÁî

MYSQL°²×°
//½âѹ±àÒë°²×°
# tar xzvf mysql-5.0.27.tar.gz
# cd mysql-5.0.27
# ./configure -prefix=/home/redadmin/mysql
# make
# make install
# cd /home/redadmin/mysql/
# cp share/mysql/my-medium.cnf ./
# mv my-medium.cnf my.cnf
// my.confÎļþÐÞ¸Ä
# vi my.cnf
ÐÞ¸ÄÇ°£º
port  &nb ......

JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,Oracle

import java.sql.*;
/*
* JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,OracleÊý¾Ý¿â
*
* */
public class JDBC {
  
public static void main(String[] args)throws Exception {
  
   Connection conn=null;
  
       //====Á¬½ÓACCESSÊý¾Ý¿â ......

MysqlÖд´½¨Óû§ÕÊ»§µÄ·½·¨

1.CREATE USER
CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']
    [, user [IDENTIFIED BY [PASSWORD] 'password']] ...
CREATE USERÓÃÓÚ´´½¨ÐµÄMySQLÕË»§¡£ÒªÊ¹ÓÃCREATE USER£¬Äú±ØÐëÓµÓÐmysqlÊý¾Ý¿âµÄÈ«¾ÖCREATE USERȨÏÞ£¬»òÓµÓÐINSERTȨÏÞ¡£¶ÔÓÚÿ¸öÕË»§£¬CREATE USER»áÔÚûÓÐȨÏÞµÄmysq ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ