mysql
        クライアントは、通常、以下のように対話的に使用します。
      
shell> mysql database
        しかし、SQL
        コマンドをファイルに入力して、そのファイルから
        mysql
        に読み取らせることも可能です。これを行うには、実行するコマンドを含むテキストファイル
        text_file を作成します。
        そして、以下のように mysql
        を起動します。
      
shell> mysql database < text_file
        テキストファイルを USE db_name
        ステートメントで開始することもできます。この場合、コマンドラインでデータベース名を指定する必要はありません。
      
shell> mysql < text_file
        すでに mysql
        を実行中の場合、source
        コマンドを使用して SQL
        スクリプトを実行できます。
      
mysql> source filename;
        バッチモードの詳細については、項3.5. 「バッチモードでの mysql の使用」
        を参照してください。
      
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.

