業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Fedora43 : MySQL8 , WordPressインストール

MySQL8 インストール

①インストール

➁MySQLサーバーを起動

➂mysqlバージョン確認

④MySQLサーバーに接続し、rootユーザーのパスワードを変更

⑤基本的なポリシーを設定
「mysql_secure_installation」 コマンドを使用してrootユーザーのパスワードを設定し、いくつかの基本的なポリシーを設定します

以降、mysqlに接続するには次のコマンドを使用する

WordPressインストール

1. Word Press 用のデータベースを作成

例としてデータベース[wp_db] データベースユーザー[wp_user] パスワード[?Wabcd123]とします。
但し、MySQL8.4からはmysql_native_passwordは無効になっていますのでmy.cnfを編集し、利用できるようにします。

my.cnfを開き下記のように追記します

mysqlを再起動する

ユーザー、データベースを作成する

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.40 Source distribution

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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> CREATE DATABASE wp_db DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> CREATE USER 'wp_user'@'localhost' IDENTIFIED WITH mysql_native_password BY '?Wwabcd123';
Query OK, 0 rows affected (0.01 sec)

mysql> GRANT ALL ON wp_db.* TO 'wp_user'@'localhost';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

2.Wordpressインストール

3.Wordpress設定ファイルの編集

# cd wordpress/
# cp wp-config-sample.php wp-config.php
# vi wp-config.php

------------------------------------------------------------------------------------------------------------------------

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wp_db' );

/** Database username */
define( 'DB_USER', 'wp_user' );

/** Database password */
define( 'DB_PASSWORD', '?Wwabcd123' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

---------------------------------------------------------------------------------------------------------------

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
また、最終行に以下の分を追加します。
これをしないと、プラグインを追加するときにFTP接続情報なるものを聞かれます。
define('FS_METHOD', 'direct');

4.ファイルの移動

①/var/www/html/[wordpress用ドメイン名]の下に展開した中身を移動

移動されたことを確認後 wordpressディレクトリーとダウンロードしたlatest-ja.tar.gzを削除

wordpressディレクトリの所有者をapacheにします

5.wordpress インストールの開始

ブラウザでhttp://[FQDN]/wp-admin/install.phpにアクセスし、ユーザー名、パスワード等必要事項を入力し、インストールを開始してください

「このサイトにアクセスできません」または「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」表示されたら 次をインストールしてapacheとmysqlを再起動する

ユーザー名 : 先ほど設定したユーザー名
パスワード : 先ほど設定したユーザーのパスワード
を入力し、[ログイン]をクリック

ログインに成功すると下記WordPressの管理画面にアクセスできます

タイトルとURLをコピーしました