104Mariadb - amagerard/Wiki GitHub Wiki
RedHat10/Xwiki
| 1- Network | 2- Java | 3- Tomcat | 4- Mariadb | 5- Xwiki |
|---|---|---|---|---|
| 6- Nginx | 7- selinux | 8- GnomeShell | 9 Troubleshoots |
4. Mariadb
4.1 Installation.
Mariadb update.
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -
The mariadb-masxcale url is out of service.
Put enabled = 0 .
vi /etc/yum.repos.d/mariadb.repo
[mariadb-maxscale]
# To use the latest stable release of MaxScale, use "latest" as the version
# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version
name = MariaDB MaxScale
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/yum/rhel/10/x86_64
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY
gpgcheck = 1
enabled = 0
dnf update
dnf install MariaDB-server
systemctl enable --now mariadb
4.2 Secure MariaDB.
mariadb-secure-installation
The root password in this example is: "X2m56AB50!".
Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password: X2m56AB50!
... Success!
Remove anonymous users? [Y/n] y
... Success!
Disallow root login remotely? [Y/n] y
... Success!
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done!
Change password for root@localhost.
mariadb -u root -p mysql
Enter.
MariaDB [mysql]> alter user 'root'@'localhost' identified by 'X2m56AB50!';
exit
4.3 Create xwiki database.
Create wikijs database with user wikijs@locahost and password: "641fqAB4d".
mariadb -u root -p -e "create database xwiki default character set utf8mb4 collate utf8mb4_bin;"
mariadb -u root -p -e "CREATE USER 'xwiki'@'localhost' IDENTIFIED BY '641fqAB4d';"
mariadb -u root -p -e "grant all privileges on *.* to xwiki@localhost;"
mariadb -u root -p -e "flush privileges;"
4.4 Backup Mariadb.
4.4.1 Save the xwiki database.
mariadb-dump -u root -p xwiki > backup_xwiki.sql
4.4.2 Restore the xwiki base.
mariadb -u root xwiki < backup_xwiki.sql