0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

仮想マシンを作ろう! MariaDBインストール編

Posted at

MariaDBインストール

dnf install -y mariadb-server mariadb mariadb-devel
systemctl start mariadb
systemctl status mariadb
ps -aux | grep mysqld
systemctl enable mariadb
systemctl is-enabled mariadb
mysql
# mysql
MariaDB [(none)]> create database wordpress default character set utf8;
wordpressというデータベース
show databases;
MariaDB [(none)]> grant all on wordpress.* to wordpress@localhost identified by 'password';
wordpressというユーザー
passwordというパスワード
MariaDB [(none)]> flush privileges;
Wp-config.phpの設定
cd /var/www/html/wordpress
cp wp-config-sample.php wp-config.php
このコマンドでconfigファイルのsampleをコピーして、コピーした方をエディタで編集していきます。
vim wp-config.php
DB_NAME
WordPressが接続しているデータベースの名前(DB名)

DB_USER
データベースユーザー名(DBユーザー名)

DB_PASSWORD
データベースユーザーが、データベースに接続するためのパスワード

https://api.wordpress.org/secret-key/1.1/salt/
で
自動生成しそれをコピー&ペーストして利用した

エラーたち

データベース接続確立エラー

ホストOSのブラウザでゲストOSを表示させたいが、エラーが出た
 以下のサイトで、自動生成しそれをコピー&ペーストして利用し解決
https://api.wordpress.org/secret-key/1.1/salt/

Requires: pvエラー

以下のコマンドで解決(EPELリポジトリを有効にしたらインストールできた)
yum install epel-release
yum update
yum install MariaDB-server MariaDB-client

MariDBをインストールできないエラー

https://downloads.mariadb.org/mariadb/repositories/
にて
Choose a Distro→Choose a Release→Choose a Version
CentOS7
11.4
選択

vi /etc/yum.repos.d/mariadb.repo
エディタにて先ほどのコピーしたものを貼り付けて保存します。

最下行にenable=1を追加します。
ここではレポジトリを有効にするために指定しています。

yum update

vi /etc/yum.repos.d/CentOS-Base.repo 編集

yum install https://dl.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm -y
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install wget
yum -y install MariaDB-server
yum -y install MariaDB-devel MariaDB-client MariaDB-server
systemctl start mariadb

centos8へyum/dnfエラー

/etc/yum.repos.d/CentOS*repoファイルの
CentOS-Stream-AppStream.repo
CentOS-Stream-BaseOS.repo
CentOS-Stream-Extras.repo
を以下2点編集すること
・mirrorlist~~ をコメントアウト
・baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
 と書き換え
->サポート切れでミラーサイトが停止したため

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?