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

MySQL³£ÓõÄһЩÓÐЧÃüÁîÂÞÁÐ

¼ò¼òµ¥µ¥µÄÂÞÁÐһЩÈÕ³£³£ÓõÄMySQLÃüÁî¡£
show variables;
²é¿´Êý¾Ý¿âÅäÖõÄһЩÅäÖÃÏî
show status;
²é¿´µ±Ç°Æô¶¯µÄMySQL״̬
select @@autocommit;
²é¿´MySQLµ±Ç°Ö´ÐÐSQLµÄÌá½»ÀàÐÍ£¨ÊÇ·ñ×Ô¶¯Ìá½»£©
\s
µ±Ç°Á¬½ÓÊý¾Ý¿âÃû£¬Óû§Ãû£¬MySQL°æ±¾£¬×Ö·û¼¯µÈµÈ¡£
show create table table_name \G
²é¿´´´½¨±íµÄSQLÓï¾ä
describe table_name; µÈ¼ÛÓÚ show columns from table_name;
²é¿´±íµÄÿ¸ö×Ö¶ÎÏêϸÐÅÏ¢
show table status like "test" \G
²é¿´±íµÄ״̬£¬Èç±íÒýÇæÀàÐÍ£¬×Ö¶Î×î´ó³¤¶È£¬Ë÷Òý×î´ó³¤¶È£¬×ÔÔö³¤×ֶεÄÖµ£¬±í´´½¨Ê±¼ä£¬×îºó¸üÐÂʱ¼äµÈµÈ¡£
select last_insert_id();
²é¿´µ±Ç°»á»°×îºóÒ»´ÎÖ´ÐÐinsertÓï¾äµÄinset idÖµ
insert delay into table_name (field1, field2) values (v1, v2);
ÑÓ³ÙInsert£¬¶ÔInnoDB±íÎÞЧ
show processlist \G
²é¿´Á¬½Óµ½Êý¾Ý¿âµÄÏß³ÌÐÅÏ¢£¬¿ÉÒԲ鿴±íÊÇ·ñ±»ËøסµÈµÈ
mysqladmin -uÓû§Ãû -p¾ÉÃÜÂë passwordÐÂÃÜÂë
ÐÞ¸ÄÃÜÂë
grant select [insert][,update][,delete][,all] on Êý¾Ý¿â.* to Óû§Ãû@localhost[,"%"] identifiedby "ÃÜÂë"
Ôö¼ÓÓû§Ãû
flush privileges
show engine bdb logs;
²é¿´MySQLÈÕÖ¾Îļþ·¾¶
show master status
²é¿´Ö÷¿âµÄ¶þ½øÖÆÎļþ״̬
show slave hosts
²é¿´×¢²áµ½µ±Ç°»úÆ÷µÄ´ÓÊô»úÆ÷


Ïà¹ØÎĵµ£º

MysqlµÄÓα꾿¾¹ÔõôÓÖӳÈպɻ¨±ðÑùºì


MysqlµÄÓα꾿¾¹ÔõôÓÖӳÈպɻ¨±ðÑùºì
Mysql´Ó5.0¿ªÊ¼Ö§³Ö´æ´¢¹ý³ÌºÍtrigger£¬¸øÎÒÃÇϲ»¶ÓÃmysqlµÄÅóÓÑÃǸüϲ»¶mysqlµÄÀíÓÉÁË£¬Óï·¨
ÉϺÍPL/SQLÓвî±ð£¬²»¹ý¸ã¹ý±à³ÌµÄÈ˶¼ÖªµÀ£¬Óï·¨²»ÊÇÎÊÌ⣬¹Ø¼üÊÇ˼Ï룬´óÖÂÁ˽âÓï·¨ºó£¬¾Í´Ó
±äÁ¿¶¨Ò壬ѭ»·£¬Åжϣ¬Óα꣬Òì³£´¦ÀíÕâ¸ö¼¸¸ö·½ÃæÏêϸѧϰÁË¡£¹ØÓÚÓαêµÄÓ÷¨M ......

MySQL ×Ö·û¼¯µ¼ÖÂSQLÁ¬½ÓÖ®ºóÖÐÎÄÂÒÂëµÄÎÊÌ⣡

character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊ ......

perlÒ»¸ö¼òµ¥mysql²Ù×÷µÄС³ÌÐò

#!/usr/bin/perl
use Mysql;
print "Content-type:
text/html \n\n";
# MySQL
ÅäÖñäÁ¿
$host = "localhost";
$database
= "testdb";
$tablename = "testtable";
$user = "username";
$pw =
"password";
# PERL MYSQL CONNECT()
$connect = ......

MySQL 5.1ÍêȫжÔØ

ÓÉÓÚ°²×°MySQLµÄʱºò£¬ÊèºöûÓÐÑ¡Ôñµ×²ã±àÂ뷽ʽ£¬²ÉÓÃĬÈϵÄASCIIµÄ±àÂë¸ñʽ£¬ÓÚÊǽӶþÁ¬ÈýµÄÖÐÎÄת»»ÎÊÌâËæÖ®¶øÀ´£¬¾ÍÏëжÔØÁËÖØа²×°MYSQL£¬ÕâһжÔص¹ÊdzöÁËÎÊÌ⣬µ¼Ö°²×°µÄʱºò°²×°²»ÉÏ£¬ÔÚÍøÉÏÕÒÁËÒ»¸ö¶àСʱҲû½â¾ö¡£
ÖØװϵͳÓÀÔ¶ÊǸöºÃ°ì·¨£¬µ«ÓÐ˭ϲ»¶Õâô×öѽ:(
ºóÀ´ÎÞÒâ·¢ÏÖÊÇжÔصÄʱºòûÓÐжÔØÍêÈ«µ¼Ö£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ