mysqlÖÐuseµÄ×÷ÓÃ
mysql µÄ use ÏÂÁîÓÃÓÚÔڻỰÖÐѡժҪʹÓõÄÊý¾Ý¿â£¬½«ºóÐøÅÌÎʺͲÙ×÷Ó¦ÓÃÓÚÖ¸¶¨µÄÊý¾Ý¿â¡£
MySQL ÖÐ USE ÏÂÁîµÄ×÷ÓÃ
¼ò½é
USE ÏÂÁîÔÚ MySQL ÖÐÓÃÓÚѡժҪʹÓõÄÊý¾Ý¿â¡£Ëü¸æËß MySQL ½«ºóÐøÅÌÎʺͲÙ×÷Ó¦ÓÃÓÚÖ¸¶¨µÄÊý¾Ý¿â¡£
Óï·¨
USE database_name;
µÇ¼ºó¸´ÖÆ
¹¦Ð§
USE ÏÂÁîÖ´ÐÐÒÔϲÙ×÷£º
Ñ¡ÔñÖ¸¶¨µÄÊý¾Ý¿â¡£
½«ºóÐøÅÌÎʺͲÙ×÷Ó¦ÓÃÓÚÒÑÑ¡ÔñµÄÊý¾Ý¿â¡£
Ó°ÏìËùÓкóÐø»á»°ÖеÄÄ¿½ñÊý¾Ý¿â¡£
ʾÀý
USE my_database; SELECT * FROM users; -- ÅÌÎÊ my_database ÖÐµÄ users ±í
µÇ¼ºó¸´ÖÆ
ÓÅÊÆ
ʹÓà USE ÏÂÁîµÄÓÅÊÆ°üÀ¨£º
Ã÷È·Êý¾Ý¿âÑ¡Ôñ£ºËüÃ÷È·Ö¸¶¨ÒªÊ¹ÓõÄÊý¾Ý¿â£¬×èÖ¹ÆçÒåºÍÒâÍâ¹ýʧ¡£
»á»°¼¶±ðÉèÖãºUSE ÏÂÁîÔڻỰ¼¶±ðÉèÖÃÄ¿½ñÊý¾Ý¿â£¬Ó°ÏìºóÐøËùÓвÙ×÷¡£
Àû±ãÇл»£ºËüʹÔÚ¶à¸öÊý¾Ý¿âÖ®¼äÇáËÉÇл»±äµÃÈÝÒס£
×¢ÖØÊÂÏî
ÒÔÏÂÊÇһЩʹÓà USE ÏÂÁîʱµÄ×¢ÖØÊÂÏ
ÈôÊÇÖ¸¶¨µÄÊý¾Ý¿â²»±£´æ£¬MySQL ½«·µ»Ø¹ýʧ¡£
USE ÏÂÁî²»½¨ÉèÊý¾Ý¿â¡£Òª½¨ÉèÊý¾Ý¿â£¬ÇëʹÓà CREATE DATABASE ÏÂÁî¡£
USE ÏÂÁî²»Ó°ÏìÆäËû»á»°µÄÄ¿½ñÊý¾Ý¿â¡£Ã¿¸ö»á»°¶¼ÓÐ×Ô¼ºµÄÄ¿½ñÊý¾Ý¿âÉèÖá£
ÒÔÉϾÍÊÇmysqlÖÐuseµÄ×÷ÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡