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

Fedora42 : Mysql8 , WordPress

MySQL8

①Install

➁Start MySQL server

➂Check mysql version

④Connect to the MySQL server and change the root user password

⑤Set basic policies
Use the "mysql_secure_installation" command to set the root user password and set some basic policies

From now on, use the following command to connect to mysql

WordPress

1. Create database for Word Press

As an example, assume database [wp_db] database user [wp_user] password [?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 Install

3.Edit WordPress configuration file

# 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';
/*Add the following to the last line*/

/*If you do not do this, you will be asked for FTP connection information when you add the plugin.*/
define('FS_METHOD', 'direct');

4.Moving Files

Move the expanded contents under /var/www/html/[FQDN]

After confirming that the files have been moved, delete the wordpress directory and downloaded latest.tar.gz

Make apache the owner of the wordpress directory.

5.Starting wordpress installation

You can use your browser to go to http://[FQDN]/wp-admin/install.php
If successful, the following WordPress installation information input screen will be output.

「Your PHP installation appears to be missing the MySQL extension which is required by WordPress.」When displayed
Install php library-related software if not already installed.

again
Access http://[FQDN]/wp-admin/install.php

On the following input screen
・Site Title   Any name
・Username   Any name
・Password  Any password
・Your Email  Administrator's email address
Enter the information and click "Install WordPress". Remember to enter your "username" and "password" as they are required to access the WordPress administration screen.

Click on "Login"

User Name : The user name you have just set
Password : User's password you have just set
and click "Login".

After successfully logging in, you will be able to access the following WordPress admin page

Copied title and URL