在Clear Linux上安装WordPress(第二部分)

接下来的故事从上次开始

我记得上次安装了MariaDB,并注册了一个名为WordPress的数据库和一个名为wordpressuser的用户,准备工作已经完成了。

WordPress下载

clear~ $ cd /var/www/html

clear/var/www/html $ sudo curl -O https://wordpress.org/latest.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 18.2M  100 18.2M    0     0  1149k      0  0:00:16  0:00:16 --:--:-- 1372k

clear/var/www/html $ sudo tar -xzvf latest.tar.gz 
パスワード: 
wordpress/
wordpress/xmlrpc.php
wordpress/wp-blog-header.php
・・・

这里还好。但之后的画面我卡住了。
无法使用上次设定的用户名访问WordPress数据库。

スクリーンショット 2022-02-07 23.49.06.png

我在这个部分的参考是来自以下页面:https://sys-guard.com/post-18125/

clear~ $ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 333
Server version: 10.6.5-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           |
+--------------------+
| WordPress          |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.000 sec)

MariaDB [(none)]> select user, host FROM mysql.user ORDER by user;
+----------------+-----------+
| User           | Host      |
+----------------+-----------+
| mariadb.sys    | localhost |
| mysql          | localhost |
| root           | localhost |
+----------------+-----------+
5 rows in set (0.001 sec)

MariaDB [(none)]> grant ALL on WordPress.* TO 'wordpressuser'@'localhost' identified by 'wp-example';
Query OK, 0 rows affected (0.009 sec)

在这里突然出现了GRANT命令,但它只是为了确保”wordpressuser”这个用户不存在时才会被创建,所以不用担心。

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> select user, host from mysql.user order by user;
+----------------+-----------+
| User           | Host      |
+----------------+-----------+
| mariadb.sys    | localhost |
| mysql          | localhost |
| root           | localhost |
| wordpressuser  | localhost |
+----------------+-----------+
6 rows in set (0.001 sec)

MariaDB [(none)]> show grants for 'wordpressuser'@'localhost' ;
+----------------------------------------------------------------------------------------------------------------------+
| Grants for wordpressuser@localhost                                                                                   |
+----------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `wordpressuser`@`localhost` IDENTIFIED BY PASSWORD '*0729B792E6CA69E4B0CE7B01B2E1296056CCAE91' |
| GRANT ALL PRIVILEGES ON `WordPress`.* TO `wordpressuser`@`localhost`                                                 |
+----------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)```
スクリーンショット 2022-02-07 22.49.26.png
スクリーンショット 2022-02-07 23.20.08.png

请参考以下链接:
https://docs.01.org/clearlinux/latest/tutorials/wordpress.html#wp-install

广告
将在 10 秒后关闭
bannerAds