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 –uroot –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£ÁôÇ°ÈýÌìµÄ
±¸·ÝÊý¾Ý¡£°Ñ±¸·ÝµÄÊý¾Ý´ò°ü²¢Ñ¹Ëõ£¬ÎļþÃûÒÔϵͳʱ¼äÃüÃû£¬´ò°üºóµÄ
±¸·ÝÎļþ·ÅÔÚÒ»¸öÌض¨µÄÎļþ¼ÐÏÂÃ棬ʵ¼ÊÉÏ£¬Ö»ÒªÊÇÒÔʱ¼äÃüÃû±¸·ÝÎļþ£¬
ls ÃüÁîºó£¬Îļþ½«×Ô¶¯°´Ê±¼äÅÅÐòµÄ£¬ÕâÑù¾Í¿ÉÒÔ·½±ãµÄɾ³ýÈýÌìÒÔÇ°µÄ±¸·ÝÎļþ£¬ÓÚÊÇ ......
MySQL ±¸·ÝºÍ»Ö¸´
ÖÜÁù, 2006/09/30 - 14:21 — yejr
MySQL ±¸·ÝºÍ»Ö¸´
×÷/ÒëÕߣºÒ¶½ðÈÙ£¨Email:
£©£¬À´Ô´£ºhttp://imysql.cn
£¬×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
ÈÕÆÚ£º2006/10/01
±¾ÎÄÌÖÂÛ MySQL µÄ±¸·ÝºÍ»Ö¸´»úÖ ......
ת×Ôhttp://amoeba.meidusa.com/wordpress/?p=24£¬Ò»¸öºÜºÃµÄ¹¤¾ß¡£¡£¡£¡£ÆÚ´ýÑо¿
ÐÞ¸´bugÁбí:
1¡¢ÐÞ¸´ÎÞ·¨½âÎöÅ׳öunknown statement£¨1.0.0ÐÂbug£©¡£½«ÎÞ·¨½âÎöµÃsqlĬÈÏÔÚdefaultPoolÖÐÖ´ÐÐ
2¡¢ÐÞ¸´union¹Ø¼ü×ÖÎÞ·¨½âÎöÎÊÌâ
3¡¢ÐÞ¸´º¯ÊýÇ°Ãæ! ÎÞ·¨½âÎöÎÊÌâ
4¡¢ÐÞ¸´order by ¡¢group by ºóÃæ´ø±í´ïʽµÃsql
ÏÂÔØµØ ......
×÷ÕߣºSky.Jian | ¿ÉÒÔÈÎÒâתÔØ, µ«×ªÔØʱÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ ºÍ ×÷ÕßÐÅÏ¢ ¼° °æȨÉùÃ÷
Á´½Ó£ºhttp://www.jianzhaoyang.com/database/amoeba_for_mysql | del.icio.us | Twitter it
ͬÊ Struct Chen µÄ Amoeba For MySQL ÏîÄ¿ÒѾ ³öÀ´²»¶Ìʱ¼äÁË£¬¿ÉһֱûÓÐʱ¼äºÃºÃÌåÑ飬×î½üÒ»Ö±ÔÚ×öһЩÈí¼þºÍÓ²¼þ ......
grant replication slave on *.* to 'guest'@'192.168.1.%' identified by '123456'
change master to master_host='192.168.1.190',master_user='guest',master_password='123456',master_port=3306
mysql> change master to master_host='192.168.1.190',master_user='guest',master_password='123456',master_log ......