そういうのがいいブログ

SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ

【CentOS8】WordPressのアンインストール手順【ディレクトリ削除とDB削除】

※[PR]当ブログの記事の中にはプロモーションが含まれています。

・CentOS8のWordPressをアンインストールする方法を知りたい。

こういった疑問に答えます。

この記事を書いている私は、某SIerに勤務しながら、
WEB系エンジニア・インフラエンジニアに憧れて、プログラミングおよびインフラ技術の勉強をしています。

私が実機で試したコマンドや画像を載せて書いています。 記事の信頼性担保に繋がると思います。

CentOS8のWordPressをアンインストールする方法

PHP資産をディレクトリ毎、すべて削除

rm -rf ディレクトリ名
[root@sv-neptune html]# rm -rf sv-neptune.wp

私の環境では、「/home/www/html/sv-neptune.wp」というディレクトリにWordPressを入れていたので、
それをすべて削除しました。

削除前

削除後

DBもすべて削除

MySQL(mariaDB)にrootユーザでログイン

mysql -u root -p
[root@sv-neptune html]# mysql -u root -p
Enter password:

DBの確認

 show databases;
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1455
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases
    -> ;
+-------------------------+
| Database                |
+-------------------------+
| information_schema      |
| mysql                   |
| performance_schema      |
| wpdb01                  |
+-------------------------+
4 rows in set (0.002 sec)

WordPressのDBをDROP

drop database wpdb01;
MariaDB [(none)]> drop database wpdb01;
Query OK, 12 rows affected (0.047 sec)

削除後の確認

show databases;
MariaDB [(none)]> show databases;
+-------------------------+
| Database                |
+-------------------------+
| information_schema      |
| mysql                   |
| performance_schema      |
+-------------------------+
3 rows in set (0.000 sec)