- MySQL の権利を Oracle が取得したことにより,MySQLからスピンアウトした MySQL互換DB
- Maria は開発チームのリーダの娘の名前らしい.
# vi /etc/my.cnf
# chmod a+r /etc/my.cnf
/etc/my.cnf[edit]
[mysqld]
datadir=/var/lib/mariadb
socket=/var/lib/mariadb/nariadb.sock
# mysql_install_db --user=mysql --ldata=/var/lib/mariadb --basedir=/usr
パスワード設定[edit]
# systemctl start mariadb.service
# su - (history対策)
# mariadb-admin -u root password パスワード
# exit (history対策)
サーバへのアクセス制限がある場合[edit]
匿名,パスワード無しユーザの削除[edit]
MariaDB [(none)]> use mysql;
MariaDB [mysql]> select Host,User,Password from user;
MariaDB [mysql]> set password for 'mariadb.sys'@localhost=password('set_password'); (set_password:パスワードは変える)
MariaDB [mysql]> select Host,User,Password from user;
MariaDB [mysql]> delete from user where password=''; ('' はシングルクォーテーション2個)
MariaDB [mysql]> select Host,User,Password from user;
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> exit
データベース作成例[edit]
$ mariadb -u root -p
Enter password: パスワード
MariaDB [(none)]> create database db_name default character set utf8; (または utf8mb4)
MariaDB [(none)]> grant all on db_name.* to db_name_user identified by 'db_name_pass';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
- サーバへのアクセス制限がある場合は,ユーザ名を db_name_user@localhost などとする.
Install[edit]
Compile[edit]
Rocky Linux 9 + 11.2[edit]
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=11.2
dnf -q module disable mariadb
dnf module reset mariadb
dnf rm mariadb
dnf install MariaDB-server MariaDB-client MariaDB-backup vim
mariadb -V
dnf install php-mysqlnd
Rocky Linux 8 + 10.5.22†[edit]
# vi /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/rhel8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
module_hotfixes=1
# rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
# systemctl stop mariadb
# yum remove mariadb-server
# yum remove mariadb-10.3.35
# dnf install MariaDB-server MariaDB-client
# rpm -qa|grep MariaDB
# systemctl start mariadb
CentOS7 + MariaDB-10.6.7†[edit]
from Source Code†[edit]
- 先に openssl-1.1.1g をインストール
Trouble Shooting[edit]
Rocky Linux 7/8[edit]
Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255)[edit]
Rocky Linux 9[edit]
Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.[edit]
max_open_files to more than 32768 (request: 66655)[edit]
# vi /usr/lib/systemd/system/mariadb.service
LimitNOFILE=100000
LimitMEMLOCK=100000
# systemctl daemon-reload
# systemctl start mariadb
Can't create test file '/var/lib/mysql/blackjack.lower-test'[edit]
- データベースディレクトリがリンボリックリンクだと v11 で発生?