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

ÔÙ̸mysqlµÄÅäÖÃÎļþmy.ini or my.cnf (Ö®Ò»)

ÈçÈôתÔر¾ÎÄ£¬Çë×¢Ã÷ԭʼ³ö´¦£ºhttp://hi.baidu.com/hexiong/blog/item/e860e5dd9b0d3ae376c6381a.html
(hexiong@baidu or iihero@CSDN)
ż¶ûÅöµ½ÓÐÈËÎÊʹÓÃmysqlÃüÁîÐУ¬ÀÏÈÃÈËÊäÈë--default-character-set=gbkÖ®ÀàÎÞÁĵÄÑ¡ÏÈÃÈË·³¡£ÈÃÈ˶àÊäÈëÁ˼¸¸ö×Ö·û£¬È·ÊµÓе㲻¶Ô¾¢¡£
¼ÓÉÏÓÐʱºò×Ô¼ºÓÐʱºòDIY£¬ºÜÉÙÔÚwindowsÉÏʹÓð²×°µÄ°æ±¾£¬×ÜÊǽâѹËõ£¬È»ºó·ÅÒ»¸ömy.iniµ½½âѹËõĿ¼Ï±ߵÄijһ¸öÌØÊâµÄλÖá£ÕâÑù£¬mysqlÃüÁîÐУ¬È±Ê¡Çé¿öÏ£¬·´¶øload²»µ½Õâ¸öÅäÖÃÎļþÁË¡£
¹ØÓÚmy.iniÎļþµÄ¼ÓÔØ˳Ðò£¬Ïê¼û£ºhttp://hi.baidu.com/hexiong/blog/item/313534a8b7e0dcbdcb130cc5.html
ÒÔwindowsΪÀý£¬Ëü»áÕâÑù¼ÓÔØ£º
C:\WINDOWS\my.cnf¡¡C:\WINDOWS\my.ini¡¡C:\my.cnf ¡¡C:\my.ini
ÖÁÓÚ$installdir\my.ini£¬ºÙ, ²»ÊÇ°²×°°æ£¬Õâ¸ö±äÁ¿¹À¼ÆÊǶÁ²»µ½ÁË¡£
ÉÏÊöËĸöÎļþ£¬Ö»ÒªÇ°ÃæµÄijһ¸öÎļþ¼ÓÔسɹ¦£¬¾Í²»ÔÙ¼ÓÔغó±ßÖ¸¶¨µÄÅäÖÃÎļþÁË¡£
ËùÒÔ£¬ÒªÏëʹmysqlÃüÁîÐÐÖ±½ÓʹÓÃgbk×Ö·û¼¯£¬ÓÐÏÂÊö·½·¨£º
1. ÃüÁîÐУº
mysql -u test -p --default-character-set=gbk
2. ÃüÁîÐУº
mysql --defaults-file=<your real my.ini path> -u test -p
×¢Òâ --defaults-fileÓÀÔ¶Òª·Åµ½µÚÒ»¸ö²ÎÊýµÄλÖÃ
3. Ö±½ÓÖÆ×÷Ò»¸ö¿Í»§¶Ë°æ±¾µÄmy.ini£¬È磺
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[client]
port        = 3306
default_character_set=gbk
°ÑËü´æµ½c:\my.ini
ÕâÀïÐèҪ˵Ã÷µÄÊÇ£º
Èç¹ûÄ㶨ÖƵÄmysqlÖÐmy.iniÎļþ±¾À´¾ÍÔÚÉϱß4¸ö·¾¶ÀïÍ·£¬Ö±½ÓÐÞ¸ÄÀï±ß[client]ϵÄdefault_character_setֵΪgbkºÃ¿É¡£·ñÔò¾Í¿ÉÒÔÉú³ÉÒ»¸öרΪclientʹÓõÄmy.ini
·½·¨3ËäÈ»·½±ã£¬µ«ÒòΪÊÇÈ«¾ÖÅäÖÃÎļþ£¬ËùÒÔÓÐʱºò²»Ãâ»áÏ໥ӰÏ죬ÓÈÆäÊÇһ̨»úÆ÷Óжà¸ömysql¡£
Õâ¸öʱºò£¬¿ÉÒÔʹÓÃÃüÁîÐУº
d:\>mysql -u test -p --default-character-set=latin1
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 5.0.9-beta-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show variables like 'char%';
+--------------------------+-------------------------------------------+
| Variable_name      


Ïà¹ØÎĵµ£º

MySQLÊý¾Ý¿âÉè¼ÆÔ­Ôò

ת×Ô http://www.supidea.com/post/mysql_design_database.aspx
MySQLÊý¾Ý¿âÉè¼ÆÔ­Ôò
MySQL¶ÔÓÚ³ÉΪһ¸ö·Ç³£¿ìËÙµÄÊý¾Ý¿â·þÎñÆ÷ÓÐ×ŵ±Ö®ÎÞÀ¢µÄÃûÉù£¬ËüÒ²·Ç³£ÈÝÒ×ÉèÖúÍʹÓá£Ëæ×ÅËü×÷ΪÍøÕ¾ºó¶ËÊý¾Ý¿âµÃÉùÍûÈÕÔö£¬ÆäЧ¹ûÔÚÈ¥Ä꿪ʼÓÐÃ÷ ÏÔÌá¸ß¡£µ«ÊǺܶàMySQLÓû§¸ü¶àµØÖªµÀÈçºÎ´´½¨Ò»¸öÊý¾Ý¿â²¢±àд¶ÔËüµÄ²éѯ¡£¾ÍÏñ³ÉÇ ......

MysqlÍü¼ÇrootÃÜÂëµÄ½â¾ö°ì·¨

ÔÚwindowsÏ£º
´ò¿ªÃüÁîÐд°¿Ú£¬Í£Ö¹mysql·þÎñ(»òÕßÔÚÈÎÎñ¹ÜÀíÆ÷Àï½áÊøµômysqld-nt.exe½ø³Ì)£º        Net stop mysql
Æô¶¯mysql£¬Ò»°ãµ½mysqlµÄ°²×°Â·¾¶£¬ÕÒµ½ mysqld-nt.exe
Ö´ÐУºmysqld-nt --skip-grant-tables
ÁíÍâ´ò¿ªÒ»¸öÃüÁîÐд°¿Ú£¬Ö´ÐÐmysql
use mysql
update us ......

»ù´¡ JAVA¶ÔMysql½øÐÐÁ¬½Ó¡¢²åÈë¡¢Ð޸ġ¢É¾³ý²Ù×÷

Êý¾Ý¿â±íµ¥µÄ´´½¨
mysql> create database shuishengmu;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql    & ......

mysql text ³¤¶È


mysql text ³¤¶È
ÎÄÕ·ÖÀà:Êý¾Ý¿â
½ñÌìÔÚ×öDBÉè¼ÆµÄʱºòÔÚÏëÓÃTEXT ÊÇ·ñÄܹ»Âú×㽫À´µÄÊý¾Ý£¬Äܹ»³öÏÖ×°²»ÏµÄÇé¿ö¡£
ºóÀ´²éѯÁËһϹٷ½ÊÖ²áµÃµ½ÁËÒ»¸ö´ð°¸¡£
Ò»¸öBLOB»òTEXTÁУ¬×î´ó³¤¶ÈΪ65535(2^16-1)¸ö×Ö·û¡£
MEDIUMBLOB 
MEDIUMTEXT 
Ò»¸öBLOB»òTEXTÁУ¬×î´ó³¤¶ÈΪ16777215(2^24-1)¸ö×Ö·û¡£
LONG ......

PHPÓëMySQL¿ª·¢ÖеÄ×Ö·û±àÂëÎÊÌâ

Ò»£®¹ØÓÚMySQLÊý¾Ý¿â·þÎñÆ÷
MySQL·þÎñÆ÷µÄĬÈϱàÂëÊÇLatin1£¬²»Ö§³ÖÖÐÎÄ£¬ÄÇôÈçºÎÐÞ¸ÄMySQLµÄĬÈϱàÂëÄØ£¬ÏÂÃæÒÔUTF-8ΪÀýÀ´ËµÃ÷¡£
1¡¢ÖÐÖ¹MySQL·þÎñ£¨bin/mysqladmin -u root shutdown£©
2¡¢ÔÚ/etc/ÏÂÕÒµ½my.cnf£¬Èç¹ûûÓоͰÑMySQLµÄ°²×°Ä¿Â¼ÏµÄsupport-filesĿ¼ÏµÄmy-medium.cnf¸´ÖƵ½/etc/ϲ¢¸ÄÃûΪmy.cnf¼´¿É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ