(תÔØ)MySQLÖÐUNIONºÍUNION ALLµÄÇø±ð
ÔÚÊý¾Ý¿â
ÖУ¬UNION
ºÍUNION
ALL
¹Ø¼ü×Ö¶¼Êǽ«Á½¸ö½á¹û¼¯ºÏ²¢ÎªÒ»¸ö£¬µ«ÕâÁ½Õß´ÓʹÓúÍЧ
ÂÊÉÏÀ´Ëµ¶¼ÓÐËù²»Í¬¡£
MySQL
ÖÐ
µÄUNION
UNIONÔÚ½øÐбíÁ´½Óºó»áɸѡµôÖظ´µÄ¼Ç¼£¬ËùÒÔÔÚ±íÁ´½Óºó»á¶ÔËù²úÉúµÄ½á¹û¼¯½øÐÐÅÅÐòÔËË㣬ɾ³ýÖظ´µÄ¼Ç¼ÔÙ
·µ»Ø½á¹û¡£Êµ¼Ê´ó²¿·ÖÓ¦ÓÃÖÐÊDz»»á²úÉúÖظ´µÄ¼Ç¼£¬×î³£¼ûµÄÊǹý³Ì±íÓëÀúÊ·±íUNION¡£È磺
select * from gc_dfys union select * from
ls_jg_dfys
Õâ¸öSQLÔÚÔËÐÐʱÏÈÈ¡³öÁ½¸ö±íµÄ½á¹û£¬ÔÙÓÃÅÅÐò¿Õ¼ä½øÐÐÅÅÐòɾ³ýÖظ´µÄ¼Ç¼£¬
×îºó·µ»Ø½á¹û¼¯£¬Èç¹û±íÊý¾ÝÁ¿´óµÄ»°¿ÉÄܻᵼÖÂÓôÅÅ̽øÐÐÅÅÐò¡£
MySQL
ÖеÄUNION ALL
¶øUNION
ALLÖ»ÊǼòµ¥µÄ½«Á½¸ö½á¹ûºÏ²¢ºó¾Í·µ»Ø¡£ÕâÑù£¬Èç¹û·µ»ØµÄÁ½¸ö½á¹û¼¯ÖÐÓÐÖظ´µÄÊý¾Ý£¬ÄÇô·µ»ØµÄ½á¹û¼¯¾Í»á°üº¬Öظ´µÄÊý¾ÝÁË¡£
´ÓЧÂÊÉÏ
˵£¬UNION ALL Òª±ÈUNION¿ìºÜ¶à£¬ËùÒÔ£¬Èç¹û¿ÉÒÔÈ·ÈϺϲ¢µÄÁ½¸ö½á¹û¼¯Öв»°üº¬Öظ´µÄÊý¾ÝµÄ»°£¬ÄÇô¾ÍʹÓÃUNION ALL£¬ÈçÏ£º
select * from gc_dfys
union all select * from ls_jg_dfys
TAG:
mysql
MySQL
Mysql
UNION
ALL
Ïà¹ØÎĵµ£º
±¸·ÝÊý¾Ý¿âÃüÁî:
mysqldump -u root --password=root --database helloworld
>helloworld_backup.sql
ÆäËûÓ÷¨:
1.µ¼³öÕû¸öÊý¾Ý¿â
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.µ¼³öÒ»¸ö±í
mysqldump -u Óû§Ãû -p Êý¾Ý¿âà ......
1.Ö±½ÓÔÚÊý¾Ý¿âÖÐÐ޸ļǼ
mysql> use mysql
mysql> update user set password = password(”new_password”) where user = “user_name”;
mysql> flush privileges;
ÆäʵÕâÖÖ·½·¨¾ÍÊǸüÐÂÒ»ÌõÊý¾Ý¿â¼Ç¼£¬ÓëÆÕͨupdateÓï¾ä²»Í¬µÄÊÇ£¬ÃÜÂë¼ÓÃÜ´æ´¢£¬ÐèÓÃpassword()º¯ÊýÀ´Éú³É£¬ÁíÒ»¸ö²»Í ......
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ ......
1 Apache
ÐÞ¸Ä documentroot ¸ùĿ¼
directory ·ÃÎʸùĿ¼ȨÏÞ
directoryindex ĬÈÏÊ×Ò³ ......