https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&user=AAT596&feedformat=atomAlpine Linux - User contributions [en]2024-03-29T05:05:55ZUser contributionsMediaWiki 1.40.0https://wiki.alpinelinux.org/w/index.php?title=MariaDB&diff=26612MariaDB2024-03-20T19:47:30Z<p>AAT596: In case it's the first time upgrading, the package mariadb-server-utils (which is needed for mysql_upgrade later on) may not be installed.</p>
<hr />
<div>[https://mariadb.org/ MariaDB] is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. It is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle.<br />
<br />
'''This is the general documentation for normal and common general usage, for professional usage please use [[MySQL]] that is the same as MariaDB but with several modifications focused on production and security!'''<br />
<br />
== Installation ==<br />
<br />
The Alpine Linux repositories no longer include the actual MySQL binaries, installing the <code>mysql-*</code> packages will instead install MariaDB. <br />
<br />
Installing <code>mariadb</code> will create the user <code>mysql</code>. When the database is initialized, two users will be added to the database: <code>root</code> and <code>mysql</code>. By default these users will only be accessible if you are logged in as the corresponding system user.<br />
<br />
{{Cmd|apk add mysql mysql-client}}<br />
<br />
Installing the above packages will add the main components of MariaDB to the system: <code>mariadb-cient</code> and <code>mariadb-server</code>. Other available packages are described in the table below, and are listed in order of relevance for a production server.<br />
<br />
{| class="wikitable"<br />
|-<br />
! MySQL name package !! Since Alpine: !! Brief usage !! Related package<br />
|-<br />
| {{Pkg|mysql}} || v2 || a transitional package that installs mariadb || mariadb<br />
|-<br />
| {{Pkg|mysql-client}} || v2 || a transitional package that installs the mariadb client tools || mariadb-client<br />
|-<br />
| {{Pkg|mariadb}} || v2 || server equivalent to mysql-server || mariadb-common<br />
|-<br />
| {{Pkg|mariadb-client}} || v2 || connection command line and tools || mariadb-common<br />
|-<br />
| {{Pkg|mariadb-doc}} || v3.0 || manpages for mariadb || man man-pages<br />
|-<br />
| {{Pkg|mariadb-connector-odbc}} || edge || coding or making OS level connections, to any DB without libs install || .<br />
|-<br />
| {{Pkg|mariadb-connector-c}} || v3.8 || coding connection on C sources || mariadb-connector-c-dev<br />
|-<br />
| {{Pkg|mariadb-backup}} || v3.8 || tool for physical online backups, no longer widely used || .<br />
|-<br />
| {{Pkg|mariadb-server-utils}} || v3.8 || server commands not widely used, in past was inside MariaDB package || .<br />
|-<br />
| {{Pkg|mariadb-dev}} || v3.1 || development files for MariaDB || .<br />
|-<br />
| {{Pkg|mariadb-test}} || v3.3 || testing suite from MariaDB tools || .<br />
|-<br />
| {{Pkg|mariadb-mytop}} || v3.9 || data performance monitoring || .<br />
|-<br />
| {{Pkg|mariadb-plugin-rocksdb}} || v3.9 || plain key-value event relational for data || .<br />
|-<br />
| {{Pkg|mariadb-static}} || v3.8 || static libs for static non depends linking in builds || .<br />
|-<br />
| {{Pkg|mariadb-embedded}} || v3.9 || the libmysqld identical interface as the C client || mariadb-embedded-dev<br />
|-<br />
| {{Pkg|mariadb-embedded-dev}} || v3.9 || use the normal mysql.h and link with libmysqld instead of libmysqlclient || mariadb-dev<br />
|-<br />
| {{Pkg|mariadb-openrc}} || v3.8 || separate scripts, in past was embebed on server package || .<br />
|}<br />
<br />
== Initialization ==<br />
<br />
The version of MariaDB in the Alpine repositories behave like the MySQL tarball. No graphical tools are included.<br />
<br />
The ''datadir'' located at {{Path|/var/lib/mysql}} must be owned by the mysql user and group. The location of the ''datadir'' can be changed by editing the <code>mariadb</code> service file in {{Path|/etc/init.d}}. The new location will also need to be set by adding <code><nowiki>datadir=<YOUR_DATADIR></nowiki></code> in the <code>[mysqld]</code> section in a mariadb configuration file.<br />
<br />
Normal initialization of mariadb can be done as follows:<br />
<br />
# Initialize the main mysql database, and the data dir as standardized to {{Path|/var/lib/mysql}} by running <code>rc-service mariadb setup</code><br />
# Start the main service. At this point there will be no root password set. <code>rc-service mariadb start</code><br />
# Secure the database by running <code>mysql_secure_installation</code><br />
# Setup permissions for managing others users and databases<br />
<br />
== Configuration ==<br />
<br />
In order to help with the basic configuration of the database engine, MariaDB provides <code>mysql_secure_installation</code>.<br />
This script walks you through the basics of securing the database. The options are explained below.<br />
<br />
# '''Enter current password for root (enter for none):''' If you have previously set up a root password, provide it here and press enter. If not, just press enter.<br />
# '''Switch to unix_socket authentication [Y/n]''' Setting the root password or using the Unix_socket ensures that only admins can log into engine database. For non-production servers just press "n" to setup a root password, which will give you the response <code>... skipping.</code><br />
# '''Change the root password? [Y/n]''' Here you can change the root password, or set one if needed. Press "Y" and enter the new password.<br />
# '''Remove anonymous users? [Y/n]''' Remove anonymous users created to log in using socket authentication. Unless you're sure you need this, answer "Y" to remove them.<br />
# '''Disallow root login remotely? [Y/n]''' Normally, root should only be allowed to connect from 'localhost' in order to protect from password sniffing attempts over the network. Answer "Y".<br />
# '''Remove test database and access to it? [Y/n]''' By default, MariaDB comes with a database named 'test' that anyone can access. If this is not needed, answer "Y".<br />
# '''Reload privilege tables now? [Y/n]''' Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Answer "Y".<br />
<br />
After the script exits, restart the service with <code>rc-service mariadb restart</code><br />
<br />
To start the database daemon on every boot, run <code>rc-update add mariadb default</code><br />
<br />
=== Configuration files and customization ===<br />
<br />
Rather than being stored in {{Path|my.cnf}}, configuration settings for MariaDB are now organized in separate files. The primary configuration is done by adding files to {{Path|/etc/my.cnf.d/}}. User-specific configuration files are stored in {{Path|~/.my.cnf}}. User-specific configuration files are loaded after the system-wide configuration. The locations of the various configuration files are listed below.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Config file !! Versions of Alpine !! Contents to configure<br />
|-<br />
| {{Path|/etc/mysql/my.cnf}} || v2 to v3.8 || All the directives, global config file<br />
|-<br />
| {{Path|/etc/my.cnf.d/mariadb-server.cnf}} || since 3.9 || First global config file, main directives<br />
|-<br />
| {{path|$HOME/.my.cnf}} || all || user name only config directives<br />
|}<br />
<br />
As previously mentioned, this page describes basic usage of MariaDB. For professional usage, [[MySQL]] should also be referenced.<br />
<br />
* The following command will configure the server to accept all incoming connections. This should only be done for development, or if the database is not exposed to the Internet or a sensitive network.<br />
<br />
{{Cmd|<nowiki>sed -i "s|.*bind-address\s*=.*|bind-address=0.0.0.0|g" /etc/mysql/my.cnf<br />
sed -i "s|.*bind-address\s*=.*|bind-address=0.0.0.0|g" /etc/my.cnf.d/mariadb-server.cnf<br />
</nowiki>}}<br />
<br />
* For simple installations, disabling hostname search can improve performance, but is only useful for local servers.<br />
<br />
{{Cmd|<nowiki>sed -i "s|.*skip-networking.*|skip-networking|g" /etc/mysql/my.cnf<br />
sed -i "s|.*skip-networking.*|skip-networking|g" /etc/my.cnf.d/mariadb-server.cnf<br />
</nowiki>}}<br />
<br />
== Updating or coming from upgrading ==<br />
<br />
When upgrading between Alpine Linux releases, MariaDB may also have a major version change, and the databases should be upgraded to match. The recommended steps in this process are detailed below.<br />
<br />
# While it may no longer be strictly necessary, it's useful to backup your databases before upgrading the database version.<br />
# Update Alpine Linux and the MariaDB/MySQL packages.<br />
# Install mariadb-server-utils by running <code>apk add mariadb-server-utils</code>.<br />
# Run <code>mysql_upgrade -u root -p</code> script, and provide the password for the root database user.<br />
# Restart the service by running <code>rc-service mariadb restart</code>.<br />
<br />
If <code>mysql_upgrade</code> fails because MySQL cannot start, try running MySQL in safemode with <code>mysqld_safe --datadir=/var/lib/mysql/</code>, and then run <code>mysql_upgrade -u root -p</code> again.<br />
<br />
= See Also =<br />
<br />
* [[MySQL]]<br />
* [[Production LAMP system: Lighttpd + PHP + MySQL]]<br />
<br />
[[Category:Newbie]]<br />
[[Category:Server]]<br />
[[Category:Database]]<br />
[[Category:Development]]<br />
[[Category:Security]]<br />
[[Category:Production]]</div>AAT596https://wiki.alpinelinux.org/w/index.php?title=Gaming_on_Alpine&diff=22053Gaming on Alpine2022-06-27T21:50:45Z<p>AAT596: Added LBreakoutHD, LBreakout2 and LPairs to the list</p>
<hr />
<div>'''Gaming on Alpine''' is a thing.<br />
<br />
== Installing games ==<br />
<br />
sudo apk add micro-tetris<br />
<br />
== Permissions ==<br />
<br />
To make sure your account is in the games group. You could do.<br />
<br />
sudo gpasswd -a name games<br />
<br />
Log off then relog back on.<br />
<br />
== List of games available on Alpine Linux ==<br />
<br />
* [http://www.advancemame.it/ AdvanceMAME] - advancemame -- Arcade Simulator<br />
* [https://wiki.gnome.org/Apps/Aisleriot Aisleriot] - aisleriot -- Solitaire card games<br />
* [https://www.dosbox.com/ DOSBox] - dosbox -- DOS-emulator that uses SDL-library<br />
* [http://frotz.sourceforge.net/ Frotz] - frotz -- Z machine (Infocom interactive fiction) Interpreter<br />
* [http://home.flightgear.org FlightGear] - flightgear -- Flight Simulator<br />
* [https://freedoom.github.io/ Freedoom]+[https://www.chocolate-doom.org/ Chocolate Doom] - freedoom, chocolate-doom -- a free Doom game and an engine to run it<br />
* [https://en.wikipedia.org/wiki/GNU_Chess GNU Chess] - gnuchess -- Play chess against the computer<br />
* [https://lgames.sourceforge.io/LBreakout2 LBreakout2] - lbreakout2 -- Ball-and-paddle game.<br />
* [https://lgames.sourceforge.io/LBreakoutHD LBreakoutHD] - lbreakouthd -- Ball-and-paddle game (LBreakout2 successor). Note: No level editor available, lbreakout2 is needed for level creation.<br />
* [https://lgames.sourceforge.io/LPairs LPairs] - lpairs -- Classical memory game.<br />
* [https://github.com/troglobit/tetris Micro Tetris] - micro-tetris -- Uses ANSI escape sequences and can fit in embedded devices<br />
* [https://www.minetest.net/ Minetest] - minetest -- An Inspired Minecraft game<br />
* [https://openrct2.org/ OpenRCT2] - OpenRCT2 -- Re-implementation of RollerCoaster Tycoon 2<br />
* [https://en.wikipedia.org/wiki/OpenTTD OpenTTD] - openttd -- A business simulation game<br />
* [http://www.retroarch.com RetroArch] - retroarch -- Frontend for emulators, game engines and media players using the libretro API<br />
* [https://www.nethack.org NetHack] - Rogue-like dungeon crawler<br />
* [https://www.supertux.org/ SuperTux] - supertux -- Classic 2D jump'n run sidescroller game in a style similar to the original Super Mario games.<br />
* [https://supertuxkart.net/Main_Page SuperTuxKart] - Kart racing game with OSS mascots<br />
* [http://www.xonotic.org/ Xonotic] - xonotic -- A FPS arena game<br />
<br />
== Game related software ==<br />
* [[Steam]] can be installed on Alpine, although Valve only support using Steam on Ubuntu.<br />
* [https://en.wikipedia.org/wiki/Wine_(software) Wine] - wine -- It is typically used to play Windows games - You may need to chroot/multiboot as 32-bit Alpine to use 32 bit Windows games. If you use x86_64, you can only run 64 bit Windows programs.<br />
* [https://obsproject.com/ OBS Studio] - obs-studio -- It is used to live stream a gaming session.</div>AAT596https://wiki.alpinelinux.org/w/index.php?title=Gaming_on_Alpine&diff=20224Gaming on Alpine2021-11-01T22:58:41Z<p>AAT596: Added SuperTux to the game list</p>
<hr />
<div>'''Gaming on Alpine''' is a thing.<br />
<br />
== Installing games ==<br />
<br />
sudo apk add micro-tetris<br />
<br />
== Permissions ==<br />
<br />
To make sure your account is in the games group. You could do.<br />
<br />
sudo gpasswd -a name games<br />
<br />
Log off then relog back on.<br />
<br />
== List of games available on Alpine Linux ==<br />
<br />
* [http://www.advancemame.it/ AdvanceMAME] - advancemame -- Arcade Simulator<br />
* [https://wiki.gnome.org/Apps/Aisleriot Aisleriot] - aisleriot -- Solitaire card games<br />
* [https://www.dosbox.com/ DOSBox] - dosbox -- DOS-emulator that uses SDL-library<br />
* [http://frotz.sourceforge.net/ Frotz] - frotz -- Z machine (Infocom interactive fiction) Interpreter<br />
* [http://home.flightgear.org FlightGear] - flightgear -- Flight Simulator<br />
* [https://freedoom.github.io/ Freedoom]+[https://www.chocolate-doom.org/ Chocolate Doom] - freedoom, chocolate-doom -- a free Doom game and an engine to run it<br />
* [https://en.wikipedia.org/wiki/GNU_Chess GNU Chess] - gnuchess -- Play chess against the computer<br />
* [https://github.com/troglobit/tetris Micro Tetris] - micro-tetris -- Uses ANSI escape sequences and can fit in embedded devices<br />
* [https://www.minetest.net/ Minetest] - minetest -- An Inspired Minecraft game<br />
* [https://openrct2.org/ OpenRCT2] - OpenRCT2 -- Re-implementation of RollerCoaster Tycoon 2<br />
* [https://en.wikipedia.org/wiki/OpenTTD OpenTTD] - openttd -- A business simulation game<br />
* [http://www.retroarch.com RetroArch] - retroarch -- Frontend for emulators, game engines and media players using the libretro API<br />
* [https://www.nethack.org NetHack] - Rogue-like dungeon crawler<br />
* [https://www.supertux.org/ SuperTux] - supertux -- Classic 2D jump'n run sidescroller game in a style similar to the original Super Mario games.<br />
* [https://supertuxkart.net/Main_Page SuperTuxKart] - Kart racing game with OSS mascots<br />
* [http://www.xonotic.org/ Xonotic] - xonotic -- A FPS arena game<br />
<br />
== Game related software ==<br />
* [[Steam]] can be installed on Alpine, although Valve only support using Steam on Ubuntu.<br />
* [https://en.wikipedia.org/wiki/Wine_(software) Wine] - wine -- It is typically used to play Windows games - You may need to chroot/multiboot as 32-bit Alpine to use 32 bit Windows games. If you use x86_64, you can only run 64 bit Windows programs.<br />
* [https://obsproject.com/ OBS Studio] - obs-studio -- It is used to live stream a gaming session.</div>AAT596