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

pythonÁ´½Ómysql³£¼ûÎÊÌâ

PythonÓëMysql
Ò»¡¢°²×°MySQLdbÄ£¿é
ʹÓÃpythonÁ¬½ÓMysqlµÄǰÌᣬ¾ÍÊÇÐèÒªÒ»¸öÈÃpythonÁ¬½Óµ½MysqlµÄ½Ó¿Ú£¬Õâ¾ÍÊÇMySQLdbÄ£¿é¡£
ÑéÖ¤ÊÇ·ñÒѾ­°²×°ÁËMySQLdb£º
==========================================================
d:\usr\local\Python25>python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] onwin32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named MySQLdb
==========================================================
Èç¹ûÓÐÀàËÆÓÚÉÏÃæµÄ"No module named MySQLdb"£¬±íÃ÷MySQLdbÉÐδ°²×°»ò°²×°µÄ²»³É¹¦£¡
MySQL °æ±¾£º5.0.67
ÏÂÔØµØÖ·£ºhttp://dev.mysql.com/downloads/mysql/5.0.html#downloads
ÏÂÔØexeÎļþ²¢°²×°
==========================================================
Python °æ±¾£º2.5
ÏÂÔØµØÖ·£ºhttp://www.python.org/download/releases/2.5.4/
ÏÂÔØmsiÎļþ²¢°²×°
MySQLdb°æ±¾£º MySQLdb Windows binary for Python 2.5
ÏÂÔØµØÖ·£ºhttp://biohackers.net/wikiattach/Python2(2e)5/attachments/MySQL-python.exe-1.2.1_p2.win32-py2.5.exe
²Î¼û£ºhttp://forums.mysql.com/read.php?50,129618,140611#msg-140611
³£¼ûÎÊÌ⣺
1.ÎÞ·¨¶¨Î»³ÌÐòÊäÈëµã mysql_server_init ÓÚ¶¯Ì¬Á´½Ó¿â LIBMYSQL.dll ÉÏ¡£
----------------------------------------------------------------------------------------------------
D:\usr\local\Python25>python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\usr\local\Python25\Lib\site-packages\MySQLdb\__init__.py", line 19, in <module>
    import _mysql
ImportError: DLL load failed: ÕÒ²»µ½Ö¸¶¨µÄ³ÌÐò¡£
----------------------------------------------------------------------------------------------------
½â¾ö·½·¨£º°Ñmysq


Ïà¹ØÎĵµ£º

PythonΪÀඨÒå¡°¿½±´¹¹Ô캯Êý¡±

³õѧPython£¬Õâô×öºÃÏñÓеã2£¬´ÕºÏÄÜÓãº
class MyClass():
def __init__(self, n = 10):
self._Field = n
def __getitem__(self, range):
return MyClass(self._Field)
obj1 = MyClass()
obj2 = obj1
obj3 = obj1[:]
obj1._Field = 100
obj4 = MyClass(123)
print obj1._Field, obj2. ......

mysql Êý¾ÝÀàÐÍvarchar ×ÓжàÉÙ

  ×òÌìÉè¼ÆÊý¾Ý¿â±íµÄʱºò£¬ÒòΪʹÓÃvarchar²úÉúÁËÒìÒ飬½á¹ûÒ»²é·¢ÏÖÎÒÃÇÁ½¸öË­¶¼Ã»´í¡£
   MySQLÊý¾Ý¿âµÄvarcharÀàÐÍÔÚ4.1ÒÔϵİ汾ÖеÄ×î´ó³¤¶ÈÏÞÖÆÎª255£¬ÆäÊý¾Ý·¶Î§¿ÉÒÔÊÇ0~255»ò1~255£¨¸ù¾Ý²»Í¬°æ±¾Êý¾Ý¿âÀ´
¶¨£©¡£
  
ÔÚMySQL5.0ÒÔÉϵİ汾ÖУ¬varcharÊý¾ÝÀàÐ͵ij¤¶ÈÖ§³Öµ½ÁË65535£¬Ò ......

Óà OPTIMIZE TABLE ÓÅ»¯ mysql ±í


Óà OPTIMIZE TABLE ÓÅ»¯ mysql ±í
ʱ¼ä:2010-2-28À´Ô´:HaCMS¿ªÔ´ÉçÇø ×÷Õß:gangzhong
REPAIR TABLE `table_name` ÐÞ¸´±í OPTIMIZE TABLE `table_name` ÓÅ»¯±í myisamchk table.MYI ÐÞ¸´Ë÷Òý REPAIR TABLE ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄ±í¡£ myisamchk TABLE.MYI ÓÃÓÚÐÞ¸´±»ÆÆ»µµÄË÷ÒýÎļþ¡£ OPTIMIZE TABLE ÓÃÓÚ»ØÊÕÏÐÖõÄÊý¾Ý ......

ÔÚ Cygwin ÖбàÒë MySQL ¿Í»§¶Ë

ת×Ôhttp://www.phpvim.net/windows/build-mysql-client-on-cygwin.html
MinTTY ÊÇÒ»¸öСÇɵ«È´ºÜʵÓÃµÄ Cygwin ÖÕ¶Ë»ú£¬µ«ÓиöÑÏÖØµÄÎÊÌâ¾ÍÊÇÎÞ·¨µ÷Óý»»¥Ð﵀ Windows Ô­Éú³ÌÐò£¬±ÈÈç˵
mysql.exe£¬µ±ÄãÔÚ MinTTY ÖÐÊäÈëÈçϵÄÃüÁ
1
$ mysql -uroot
-p
±¾À´ mysql.exe »áÌáʾÊäÈëÃÜÂ룬µ«ÔÚ MinTTY ÖгÌÐò»áÖ± ......

Á˽âÊý¾Ý´æ´¢mysql¶Ô²âÊÔµÄÖúÒæ

¹ýÈ¥µÄÒ»¸öÔ£¬ÎҵŤ×÷ÖØÐͼÔںϷþÄ£¿éµÄ²âÊÔ¡£ÆÄÓÐһЩÊÕ»ñ¡£
´Ë´Î´óÁ¿ºÍmysql´ò½»µÀ£¬¶Ô²úÆ·µÄÊý¾Ý´æ´¢ÓÐÁ˱ȽÏÈ«ÃæµÄÕÆÎÕ¡£²¢´ÙʹºÍÖ´ÐÐÁËdbµÄ±í½á¹¹ºÍÊôÐԵļì²é¡£ºÏ·þͶ·Åºó£¬ÔÝδ·¢ÏÖÒò´íÎóÊý¾Ýµ¼ÖµÄbug»òʹʡ£
²¢ÔÚ²âÊÔ³õÆÚ¾Í¹Ø×¢ºÍ¼ì²âÐÔÄÜÖ¸±ê£¬´Ùʹ³ÌÐò×öÁËÒ»´ÎÐÔÄܲâÊÔ£»¶ÔͶ·ÅʱµÄ·çÏÕÔöÇ¿ÁËÔ¤·ÀºÍ¿ØÖÆ¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ