アフィリエイト広告を利用しています
ファン
検索
<< 2020年05月 >>
          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            
最新記事
写真ギャラリー
最新コメント
タグクラウド
カテゴリーアーカイブ
月別アーカイブ
プロフィール
日別アーカイブ

広告

posted by fanblog

2020年05月02日

mysql5.7 wordpress設定

Last login: Sat May 2 16:27:13 on ttys006
You have new mail.
cMacBook-Pro-3:~ yusuke$ cd Centos7/
MacBook-Pro-3:Centos7 yusuke$ vagrant ssh
Last login: Sat May 2 07:04:18 2020 from 10.0.2.2
[vagrant@localhost ~]$ sudo su -
最終ログイン: 2020/05/02 (土) 07:04:30 UTC日時 pts/0
server {
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
index.php
[root@localhost html]# rm index.php
rm: remove regular file ‘index.php’? y
[root@localhost html]# wget https://ja.wordpress.org/latest-ja.tar.gz
--2020-05-02 07:28:54-- https://ja.wordpress.org/latest-ja.tar.gz
Resolving ja.wordpress.org (ja.wordpress.org)... 198.143.164.252
Connecting to ja.wordpress.org (ja.wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12960979 (12M) [application/octet-stream]
Saving to: ‘latest-ja.tar.gz’

100%[======================================>] 12,960,979 5.74MB/s in 2.2s

2020-05-02 07:28:57 (5.74 MB/s) - ‘latest-ja.tar.gz’ saved [12960979/12960979]

[root@localhost html]# tar xfz latest-ja.tar.gz
[root@localhost html]# chown -R nginx. wordpress
[root@localhost html]# mv wordpress sample.com
[root@localhost html]# cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf_bkup20200502wordpressconfig
[root@localhost html]# vim /etc/nginx/conf.d/default.conf
[root@localhost html]# systemctl restart nginx
[root@localhost html]# sudo rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
warning: /var/tmp/rpm-tmp.JW4TwL: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql57-community-release-el7-7 ################################# [100%]
[root@localhost html]# sudo yum info mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cat.net
* epel: ftp.iij.ad.jp
* extras: mirrors.cat.net
* remi-safe: ftp.riken.jp
* updates: mirrors.cat.net
mysql-connectors-community | 2.5 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql57-community | 2.5 kB 00:00
(1/3): mysql-connectors-community/x86_64/primary_db | 57 kB 00:00
(2/3): mysql-tools-community/x86_64/primary_db | 72 kB 00:00
(3/3): mysql57-community/x86_64/primary_db | 213 kB 00:00
Available Packages
Name : mysql-community-server
Arch : x86_64
Version : 5.7.30
Release : 1.el7
Size : 173 M
Repo : mysql57-community/x86_64
Summary : A very fast and reliable SQL database server
URL : http://www.mysql.com/
License : Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights
: reserved. Under GPLv2 license as shown in the Description field.
Description : The MySQL(TM) software delivers a very fast, multi-threaded,
: multi-user, and robust SQL (Structured Query Language) database
: server. MySQL Server is intended for mission-critical, heavy-load
: production systems as well as for embedding into mass-deployed
: software. MySQL is a trademark of Oracle and/or its affiliates
:
: The MySQL software has Dual Licensing, which means you can use the
: MySQL software free of charge under the GNU General Public License
: (http://www.gnu.org/licenses/). You can also purchase commercial
: MySQL licenses from Oracle and/or its affiliates if you do not
: wish to be bound by the terms of the GPL. See the chapter
: "Licensing and Support" in the manual for further info.
:
: The MySQL web site (http://www.mysql.com/) provides the latest
: news and information about the MySQL software. Also please see
: the documentation and the manual for more information.
:
: This package includes the MySQL server binary as well as related
: utilities to run and administer a MySQL server.

[root@localhost html]# sudo yum -y install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cat.net
* epel: nrt.edge.kernel.org
* extras: mirrors.cat.net
* remi-safe: mirror.innosol.asia
* updates: mirrors.cat.net
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.30-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.30-1.el7 for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: net-tools for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-server-5.7.30-1.el7.x86_64
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package mysql-community-client.x86_64 0:5.7.30-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.30-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.30-1.el7 will be installed
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.65-1.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.30-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.30-1.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-libs x86_64 5.7.30-1.el7 mysql57-community 2.3 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
mysql-community-libs-compat
x86_64 5.7.30-1.el7 mysql57-community 1.2 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
mysql-community-server x86_64 5.7.30-1.el7 mysql57-community 173 M
Installing for dependencies:
libaio x86_64 0.3.109-13.el7 base 24 k
mysql-community-client x86_64 5.7.30-1.el7 mysql57-community 25 M
mysql-community-common x86_64 5.7.30-1.el7 mysql57-community 311 k
net-tools x86_64 2.0-0.25.20131004git.el7 base 306 k

Transaction Summary
================================================================================
Install 3 Packages (+4 Dependent packages)

Total download size: 203 M
Downloading packages:
(1/7): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:01
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.30-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.7.30-1.el7.x86_64.rpm is not installed
(2/7): mysql-community-common-5.7.30-1.el7.x86_64.rpm | 311 kB 00:01
(3/7): mysql-community-libs-5.7.30-1.el7.x86_64.rpm | 2.3 MB 00:00
(4/7): mysql-community-libs-compat-5.7.30-1.el7.x86_64.rpm | 1.2 MB 00:00
(5/7): net-tools-2.0-0.25.20131004git.el7.x86_64.rpm | 306 kB 00:00
(6/7): mysql-community-client-5.7.30-1.el7.x86_64.rpm | 25 MB 00:02
(7/7): mysql-community-server-5.7.30-1.el7.x86_64.rpm | 173 MB 00:04
--------------------------------------------------------------------------------
Total 29 MB/s | 203 MB 00:06
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : "MySQL Release Engineering "
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package : mysql57-community-release-el7-7.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.7.30-1.el7.x86_64 1/8
Installing : mysql-community-libs-5.7.30-1.el7.x86_64 2/8
Installing : mysql-community-client-5.7.30-1.el7.x86_64 3/8
Installing : libaio-0.3.109-13.el7.x86_64 4/8
Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 5/8
Installing : mysql-community-server-5.7.30-1.el7.x86_64 6/8
Installing : mysql-community-libs-compat-5.7.30-1.el7.x86_64 7/8
Erasing : 1:mariadb-libs-5.5.65-1.el7.x86_64 8/8
Verifying : mysql-community-server-5.7.30-1.el7.x86_64 1/8
Verifying : mysql-community-libs-5.7.30-1.el7.x86_64 2/8
Verifying : mysql-community-client-5.7.30-1.el7.x86_64 3/8
Verifying : mysql-community-libs-compat-5.7.30-1.el7.x86_64 4/8
Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 5/8
Verifying : mysql-community-common-5.7.30-1.el7.x86_64 6/8
Verifying : libaio-0.3.109-13.el7.x86_64 7/8
Verifying : 1:mariadb-libs-5.5.65-1.el7.x86_64 8/8

Installed:
mysql-community-libs.x86_64 0:5.7.30-1.el7
mysql-community-libs-compat.x86_64 0:5.7.30-1.el7
mysql-community-server.x86_64 0:5.7.30-1.el7

Dependency Installed:
libaio.x86_64 0:0.3.109-13.el7
mysql-community-client.x86_64 0:5.7.30-1.el7
mysql-community-common.x86_64 0:5.7.30-1.el7
net-tools.x86_64 0:2.0-0.25.20131004git.el7

Replaced:
mariadb-libs.x86_64 1:5.5.65-1.el7

Complete!
[root@localhost html]# mysql --version
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
[root@localhost html]# sudo systemctl start mysqld
[root@localhost html]# cat /var/log/mysqld.log | grep password
2020-05-02T07:37:47.451569Z 1 [Note] A temporary password is generated for root@localhost: <:6tGiSLg2(A [root@localhost html]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Re-enter new password: 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. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. # Remove leading # and set to the amount of RAM for the most important data Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done! [root@localhost html]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.30 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 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> exit
Bye
[root@localhost html]# cp /etc/my.cnf /etc/my.cnf_backup20200502changepasswordLimigted
[root@localhost html]# vi /etc/my.cnf
[root@localhost html]# sudo systemctl restart mysqld
[root@localhost html]# sudo systemctl enable mysqld
[root@localhost html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

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 wordpress
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'wordpress' at line 1
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)

mysql> grant all on wordpress.* to root@localhost identified by '<:6tGiSLg2(B'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show databases;
+--------------------+
| Database |
* @package WordPress
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
5 rows in set (0.01 sec)

mysql> exit
Bye
[root@localhost html]# id root
uid=0(root) gid=0(root) groups=0(root)
[root@localhost html]# cd sample.com
[root@localhost sample.com]# ls
index.php wp-blog-header.php wp-includes wp-settings.php
license.txt wp-comments-post.php wp-links-opml.php wp-signup.php
readme.html wp-config-sample.php wp-load.php wp-trackback.php
wp-activate.php wp-content wp-login.php xmlrpc.php
wp-admin wp-cron.php wp-mail.php
[root@localhost sample.com]# cp wp-config-sample.php wp-config.php
[root@localhost sample.com]# chown -R nginx:nginx *
[root@localhost sample.com]# chmod -R g+w *
[root@localhost sample.com]# vi wp-config.php
[root@localhost sample.com]# ls
index.php wp-blog-header.php wp-cron.php wp-mail.php
license.txt wp-comments-post.php wp-includes wp-settings.php
readme.html wp-config.php wp-links-opml.php wp-signup.php
wp-activate.php wp-config-sample.php wp-load.php wp-trackback.php
wp-admin wp-content wp-login.php xmlrpc.php
[root@localhost sample.com]# cd ..
[root@localhost html]# ls
latest-ja.tar.gz sample.com
[root@localhost html]# rm latest-ja.tar.gz
rm: remove regular file ‘latest-ja.tar.gz’? y
[root@localhost html]# cd sample.com/
[root@localhost sample.com]# cat wp-config-sample.php
この記事へのコメント
コメントを書く

お名前:

メールアドレス:


ホームページアドレス:

コメント:

※ブログオーナーが承認したコメントのみ表示されます。

この記事へのトラックバックURL
https://fanblogs.jp/tb/9818973
※ブログオーナーが承認したトラックバックのみ表示されます。

この記事へのトラックバック
×

この広告は30日以上新しい記事の更新がないブログに表示されております。