mysqlÆô¶¯Åöµ½¹ýµÄÎÊÌâ
ÎÒµÄmysql×°ÔÚ/usr/local/mysqlĿ¼ÏÂÆô
¶¯Åöµ½¹ýºÜ¶àÎÊÌâ¡£×î³£¼ûµÄÊÇ£º
ERROR 2002: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111)
½â¾ö°ì·¨£º
[root@test mysql]# /usr/local/mysql/bin/mysqladmin -u root /
> -S /var/lib/mysql/mysql.sock password 'your.passwd'
»òÕß×ö¸öÁ¬½Ó
ln -s /var/lib/mysql/mysql.sock /tmp
ÆäʵÌáʾÕÒ²»µ½ /tmp/mysql.sockÓÐʱҲ²¢²»ÊÇ/tmpĿ¼ÏÂûÕâ¸öÎļþ£¬ÊÇÆô¶¯
ÃüÁî²»¶Ô£¬ÎÒÅöµ½¹ý
³£¼ûµÄ¼¸ÖÖÆô¶¯·½Ê½£¬×Ô¼ºÒ²²»ÊǼǵúÜÇå³þ£¬Èç¹ûÄãÈ·¶¨tmpÏÂÓÐmysql.sockÕâ
¸öÎļþ²»·ÁÊÔÊÔÁíÍâµÄ¼¸¸öÃüÁî
/usr/local/mysql/bin/mysql -u root -p
/usr/local/mysql/bin/mysqld --user=mysql&
/usr/local/mysql/bin/mysqld --user=root&
/usr/local/mysql/bin/mysqld_safe --user=root&
/usr/local/mysql/bin/mysqld_safe --user=mysql&
/usr/local/mysql/bin/safe_mysqld--uer=root&(×¢Òâsafe_mysqldÓë
mysqld_safeÊDz»Í¬µÄ£¬&±íʾmysqlÔÚºǫ́ÔËÐÐ)Îҵľͻᱨ´íÁË
STOPPING server from pid file
/usr/local/mysql/data/localhost.localdomain.pid
060304 11:46:21 mysqld ended
ÕâÊÇȨÏÞÎÊÌ⣬ÎÒµÄmysqlĿ¼ÊôÓÚrootÓû§£¬Ò²ÊôÓÚrootȺ×飬¸ÄÓÃmysqld_safeÆô¶¯¾ÍûÎÊÌâÁË£¬
´ó¼ÒֻҪעÒâÕ⼸¸ömysql,safe_mysqld,mysqld_safe,mysqld,mysqladmin.¶àÊÔ
¼¸´Î
ÆäʵÓÐʱmysqlÒѾÕý³£Æô¶¯ÁË£¬²é¿´mysqlÊÇ·ñÆô¶¯ÃüÁî
ps -aux | grep mysqld
»á¿´µ½ÈçÏÂÀàËÆÄÚÈÝ
mysql 6394 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
mysql 6395 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
mysql 6396 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
root 6422 0.0 1.1 2408 732 pts/3 S 16:20 0:00 grep
mysql
²é¿´mysqlÊÇ·ñÔÚ¼àÌý¶Ë¿ÚÃüÁî
netstat -tl | grep mysql
»á¿´µ½Èç
Ïà¹ØÎĵµ£º
ĬÈÏÇé¿öÏ£¬innodbµÄ²ÎÊýÉèÖõķdz£Ð¡£¬ÔÚÉú²ú»·¾³ÖÐÔ¶Ô¶²»¹»ÓÃ
±ÈÈç×îÖØÒªµÄÁ½¸ö²ÎÊý
innodb_buffer_pool_size
ĬÈÏÊÇ8M
innodb_flush_logs_at_trx_commit ĬÈÏÉèÖõÄÊÇ1 Ò²¾ÍÊÇͬ²½Ë¢ÐÂlog(¿ÉÒÔÕâôÀí½â)
innodb_buffer_pool_size£º
ÕâÊÇInnoDB×îÖØÒªµÄÉèÖ㬶ÔInnoDBÐÔÄÜÓоö¶¨ÐÔµÄÓ°Ï졣ĬÈϵÄÉèÖÃÖ»ÓÐ8M£¬ËùÒÔ ......
1)¡¢back_log£º
ÒªÇó MySQL ÄÜÓеÄÁ¬½ÓÊýÁ¿¡£µ±Ö÷ÒªMySQLÏß³ÌÔÚÒ»¸öºÜ¶Ìʱ¼äÄڵõ½·Ç³£¶àµÄÁ¬½ÓÇëÇó£¬Õâ¾ÍÆð×÷Óã¬È»ºóÖ÷Ï̻߳¨Ð©Ê±¼ä(¾¡¹ÜºÜ¶Ì)¼ì²éÁ¬½Ó²¢ÇÒÆô¶¯Ò»¸öÐÂÏ̡߳£
back_logÖµÖ¸³öÔÚMySQLÔÝʱֹͣ»Ø´ðÐÂÇëÇó֮ǰµÄ¶Ìʱ¼äÄÚ¶àÉÙ¸öÇëÇó¿ÉÒÔ±»´æÔÚ¶ÑÕ»ÖС£Ö»ÓÐÈç¹ûÆÚÍûÔÚÒ»¸ö¶Ìʱ¼äÄÚÓкܶàÁ¬½Ó£¬ÄãÐèÒªÔ ......
È¥mysqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØodbc connector(http://dev.mysql.com/downloads/connector/odbc/3.51.html)
ÏÂÔØµÄÊÇmysql-connector-odbc-noinstall-3.51.rar
½âѹºóÖ±½ÓÔËÐÐÎļþ¼ÐÖÐµÄ Install.bat Åú´¦ÀíÎļþ
mysql-connectorÓкü¸ÖÖ£¬Ñ¡ÔñÒ»¸ö×Ô¼ºÏ²»¶µÄ¼´¿É¡£
ÔÚxpÖдò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¨¿ØÖÆÃæ°å£¡·¹ÜÀí¹¤¾ß£¡·ODBCÊ ......
MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
  ......
ʵÀýÒ»£ºÎ޲εĴ洢¹ý³Ì
$conn = mysql_connect('localhost','root','root') or die ("Êý¾ÝÁ¬½Ó´íÎó!!!");
mysql_select_db('test',$conn);
$sql = "
create procedure myproce()
begin
INSERT INTO user (id, username, sex) VALUES (NULL, 's', '0');
end;
";
mysql_query($sql);//´´½¨Ò»¸ömyproceµÄ´æ´¢¹ý³Ì
......