LogoMark.png

WordPress/Memo

WordPress導入メモ

Introduction | Basics | Plugins | Customize | Backup | Memo


Linux(CentOS Ubuntu)を前提とした100%個人的なメモです。

MariaDBインストール後のPW設定

インストール直後、root での起動は No Pass で可能

# mysql  ← これで起動
MariaDB [(none)] >   となる

一旦 quit

MariaDB [(none)] > quit
Bye

以下のコマンドでパスワード設定

# mysql_secure_installation
:
Enter current password for root (enter for none): 

ここでは Enter のみ

OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] 

ここで Y

New password:  新しいパスワードを入力
Re-enter new password: もういちど入力
Password updated successfully!

以下、いろいろ尋ねられるが、基本すべて Y で完了
一旦 quit して、以下で PW の有効性を確認

# mysql -u root -p

参考:データベース一覧表示

MariaDB[(none)]>show databases;




推奨環境メモ


MySQL 8 対応|2018.10.08

SSHでサーバーにログインしている状態で・・

WordPressフォルダ名の変更

アップしたWordPressサイトのフォルダ名を変更(つまりURLを変更)するには、まずシステム側に変更予定のアドレスを記憶させ(データベースを書き換えさせ)、その後実際にフォルダ名を変更。新URLにアクセスすれば、これまでと同様に動作する。

アップグレード

自動アップグレード

手動アップグレード(スクリプトがサーバー内でうまく動かない場合)

ローカルマシンで試すには

MySQLサーバーをインストール

途中rootのパスワードを聞いてきたので
ID root
PW *********
この時点でデーモンは動いている
システムモニターで「すべてのプロセスを表示」として確認できる mysqld

コマンドラインからの起動確認

mysql -u root -p

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

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


PHPによるDBMS phpMyAdminをインストール

phpのファイルセットなので、
普通にDLして解凍、その後、
Webサーバーのドキュメントフォルダにフォルダごと投入

設定ファイルは config.inc.php
必要であれば、conig.sample.inc.phpをコピーして作成。

http://localhost/~user/phpmyadmin/ でアクセス成功

ID root
PW ********* でログイン成功
※編集画面内にPWはメモ

とりあえず、
新規のデータベースとして wordpress を作成

WordPressをインストール

普通にDLして解凍、その後、
Webサーバーのドキュメントフォルダにフォルダごと投入

http://localhost/~user/wordpress/  でアクセス成功

wp-config.phpの作成が必要と出るので、
「wp-config.php を作成する」というボタンを押して、初期化開始

・データベース名 先のwordpress
・データベースユーザID root
・データベースPW ********
・データベースホスト名 localhost
・テーブル接頭辞 そのまま

次に進む(ページの基本情報とメールアドレス等を入力)

・ブログタイトル  (タイトルを入力:任意)
・ユーザ名 (任意)
・PW  (任意)
 

その他

Apache2の再起動は

sudo /etc/init.d/apache2 restart




phpMyAdminのconfigファイル設定

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use scripts/setup.php
 *
 * All directives are explained in Documentation.html and on phpMyAdmin
 * wiki <http://wiki.phpmyadmin.net>.
 *
 * @version $Id$
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'ここには適当な文字列を入れる'; 
 /* YOU MUST FILL IN THIS FOR COOKIE  UTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost または サーバーアドレス'; ←これ
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = '********';  ←これ
$cfg['Servers'][$i]['controlpass'] = '********';  ←これ
/* Advanced phpMyAdmin features */
以下コメントアウト 

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>


phpMyAdminで外部サーバのDBを制御する

例えば 自分のローカルホスト内phpMyAdmin → 大学DBサーバに繋げる場合

configファイルで・・・ [接続先] localhost ではなく、

$cfg['Servers'][$i]['host'] = '***.ip.kyusan-u.ac.jp';

などとするだけ。

データベースアクセス用のID、PW設定等は同様に設定する



PAGES

GUIDE

DATA

Last-modified: 2019-12-25 (水) 16:50:05