Adminerを使用してデータベースを管理する方法
Adminerとは
Adminerは、MySQL、MariaDB、PostgreSQL、SQLiteなど、複数のデータベースシステムをサポートする軽量なデータベース管理ツールです。他のデータベース管理ツールと比較して、Adminerは次のような顕著なメリットがあります:
- 単一ファイルのデプロイ:Adminerは1つのPHPファイルだけで動作し、非常に簡単にデプロイして使用できます。
- 多くのデータベースをサポート:Adminerは複数のデータベースシステムを管理でき、開発者にとって多機能なツールとなります。
- シンプルなインターフェース:Adminerは直感的でシンプルなユーザーインターフェースを提供し、開発者が様々なデータベース操作を簡単に行えるようにします。
- 強力な機能:Adminerはデータベースの作成、変更、削除、テーブルの操作、SQLクエリの実行、データのインポートおよびエクスポートなど、完全なデータベース管理機能をサポートしています。
開発者にとって、Adminerは効率を向上させるだけでなく、データベース管理の複雑さを簡素化します。
Adminerへのアクセス
ServBayはAdminerを内蔵しているため、次のアドレスからAdminerにアクセスできます: https://servbay.host/adminer.php
Adminerを使用してServBay内蔵のMariaDB(MySQL)データベースを管理する
サーバーへのログイン
- ブラウザを開き、AdminerのURLにアクセスします。
- ログイン画面でデータベースタイプを"MySQL"に設定します。
- サーバー接続情報を入力します:
- ユーザー名とパスワード:ServBayの『設定』-『データベース』で取得できます。
- サーバー:
localhost
または/Applications/ServBay/tmp/mysql.sock
- "ログイン"ボタンをクリックし、データベース管理画面に入ります。
データベースの作成
- ログインに成功したら、左側メニューの"データベースを作成"をクリックします。
- データベース名を入力します。
- "保存"ボタンをクリックしてデータベースを作成します。
データの追加
- 作成したばかりのデータベースを選択します。
- "テーブルを作成"をクリックします。
- テーブル名とフィールド情報を入力します。
- "保存"ボタンをクリックしテーブルを作成します。
- 作成したテーブルを選択し、"挿入"をクリックします。
- データを入力し"保存"ボタンをクリックします。
データの削除
- 操作するテーブルを選択します。
- "選択"ボタンをクリックし、削除するデータ行を選択します。
- "削除"ボタンをクリックし、削除を確認します。
データベースの削除
- データベースリストから削除するデータベースを選択します。
- "削除"ボタンをクリックします。
- 削除操作を確認します。
Adminerを使用してServBay内蔵のPostgreSQLデータベースを管理する
サーバーへのログイン
- ブラウザを開き、AdminerのURLにアクセスします。
- ログイン画面でデータベースタイプを"PostgreSQL"に設定します。
- サーバー接続情報を入力します:
- ユーザー名とパスワード:ServBayの『設定』-『データベース』で取得できます。
- サーバー:
/Applications/ServBay/tmp
- データベース:
postgres
またはその他の管理権限のあるデータベース - "ログイン"ボタンをクリックし、データベース管理画面に入ります。
データベースの作成
- ログインに成功したら、左側メニューの"データベースを作成"をクリックします。
- データベース名を入力します。
- "保存"ボタンをクリックしてデータベースを作成します。
データの追加
- 作成したばかりのデータベースを選択します。
- "テーブルを作成"をクリックします。
- テーブル名とフィールド情報を入力します。
- "保存"ボタンをクリックしテーブルを作成します。
- 作成したテーブルを選択し、"挿入"をクリックします。
- データを入力し"保存"ボタンをクリックします。
データの削除
- 操作するテーブルを選択します。
- "選択"ボタンをクリックし、削除するデータ行を選択します。
- "削除"ボタンをクリックし、削除を確認します。
データベースの削除
- データベースリストから削除するデータベースを選択します。
- "削除"ボタンをクリックします。
- 削除操作を確認します。
Adminerを使用してSQLite 3データベースを管理する
サーバーへのログイン
- ブラウザを開き、AdminerのURLにアクセスします。
- ログイン画面でデータベースタイプを"SQLite 3"に設定します。
- データベースファイルパスを入力します:DBファイルは
/Applications/ServBay/db/sqlite
ディレクトリに配置することを推奨します。 - "ログイン"ボタンをクリックし、データベース管理画面に入ります。
データベースの作成
- データベースファイルパスに新しいデータベースファイル名を入力します。
- "保存"ボタンをクリックしてデータベースを作成します。
データの追加
- 作成したばかりのデータベースを選択します。
- "テーブルを作成"をクリックします。
- テーブル名とフィールド情報を入力します。
- "保存"ボタンをクリックしテーブルを作成します。
- 作成したテーブルを選択し、"挿入"をクリックします。
- データを入力し"保存"ボタンをクリックします。
データの削除
- 操作するテーブルを選択します。
- "選択"ボタンをクリックし、削除するデータ行を選択します。
- "削除"ボタンをクリックし、削除を確認します。
データベースの削除
- データベースファイルパスから削除するデータベースファイルを選択します。
- そのファイルを手動で削除するか、ファイル管理ツールを使用して削除します。
これらの手順に従って、Adminerを使用してServBay内蔵の様々なデータベースシステムを簡単に管理できます。Adminerのシンプルなインターフェースと強力な機能により、データベース管理の効率が大幅に向上します。