LoginSignup
10
10

More than 5 years have passed since last update.

個人的によく使うMySQLとSQliteの対応メモ

Last updated at Posted at 2015-06-29

mysqlの接続方法

mysql -u ユーザ名 -pパスワード -h ホスト名 -P ポート番号 データベース名

sqliteの起動方法

sqlite3 db_file #ファイル名がデータベース名となる

操作比較

操作 msqyl sqlite
データベースの作成 create database データベース名; (コマンドライン起動時に)sqlite3 データベース名
データベースの確認 show databses;(dbの一覧) .databases(DBのファイルパスを表示)
データベースの指定 use データベース名 (コマンドライン起動時に)sqlite3 データベース名;
データベースのテーブル一覧 show tables .tables
テーブルのスキーマの確認 desc テーブル名 .schema テーブル名
CLI終了 exit もしくは quit .quit

調べ方

sqliteの場合は .helpコマンドがあるので、sqliteの使いかたが分からない場合はそこを参照したら良い

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10