SQLの窓

2017年04月24日


MySQL のコマンドプロンプトからの処理用バッチファイル

普通に MySQL をインストールすると、bin フォルダまでは階層が深いので、以下のように専用のバッチファイルを作れば、PATH 環境変数を使う必要もありません。

最初に mysql -u root -p でテストするといいと思います。

※ バッチファイルの終了は、exit です。
mysql_cmd.bat
@echo off
setlocal
set path=C:\Program Files\MySQL\MySQL Server 5.7\bin;%path%
prompt cmd(mysql)$G

cmd.exe /k cls

endlocal

MySQL に接続(パスワードは入力)
cmd(mysql)>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.7.18-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

この後、use データベース と show tables; で動作確認。

※ mysql終了は、exit または quit です。



タグ:MySQL
【MySQLの最新記事】
posted by lightbox at 2017-04-24 17:17 | MySQL | このブログの読者になる | 更新情報をチェックする
container 終わり



フリーフォントで簡単ロゴ作成
フリーフォントでボタン素材作成
フリーフォントで吹き出し画像作成
フリーフォントではんこ画像作成
ほぼ自由に利用できるフリーフォント
フリーフォントの書体見本とサンプル
画像を大きく見る為のウインドウを開くボタンの作成

CSS ドロップシャドウの参考デモ
イラストAC
ぱくたそ
写真素材 足成
フリーフォント一覧
utf8 文字ツール
右サイド 終わり
base 終わり