Contents
MySQL8 Install
1 |
# dnf -y install mysql-server |
charset.cnf Create a new one with the following contents
1 2 3 4 5 6 7 8 |
#vi /etc/my.cnf.d/charset.cnf # Set default character encoding utf8mb4 for 4-byte characters such as pictographs [mysqld] character-set-server = utf8mb4 [client] default-character-set = utf8mb4 |
1 2 |
#systemctl enable --now mysqld Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service. |
Use the "mysql_secure_installation" command to set the root user password and set some basic policies
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? # Enable/disable password quality check Press y|Y for Yes, any other key for No: y There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file # Select strength if password quality check is enabled Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0 ←May be optional for each Please set the password for root here. # MySQL root password New password: ← Any password Re-enter new password: ← Same password again # Confirmation that the password you entered is correct Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. # Whether to remove anonymous users or not Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. All done! |
WordPress Install
1. Create database for WordPress
As an example, assume database [wp_db] database user [wp_user] password [?W123456]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.36 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> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | wp_db | +--------------------+ 5 rows in set (0.01 sec) mysql> CREATE USER 'wp_user'@'localhost' IDENTIFIED WITH mysql_native_password BY '?W123456'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL ON wp_db.* TO 'wp_user'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye |
2.Wordpress Install
1 2 3 |
# cd /var/www/html/[FQDN] # wget http://wordpress.org/latest.tar.gz # tar xvf latest.tar.gz |
3.Edit WordPress configuration file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# 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', '?W123456'); 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/[domain name for wordpress]
1 2 |
# cd /var/www/html/[FQDN] # mv wordpress/* . |
After confirming that the files have been moved, delete the wordpress directory and downloaded latest.tar.gz
1 2 3 |
# cd /var/www/html/[FQDN] # rm -R -f wordpress # rm latest.tar.gz |
Make apache the owner of the wordpress directory.
1 |
# chown -R apache:apache /var/www/html/[FQDN] |
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.
1 2 3 |
# dnf install php-mysqlnd # systemctl restart mysqld # systemctl restart httpd |
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