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

mysql±àÂëÎÊÌâ

Ê×ÏÈÉèÖÃmysqlµÄ±àÂëΪutf8
ÔÚlinuxÏÂÐ޸ģ³¸ömy.cnfµÄ£±¸ö/etc/mysql
/my.cnfÎļþ
ÕÒµ½¿Í»§¶ËÅäÖÃ[client] ÔÚÏÂÃæÌí¼Ó
default-character-set=utf8 ĬÈÏ×Ö·û¼¯Îªutf8
ÔÚÕÒµ½[mysqld] Ìí¼Ó
default-character-set=utf8 ĬÈÏ×Ö·û¼¯Îªutf8
init_connect='SET NAMES utf8' £¨É趨Á¬½Ómysql
Êý¾Ý¿âʱʹÓÃutf8±àÂ룬ÒÔÈÃmysql
Êý¾Ý¿âΪutf8ÔËÐУ©
²é¿´mysql±àÂë
¶¼ÉèÖÃΪutf8ºó£¬´ÓÎļþµ¼Êý¾Ýµ¼Êý¾Ý±íÖУ¬ÎļþÖÐÎÄÕý³££¬±àÂëÒ²ÊÇutf8£¬·¢ÏÖÔÚmysql²éѯʱ£¬ÖÐÎĶ¼³ÉÂÒÂ룬
load data infile 'result1.txt' into table test character set 'utf8' fields escaped by '"' terminated by ','
optionally enclosed by '"' lines terminated by '\n' (flag,words,tappend,content); µ¼ÈëÊý¾ÝʱҲָ¶¨utf8±àÂ룬ÖÐÎijÉÂÒÂëºÜÓпÉÄÜʱ½¨±íµÄʱºò±íµÄ±àÂë²»ÊÇutf8£¬´Ëʱ¿ÉÒÔÖØÐÂɾ³ý±íºóÖØн¨±í£¬½¨±íÊÇÖ¸¶¨±àÂë
create table mytest (name varchar(20) not null default '') default charset utf8;


Ïà¹ØÎĵµ£º

MySQL MyIsam ´æ´¢ÒýÇæË÷Òý³¤¶ÈÏÞÖƲâÊԼǼ

MySQL MyIsam ´æ´¢ÒýÇæÔÚ´´½¨Ë÷ÒýµÄʱºò£¬Ë÷Òý¼ü³¤¶ÈÊÇÓÐÒ»¸ö½ÏΪÑϸñµÄ³¤¶ÈÏÞÖƵģ¬ËùÓÐË÷Òý¼ü×î´ó³¤¶È×ܺͲ»Äܳ¬¹ý1000£¬¶øÇÒ²»ÊÇʵ¼ÊÊý¾Ý³¤¶ÈµÄ×ܺͣ¬¶øÊÇË÷Òý¼ü×ֶζ¨Ò峤¶ÈµÄ×ܺ͡£ÏÂÃæ×ö¸ö¼òµ¥µÄ²âÊÔ£¬¼Ç¼һÏ¡£
root@sky:~# mysql -u sky -p -h127.0.0.1
Enter password:
Welcome to the MySQL monitor. Command ......

MySQL²éѯ¼°É¾³ýÖظ´¼Ç¼µÄ·½·¨

 ²éѯ¼°É¾³ýÖظ´¼Ç¼µÄ·½·¨
(Ò»)
1¡¢²éÕÒ±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select * from people
where peopleId in (select  peopleId  from  people  group  by  peopleId  having  count(peopleId) > 1)
2¡¢É¾³ý±íÖжàÓàµÄÖظ´¼Ç¼£ ......

MySQLÍü¼ÇÃÜÂë´¦Àí·½·¨

 ÔÚwindowsÏ£º
´ò¿ªÃüÁîÐд°¿Ú£¬Í£Ö¹mysql·þÎñ£º        Net stop mysql
Æô¶¯mysql£¬Ò»°ãµ½mysqlµÄ°²×°Â·¾¶£¬ÕÒµ½ mysqld-nt.exe
Ö´ÐУºmysqld-nt --skip-grant-tables µ±Ç°´°¿Ú½«»áÍ£Ö¹¡£
ÁíÍâ´ò¿ªÒ»¸öÃüÁîÐд°¿Ú£¬Ö´ÐÐmysql   Èç¹ûÌáʾûÓÐÕâ¸öÃüÁÏȽøÈëMYSQL ......

³¬¼¶¼òµ¥µÄphp+mysqlÁôÑÔ±¾Ô´Âë

 ¹²3¸öÎļþ
IncDB.phpÊý¾Ý¿âÁ¬½Ó
index.phpÊ×Ò³
InsetToDB.phpÊý¾Ý¿â²Ù×÷
Êý¾Ý¿âlguestbookÀïÃ潨±í
CREATE TABLE `intd` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) character set utf8 collate utf8_bin N ......

mysqlµ¥ÒýºÅºÍË«ÒýºÅµÄÓ÷¨

 Õâ¾ÍÒª´ÓË«ÒýºÅºÍµ¥ÒýºÅµÄ×÷Óý²Æð£º
Ë«ÒýºÅÀïÃæµÄ×ֶλᾭ¹ý±àÒëÆ÷½âÊÍÈ»ºóÔÙµ±×÷HTML´úÂëÊä³ö£¬µ«Êǵ¥ÒýºÅÀïÃæµÄ²»ÐèÒª½âÊÍ£¬Ö±½ÓÊä³ö¡£ÀýÈ磺
$abc='I love u';
echo $abc //½á¹ûÊÇ:I love u
echo '$abc' //½á¹ûÊÇ:$abc
echo "$abc" //½á¹ûÊÇ:I love u
ËùÒÔÔÚ¶ÔÊý¾Ý¿âÀïÃæµÄSQLÓï¾ä¸³ÖµµÄʱºòÒ²ÒªÓÃÔÚË«ÒýºÅ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ