USE db_name
        USE db_name
        ステートメントでは、db_name
        に指定したデータベースを、後続のクエリのデフォルトのデータベースとして使用するよう
        MySQL
        に指示することができます。指定したデータベースは、セッションの終了まで、または別の
        USE
        ステートメントを発行するまでカレントデータベースになります。
      
mysql>USE db1;mysql>SELECT COUNT(*) FROM mytable; # selects from db1.mytablemysql>USE db2;mysql>SELECT COUNT(*) FROM mytable; # selects from db2.mytable
        USE
        ステートメントで特定のデータベースをカレントにしても、それによって、他のデータベースのテーブルにアクセスできなくなるわけではありません。次の例では、db1
        データベースの author
        テーブルと、db2 データベースの
        editor
        テーブルにアクセスします。
      
mysql>USE db1;mysql>SELECT author_name,editor_name FROM author,db2.editor->WHERE author.editor_id = db2.editor.editor_id;
        USE ステートメントは Sybase
        との互換性を確保するためのものです。
      
This is a translation of the MySQL Reference Manual that can be found at dev.mysql.com. The original Reference Manual is in English, and this translation is not necessarily as up to date as the English version.

