MysqlÖ¸Á showÓ÷¨
MySQL showµÄÓ÷¨
a. show tables»òshow tables from database_name; // ÏÔʾµ±Ç°Êý¾Ý¿âÖÐËùÓбíµÄÃû³Æ
b. show databases; // ÏÔʾmysqlÖÐËùÓÐÊý¾Ý¿âµÄÃû³Æ
c. show columns from table_name from database_name; »òshow columns from database_name.table_name; // ÏÔʾ±íÖÐÁÐÃû³Æ
d. show grants for [email=[ft=#ffff00,4,]user_name@localhost]user_name@localhost[/email]; // ÏÔʾһ¸öÓû§µÄȨÏÞ£¬ÏÔʾ½á¹ûÀàËÆÓÚgrant ÃüÁî
e. show index from table_name; // ÏÔʾ±íµÄË÷Òý
f. show status; // ÏÔʾһЩϵͳÌض¨×ÊÔ´µÄÐÅÏ¢£¬ÀýÈ磬ÕýÔÚÔËÐеÄÏß³ÌÊýÁ¿
g. show variables; // ÏÔʾϵͳ±äÁ¿µÄÃû³ÆºÍÖµ
h. show processlist; // ÏÔʾϵͳÖÐÕýÔÚÔËÐеÄËùÓнø³Ì£¬Ò²¾ÍÊǵ±Ç°ÕýÔÚÖ´ÐеIJéѯ¡£´ó¶àÊýÓû§¿ÉÒԲ鿴
ËûÃÇ×Ô¼ºµÄ½ø³Ì£¬µ«ÊÇÈç¹ûËûÃÇÓµÓÐprocessȨÏÞ£¬¾Í¿ÉÒԲ鿴ËùÓÐÈ˵Ľø³Ì£¬°üÀ¨ÃÜÂë¡£
i. show table status; // ÏÔʾµ±Ç°Ê¹ÓûòÕßÖ¸¶¨µÄdatabaseÖеÄÿ¸ö±íµÄÐÅÏ¢¡£ÐÅÏ¢°üÀ¨±íÀàÐͺͱíµÄ×îиüÐÂʱ¼ä
j. show privileges; // ÏÔʾ·þÎñÆ÷ËùÖ§³ÖµÄ²»Í¬È¨ÏÞ
k. show create database database_name; // ÏÔʾcreate database Óï¾äÊÇ·ñÄܹ»´´½¨Ö¸¶¨µÄÊý¾Ý¿â
l. show create table table_name; // ÏÔʾcreate database Óï¾äÊÇ·ñÄܹ»´´½¨Ö¸¶¨µÄÊý¾Ý¿â
m. show engies; // ÏÔʾ°²×°ÒÔºó¿ÉÓõĴ洢ÒýÇæºÍĬÈÏÒýÇæ¡£
n. show innodb status; // ÏÔʾinnoDB´æ´¢ÒýÇæµÄ״̬
o. show logs; // ÏÔʾBDB´æ´¢ÒýÇæµÄÈÕÖ¾
p. show warnings; // ÏÔʾ×îºóÒ»¸öÖ´ÐеÄÓï¾äËù²úÉúµÄ´íÎó¡¢¾¯¸æºÍ֪ͨ
q. show errors; // Ö»ÏÔʾ×îºóÒ»¸öÖ´ÐÐÓï¾äËù²úÉúµÄ´íÎó
Ïà¹ØÎĵµ£º
1.¼ÓÔØmysqlÇý¶¯°üProperties->java Build Path->Libraries->Add External JARs...
2.Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/Êý¾Ý¿âÃû?user=root&password=ÃÜÂë"); ......
·ÅÔÚÕâÀﱸÍü,ÀÏÊÇÍü¼ÇÔõôд¡£
mysql> create database book;
mysql> use book;
Database changed
mysql> create table email_message(key_mail_messages INTEGER,
-> date_created VARCHAR(19),
-> date_updated varchar(19),
-> date_email varchar(19),
-> addr_from va ......
ʹÓÃPorts·½Ê½ÔÚFreeBSDÏÂÅäÖÃMySQL,Apache,PHP
ÓôÃÆÁ˺ü¸Ìì,ÖÕÓÚÔÚFreeBSDϽ«MySQL,Apache,PHPµÄ»·¾³ÅàÖ²ºÃÁË.ϱ߰ÑÅäÖò½ÖèºÍ×¢ÒâµãÂÞÁÐÔÚϱß,ºÍ´ó¼Ò·ÖÏí.
FreeBSD°æ±¾ÊÇ7.3,MySQL°æ±¾ÊÇ5.0.90,Apache°æ±¾ÊÇ2.2.14£¨1.3.42£©,PHP°æ±¾ÊÇ5.2.12.Îҵݲװ˳ÐòÊÇÏÈMySQL,È»ºó°²×°ApacheºÍPHP,Ò»°ãÊÇ°²×°Í ......
MySQL²éѯ±íÄÚÖظ´¼Ç¼
²éѯ¼°É¾³ýÖظ´¼Ç¼µÄ·½·¨
(Ò»)
1¡¢²éÕÒ±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select * from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
2¡¢É¾³ý±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΠ......
1.ÏÂÔØ MySQL 6.0Ãâ°²×°°æ
http://www.mysql.com/downloads/mirror.php?id=386828
2.½« MySQL6.0 ½âѹµ½´ý°²×°Ä¿Â¼(×Ô¼º¾ö¶¨·Åµ½ÄÄ£©¡£½âѹºóĬÈÏÎļþ¼ÐÃû³ÆΪ£ºmysql£¨µ±È»¿ÉÒÔ×Ô¼º¸ü¸Ä£©£¬È»ºóÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¨ÕâÑù£¬ÒÔºó¿ÉÒÔÓÃ%MYSQL_HOME%ÒýÓð²×°Ä¿Â¼£©¡£È磬ÎÒ·ÅÔÚEÅ̸ùĿ¼Ï£¬ËùÒÔ£¬MYSQL_HOMEÉèÖÃΪ ......