mysql Éè¼Æ±éÀú²éѯ½á¹ûÖеÄÿÐÐÊý¾ÝÓöµ½µÄÖî¶àÎÊÌâ
²»Í¬Êý¾Ý¿âÖ®¼äµÄÓï·¨²îÒ컹Õæ²»ÉÙ~Òª±ÀÀ£ÁË¡£
1.´´½¨´ø×ÔÔöÁÐÁÙʱ±í£ºcreate TEMPORARY table t(id int AUTO_INCREMENT PRIMARY key, u_name varchar(50));--Ϊʲô±ØÐëÒªÖ÷¼ü£¿£¡
ÏòÕâ¸öÁÙʱ±íÖвåÈëÊý¾Ý£ºinsert into t values(null, 'zdy');--Ϊʲôһ¶¨Òª¼Ónull£¿£¡
2.°ÑÒ»ÕűíµÄ²éѯ½á¹û²åÈëÁÙʱ±í£ºinsert into t(u_name) select u_name from user where u_type = 'ϵͳÓû§';
3.declareÓï¾äҪдÔÚ´æ´¢¹ý³ÌÖÐ...
4.while do ... end while Óï¾ä±ØÐëдÔÚ´æ´¢¹ý³ÌÖÐ...
Ïà¹ØÎĵµ£º
Õ⼸ÌìÊÖÍ·¿ª·¢µÄϵͳҪ×öÒ»¸öÀàËÆwindowsÕË»§µ½ÆÚʱ¼äµÄ¹¦ÄÜ£¬¿¼ÂÇÁË°ëÌìÏë³öÁËÒ»¸ö¼¼ÊõÉϺÍÂß¼É϶¼»¹ÄÜʵÏֵĽâ¾ö·½°¸£º
´´½¨Ò»¸öÓû§´æÈëÊý¾Ý¿âµÄʱºò¶¼´´½¨Ò»¸öʼþµ÷¶ÈÆ÷À´¿ØÖÆÓû§µÄµ½ÆÚʱ¼ä£¨mysqlµÄʱ¼äµ÷¶ÈÆ÷ȷʵºÜ·½±ã£©¡£ÏëÆðÀ´ÊǺܼòµ¥£¬µ«ÊÇ×öÆðÀ´ÎÊÌâȷʵһ²¨½ÓÒ»²¨...
һЩСÎÊÌâ¾Í²» ......
±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ£¬Äܹ»Èøñ¸·Ý¸²¸ÇÒÑÓÐÊý¾Ý¿â¶ø²»ÐèÒªÊÖ¶¯É¾³ýÔÓÐÊý¾Ý¿â¡£
mysqldump -–add-drop-table -uusername -ppassword databasename > backu ......
ÕªÒª£ºMySQLÊÇÒ»¸ö¸ßËٶȡ¢¸ßÐÔÄÜ¡¢¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ£¬ÊÊÓÃƽ̨¶à£¬¿ÉÀ©Õ¹ÐÔÇ¿¡£ÔÚʵ¼ÊÉú²ú»·¾³ÖУ¬²¿ÊðºÍʵÏÖ¾ßÓÐÒ»¶¨¸ºÔؾùºâ¹¦ÄܵÄMySQL·þÎñÆ÷
¼¯Èº£¬¶ÔÓÚÌá¸ßÓû§Êý¾Ý¿âÓ¦ÓÃϵͳµÄÐÔÄÜ¡¢ËٶȺÍÎȶ¨ÐÔ¾ßÓÐÃ÷ÏÔµÄ×÷Óᣱ¾ÎļòÒª½éÉÜÁËÔÚFreeBSD
7.0-ReleaseϵͳÉϲ¿ÊðʵÏÖMySQL·þÎñÆ÷
¼¯ÈºµÄ·½°¸£¬²¢¶Ô¿É ......
Ò»¡¢±íµÄµ¼Èëµ¼³öÓï¾ä¼°Ê±¼ä×Ö·û´®²¿·Ö´¦Àíº¯Êý
µ¼³öÊý¾Ý¿âËùÓбíµÄ½á¹¹ mysqldump -uroot -proot db_name -d > d:/export_db.sql(½áβ²»Ó÷ֺÅ)
µ¼³öÊý¾Ý¿âij¸ö±íµÄ½á¹¹ mysqldump -uroot -proot db_n ......
1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°È ......