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/29 10:16] – fix a typo MateuszPiotrowskimariadb [2021/06/02 23:03] (current) – Add MariaDB server install instructions and troubleshooting sections GaelanLloyd
Line 5: Line 5:
 <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 84: Line 139:
 ---- ----
  
-{{tag>Ports}}+{{tag>Ports HowTo}}
  
  • mariadb.1540808208.txt.gz
  • Last modified: 2018/10/29 10:16
  • by MateuszPiotrowski