Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mariadb [2018/10/27 13:37] – More scriptlets BernardSpilmariadb [2021/06/02 23:03] (current) – Add MariaDB server install instructions and troubleshooting sections GaelanLloyd
Line 1: Line 1:
 [[https://mariadb.org/|MariaDB]] is a drop-in replacement for %%MySQL%% [[https://en.wikipedia.org/wiki/MariaDB|forked from MySQL]] by some of the original developers of %%MySQL%% after Oracle acquired Sun (and thus acquired %%MySQL%%). [[https://mariadb.org/|MariaDB]] is a drop-in replacement for %%MySQL%% [[https://en.wikipedia.org/wiki/MariaDB|forked from MySQL]] by some of the original developers of %%MySQL%% after Oracle acquired Sun (and thus acquired %%MySQL%%).
  
-To use %%MariaDB%% in stead of (the default) %%MySQL%%, set in ''%%/etc/make.conf%%''+To use %%MariaDB%% instead of (the default) %%MySQL%%, set in ''%%/etc/make.conf%%''
  
 <code> <code>
 DEFAULT_VERSIONS+=mysql=102m DEFAULT_VERSIONS+=mysql=102m
 +</code>
 +
 +====== MariaDB server installation ======
 +
 +There are many versions of %%MariaDB%% available in the repos. Use this command to list all available versions.
 +
 +<code>
 +pkg search mariadb | grep server
 +</code>
 +
 +Install the version you wish (typically the latest version, replace the ''%%XXX%%'' in the command below with the desired version number listed above).
 +
 +  * Installing the server will automatically installs the client as a dependency.
 +
 +<code>
 +sudo pkg install mariadbXXX-server
 +</code>
 +
 +Set %%MariaDB%% to start at boot
 +
 +<code>
 +sudo sysrc mysql_enable=YES
 +</code>
 +
 +Start %%MariaDB%%
 +
 +<code>
 +sudo service mysql-server start
 +</code>
 +
 +Run this interactive script to perform basic security hardening of the installation.
 +
 +  * When asked, it's recommended to **not** provide a root database user password. (Accessing the server console as the root database user is done simply with ''%%sudo mysql%%''.)
 +
 +<code>
 +/usr/local/bin/mysql_secure_installation
 +</code>
 +
 +Verify that %%MariaDB%% is only accessible via localhost
 +
 +<code>
 +$ sockstat -4 -6 | grep 3306
 +mysql    mariadbd   989   33 tcp4   127.0.0.1:3306        *:*
 +</code>
 +
 +If the output lists ''%%127.0.0.1:3306%%'', then your server is not listening to remote connections. If ''%%*:3306%%'' is listed, then remote connections are enabled.
 +
 +===== Troubleshooting =====
 +
 +==== Connections to localhost fail ====
 +
 +Try connecting via the UNIX socket as specified in ''%%/usr/local/mysql/my.cnf%%'', like this:
 +
 +<code>
 +localhost:/var/run/mysql/mysql.sock
 </code> </code>
  
Line 72: Line 127:
 ^ file**/**dir ^ reason ^ ^ file**/**dir ^ reason ^
 | ''%%mariadb-service-convert%%'' | generates ''%%mariadb.service%%'' for ''%%systemd%%'' | | ''%%mariadb-service-convert%%'' | generates ''%%mariadb.service%%'' for ''%%systemd%%'' |
-| share/mysql/policy | SELinux and AppArmor files |+| share/mysql/policy | SELinux and %%AppArmor%% files |
  
 ===== Upstream issues ===== ===== Upstream issues =====
Line 81: Line 136:
 ==== MDEV-15961 ==== ==== MDEV-15961 ====
 [[https://jira.mariadb.org/browse/MDEV-11790|Fix stacktraces under FreeBSD]] Fixing aarch64 builds [[https://jira.mariadb.org/browse/MDEV-11790|Fix stacktraces under FreeBSD]] Fixing aarch64 builds
 +
 +----
 +
 +{{tag>Ports HowTo}}
  
  • mariadb.1540647464.txt.gz
  • Last modified: 2018/10/27 13:37
  • by BernardSpil