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

mysql »ù´¡


Ò» . °²×°ÓëÅäÖÃMYSQL
¶þ . ³£ÓÃmysqlÃüÁîÐÐÃüÁî
1 .mysqlµÄÆô¶¯ÓëÍ£Ö¹
Æô¶¯MYSQL·þÎñ net start mysql
Í£Ö¹MYSQL·þÎñ net stop mysql
2 . netstat –na | findstr 3306 ²é¿´±»¼àÌýµÄ¶Ë¿Ú , findstrÓÃÓÚ²éÕÒºóÃæµÄ¶Ë¿ÚÊÇ·ñ´æÔÚ
3 . ÔÚÃüÁîÐÐÖеǽMYSQL¿ØÖÆ̨ , ¼´Ê¹Óà MYSQL COMMEND LINE TOOL
    Óï·¨¸ñʽ mysql –user=root –password=123456 db_name
       »ò mysql –u root –p123456 db_name
4 . ½øÈëMYSQLÃüÁîÐй¤¾ßºó , ʹÓÃstatus; »ò\s ²é¿´ÔËÐл·¾³ÐÅÏ¢
5 . Çл»Á¬½ÓÊý¾Ý¿âµÄÓï·¨ : use new_dbname;
6 . ÏÔʾËùÓÐÊý¾Ý¿â : show databases;
7 . ÏÔʾÊý¾Ý¿âÖеÄËùÓбí : show tables;
8 . ÏÔʾij¸ö±í´´½¨Ê±µÄÈ«²¿ÐÅÏ¢ : show create table table_name;
9 . ²é¿´±íµÄ¾ßÌåÊôÐÔÐÅÏ¢¼°±íÖи÷×ֶεÄÃèÊö
Describe table_name; ËõдÐÎʽ : desc table_name;
Èý ¡£ MySqlÖеÄSQLÓï¾ä
1 . Êý¾Ý¿â´´½¨ : Create database db_name;
Êý¾Ý¿âɾ³ý : Drop database db_name; ɾ³ýʱ¿ÉÏÈÅжÏÊÇ·ñ´æÔÚ£¬Ð´³É : drop database if exits db_name
2 . ½¨±í : ´´½¨Êý¾Ý±íµÄÓï·¨ : create table table_name (×Ö¶Î1 Êý¾ÝÀàÐÍ , ×Ö¶Î2 Êý¾ÝÀàÐÍ);
   Àý : create table mytable (id int , username char(20));
   ɾ±í : drop table table_name; Àý : drop table mytable;
8 . Ìí¼ÓÊý¾Ý : Insert into ±íÃû [(×Ö¶Î1 , ×Ö¶Î2 , ….)] values (Öµ1 , Öµ2 , …..);
Èç¹ûÏò±íÖеÄÿ¸ö×ֶζ¼²åÈëÒ»¸öÖµ,ÄÇôǰÃæ [ ] À¨ºÅÄÚ×Ö¶ÎÃû¿ÉдҲ¿É²»Ð´
   Àý : insert into mytable (id,username) values (1,’zhangsan’);
9 . ²éѯ : ²éѯËùÓÐÊý¾Ý : select * from table_name;
²éѯָ¶¨×ֶεÄÊý¾Ý : select ×Ö¶Î1 , ×Ö¶Î2 from table_name;
Àý : select id,username from mytable where id=1 order by desc;¶à±í²éѯÓï¾ä------------²ÎÕÕµÚ17ÌõʵÀý
10 . ¸üÐÂÖ¸¶¨Êý¾Ý , ¸üÐÂijһ¸ö×ֶεÄÊý¾Ý£¨×¢Ò⣬²»ÊǸüÐÂ×ֶεÄÃû×Ö£©
Update table_name set ×Ö¶ÎÃû=’ÐÂÖµ’ [, ×Ö¶Î2 =’ÐÂÖµ’ , …..][where id=id_num] [order by ×ֶΠ˳Ðò]
Àý : update mytable set username=’lisi’ where id=1;
OrderÓï¾äÊDzéѯµÄ˳Ðò , Èç : order by id desc(»òasc) , ˳ÐòÓÐÁ½ÖÖ : de


Ïà¹ØÎĵµ£º

MySQL´æ´¢ÒýÇæ

MySQLÓжàÖÖ´æ´¢ÒýÇ棺
MyISAM¡¢InnoDB¡¢MERGE¡¢MEMORY(HEAP)¡¢BDB(BerkeleyDB)¡¢EXAMPLE¡¢FEDERATED¡¢ARCHIVE¡¢CSV¡¢BLACKHOLE¡£
MySQLÖ§³ÖÊý¸ö´æ´¢ÒýÇæ×÷Ϊ¶Ô²»Í¬±íµÄÀàÐ͵Ĵ¦ÀíÆ÷¡£MySQL´æ´¢ÒýÇæ°üÀ¨´¦ÀíÊÂÎñ°²È«±íµÄÒýÇæºÍ´¦Àí·ÇÊÂÎñ°²È«±íµÄÒýÇ棺
¡ô MyISAM¹ÜÀí·ÇÊÂÎñ±í¡£ËüÌṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦¡ ......

MySQL´î½¨


Ò»¡¢MySQL°²×°£º
Ìí¼ÓϵͳÓû§£º
groupadd mysql (/usr/sbin/groupadd)
useradd -g mysql mysql
°²×°²½Ö裺
tar zxfv mysql-*.tar.gz(mysql-5.0.51a)
./configure --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user ......

QtÊý¾Ý¿â£¨¶þ£©Ìí¼ÓMySQLÊý¾Ý¿âÇý¶¯²å¼þ


±¾ÎÄÕÂÔ­´´ÓÚwww.yafeilinux.com ×ªÔØÇë×¢Ã÷³ö´¦¡£
ÔÚÉÏÒ»½ÚµÄĩβÎÒÃÇÒѾ­¿´µ½£¬ÏÖÔÚ¿ÉÓõÄÊý¾Ý¿âÇý¶¯Ö»ÓÐ3ÖÖ£¬ÄÇôÔõÑùʹÓÃÆäËûµÄÊý¾Ý¿âÄØ£¿ÔÚQtÖУ¬ÎÒÃÇÐèÒª×Ô¼º±àÒëÆäËûÊý¾Ý¿âÇý¶¯µÄ´úÂ룬ÈÃËüÃÇÒÔ²å¼þµÄÐÎʽÀ´Ê¹Óá£ÏÂÃæÎÒÃǾÍÒÔÏÖÔڱȽÏÁ÷ÐеÄMySQLÊý¾Ý¿âΪÀý£¬ËµÃ÷Ò»ÏÂÔõÑùÔÚQt CreatorÖÐÌí¼ÓÊý¾Ý¿âÇý¶¯²å¼þ ......

Éý¼¶mysqlÊý¾Ý¿âµÄ·½·¨

Éý¼¶mysqlÊý¾Ý¿âµÄ·½·¨£º
1.         ÏÂÔØ°²×°½éÖÊmysql-essential-5.1.46-win32.msi
¿ÉÒÔµ½¹ÙÍøhttp://www.mysql.com/click.php?e=35166»òÆäËûÍøվȥÏÂÔØ£»
2.         ±¸·ÝmysqlµÄÊý¾Ý£»
ÔËÐÐcmd´ò¿ªÃüÁîÌáʾ·û£¬½øÈëµ½mysqlÈí¼þµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ