日々様々なトラブルにハマっている、困ったシステム管理者の奮闘日記です。

WordPressの環境構築 – WordPress用データベースの作成

前回(WordPressの環境構築 – MySQLのインストール)

1.MySQLにログイン

以降、MySQL内でコマンド操作を行う。

# /usr/local/mysql/bin/mysql -u root -p
Enter password: <--------- パスワードを入力
:

2.WordPress用データベース作成

以下は「wpdb」という名前でWordPress用データベースを作成する例。

mysql> create database wpdb;
Query OK, 1 row affected (0.03 sec)

3.WordPressデータベース用ユーザの作成

以下は「wordpress」という名前でユーザを作成する例。
実際はもっと複雑な名前とパスワードで作成するほうが良いだろう。

mysql> grant all on wpdb.* to wordpress@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.03 sec)

mysql> flush privileges; <--------- 上記ユーザ作成&権限付与を有効にする
Query OK, 0 rows affected (0.03 sec)

4.データベース・ユーザの確認

mysql> use mysql <-------------- mysql データベースに切り替え
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select user,host from user; <-- ユーザの確認
+-----------+-----------+
| user      | host      |
+-----------+-----------+
| root      | serv      |
| root      | localhost |
| wordpress | localhost |
+-----------+-----------+
3 rows in set (0.01 sec)

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| wpdb     |
+----------+
2 rows in set (0.00 sec)

以上

次回(WordPressの環境構築 – WordPress用データベースの作成)


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply