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

Fedora42 : MySQL8 , WordPressインストール

MySQL8 インストール

①インストール

➁MySQLサーバーを起動

➂mysqlバージョン確認

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

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

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

WordPressインストール

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

例としてデータベース[wp_db] データベースユーザー[wp_user] パスワード[?W123456]とします

# 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 '?W123456';
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

<?php
/**

  • The base configuration for WordPress
    *
  • The wp-config.php creation script uses this file during the installation.
  • You don't have to use the website, you can copy this file to "wp-config.php"
  • and fill in the values.
    *
  • This file contains the following configurations:
    *
  • * Database settings
  • * Secret keys
  • * Database table prefix
  • * ABSPATH
    *
  • @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
    *
  • @package WordPress
    */

// ** 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', '?W123456' );

/** 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', '' );

/**#@+

  • Authentication unique keys and salts.
    *
  • Change these to different unique phrases! You can generate these using
  • the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
    *
  • You can change these at any point in time to invalidate all existing cookies.
  • This will force all users to have to log in again.
    *
  • @since 2.6.0
    */
    define( 'AUTH_KEY', 'put your unique phrase here' );
    define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
    define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
    define( 'NONCE_KEY', 'put your unique phrase here' );
    define( 'AUTH_SALT', 'put your unique phrase here' );
    define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
    define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
    define( 'NONCE_SALT', 'put your unique phrase here' );

/*#@-/

/**

  • WordPress database table prefix.
    *
  • You can have multiple installations in one database if you give each
  • a unique prefix. Only numbers, letters, and underscores please!
    *
  • At the installation time, database tables are created with the specified prefix.
  • Changing this value after WordPress is installed will make your site think
  • it has not been installed.
    *
  • @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix
    */
    $table_prefix = 'wp_';

/**

  • For developers: WordPress debugging mode.
    *
  • Change this to true to enable the display of notices during development.
  • It is strongly recommended that plugin and theme developers use WP_DEBUG
  • in their development environments.
    *
  • For information on other constants that can be used for debugging,
  • visit the documentation.
    *
  • @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
    */
    define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', DIR . '/' );
}

/** 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をコピーしました