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

UbuntuϳöÏÖMysql error(2002)µÄ½â¾ö·½·¨

      ¹ýÁËÒ»Õó×Óºó£¬ÎªÁËд·Ö²¼Ê½×÷Òµ£¬ÖØÐÂʹÓÃMysqlʱ£¬·¢ÏÖËäÈ»Æô¶¯³É¹¦ÁË£¬µ«ÊÇÁ¬½ÓµÄʱºòÈ¥³öÏÖÈçÏ´íÎó
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
¸ù¾ÝÌáʾÊÇ/var/run/mysqld/mysqld.sockÎļþ²»´æÔÚ¡£
Ϊʲô»áÕâÑùÄØ£¿
    ÔÚÍøÉÏÕÒÁËÕҴ𰸣¬·¢ÏÖÿ¸öÈË˵µÄ¶¼²»Ò»Ñù£¬¶øÇÒmysql.serverÎļþÖиù±¾¾Í²»´æÔÚ´´½¨/var/run/mysqld/mysqld.sockÎļþµÄÓï¾ä¡£
1.½â¾ö°ì·¨£º
    $mysql --help
    ¸ù¾Ý°ïÖú¿ÉÒÔ¿´µ½£¬mysqlĬÈÏʹÓÃsocketÎļþ/var/run/mysqld/mysqld.sockÎļþ£¬¶Ë¿Ú3306À´Á¬½Ómysql·þÎñÆ÷¡£ËùÒÔÎÒÃÇ¿ÉÒÔÐÞ¸ÄĬÈÏÁ¬½Ó²ÎÊýÀ´ÊÔÒ»ÊÔ¡£
    $mysql --socket=/tmp/mysql.sock
ÄÇô£¬ÔõÑùÖªµÀÐèÒª°ÑsocketÐÞ¸ÄΪ/tmp/mysql.sockÄØ£¿
ÎÒÊǸù¾Ý²é¿´mysql½ø³ÌµÃµ½µÄÏûÏ¢£¬Ê¹ÓÃÈçÏÂÃüÁ
    $ps aux|grep mysql
    ¿ÉÒÔ¿´µ½Æô¶¯µÄmysql½ø³ÌʹÓÃÁ˲ÎÊý--socket=/tmp/mysql.sock --port=3306¡£ËùÒÔʹÓÃÃüÁ
    $mysql --socket=/tmp/mysql.sockºó¾ÍÄܹ»³É¹¦Á¬½ÓÉÏmysql·þÎñÆ÷ÁË¡£
2.×·¸ù¾¿µ×
    ¸ù¾ÝÃüÁî
    $mysql --help
    µÄÊä³ö½á¹û¿ÉÒÔ¿´µ½£¬mysql»á°´Ë³Ðò¶ÁÈ¡ÅäÖÃÎļþ/etc/my.conf,/etc/mysql/my.conf,/usr/etc/my.con,~/.my.conf
    ÔÚ/etc/my.confÖпÉÒÔ¿´µ½
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
Õâ¾ÍÊÇΪʲômysql·þÎñÆ÷Æô¶¯ºóʹÓõÄsocketÊÇ/tmp/mysql.sock
    ÔÚ/etc/mysql/my.confÖпÉÒÔ¿´µ½
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_saft]
socket = /var/run/mysqld/mysqld.sock
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
ÕâÑù£¬Á½¸öÎļþÉèÖö¼Æ¥Å䣬µ¼ÖÂ/etc/mysql/my.confÖеÄ[client]¸²¸ÇÁË/etc/my.confÖеÄ[client]ÉèÖã¬ËùÒÔÁ¬½Ó²»ÕýÈ·¡£×î¼òµ¥µÄ°ì·¨ÊÇɾ³ýÕâ¸öÎļþ
    $sudo mv /etc/mysql/my.conf /etc/mysql/mysql.conf_backup
    È»ºóÔÙʹÓÃĬÈϲÎÊýÁ¬½Ómysql·þÎñÆ÷¾ÍÕý³£ÁË¡£


Ïà¹ØÎĵµ£º

mysql¶Ô×ÔÔöidÖØдÓ1ÅÅÐòµÄÁ½ÖÖ·½·¨

ʹÓÃmysqlʱ£¬Í¨³£±íÖлáÓÐÒ»¸ö×ÔÔöµÄid×ֶΣ¬µ«µ±ÎÒÃÇÏ뽫±íÖеÄÊý¾ÝÇå¿ÕÖØÐÂÌí¼ÓÊý¾Ýʱ£¬Ï£ÍûidÖØдÓ1¿ªÊ¼¼ÆÊý£¬ÓÃÒÔÏÂÁ½ÖÖ·½·¨¾ù¿É£º
·½·¨Ò»£º
alter table tablename drop column id;
alter table tablename add id mediumint(8) not null primary key auto_increment first;
·½·¨¶þ£º
alter table tab ......

MySQLÓëÊÂÎñ


MySQL5.X¶¼ÒѾ­·¢²¼ºÃ¾ÃÁË£¬µ«ÊÇ»¹ÓкܶàÈËÈÏΪMySQLÊDz»Ö§³ÖÊÂÎñ´¦ÀíµÄ£¬Õâ²»µÃ²»¹ÖËûÃÇÊǹª¹ÑÎŵģ¬Æäʵ£¬Ö»ÒªÄãµÄMySQL°æ±¾
Ö§³ÖBDB»òInnoDB±íÀàÐÍ£¬ÄÇôÄãµÄMySQL¾Í¾ßÓÐÊÂÎñ´¦ÀíµÄÄÜÁ¦¡£ÕâÀïÃ棬ÓÖÒÔInnoDB±íÀàÐÍÓõÄ×î¶à£¬ËäÈ»ºóÀ´·¢ÉúÁËÖîÈçOracleÊÕ
¹ºInnoDBµÈÁîMySQL²»Ë¬µÄÊÂÇ飬µ«ÄÇЩÉÌÒµÉϵĶ·ÕùÓë¼¼ÊõÎÞ¹ ......

ÓÃpythonÁ¬½ÓmysqlÊý¾Ý¿â


#
-*- encoding: gb2312 -*-
import
os, sys, string
import
MySQLdb
#
Á¬½ÓÊý¾Ý¿â
try
:
conn
=
MySQLdb.connect(host
=
'
localhost
'
,user
=
'
root
'
,passwd
=
'
xxxx
'
,db
=
'
test1
'
)
except
Exception, e:
print
e
sys.exit()
......

¶à·þÎñÆ÷¹²Ïísession(mysql)

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
//===========================================
// ³ÌÐò£º mysql-Based Session Class
// ¹¦ÄÜ£º »ùÓÚmysql´æ´¢µÄ Session ¹¦ÄÜÀà
// ×÷Õß: yejr
// ÍøÕ¾: http://imysql.cn
// ʱ¼ä: 2007- ......

gwt ext Á¬½ÓMySqlÊý¾Ý¿â

¸ÃÁ¬½Ó·½Ê½²ÉÓÃRPCÀ´·µ»ØÊý¾Ý¿â²éѯ½á¹û¡£
1.Ê×ÏÈÊÇ´´½¨ÆÕͨµÄGWT-EXT¹¤³Ì¡£¿ÉÒԲο¼1http://www.ibm.com/developerworks/cn/java/j-lo-gwtext1/#resources
    ϵÁРÈë ÃÅ  ½Ì³Ì¡£¾ßÌåͨѶ¹ý³Ì·þÎñÒ²¿É²Î¿¼ÉÏÊöµÄ×îºó²¿·Ö˵Ã÷¡£
2. ½ÓÏÂÀ´¾ÍÊÇÒª´´½¨GWT Remote ServiceÁË£¬ÔÚÔ­Óй¤³ÌÉÏnew-&g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ