linux:mariadb:mariadb-setup
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| linux:mariadb:mariadb-setup [2019/09/13 09:58] – oscar | linux:mariadb:mariadb-setup [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Install MariaDB ===== | ||
| - | To install MariaDB, run the command below; | ||
| - | # apt-get install mariadb-server mariadb-client | ||
| - | When installed, MariaDB is started and enabled to run on system boot. | ||
| - | # systemctl is-enabled mariadb | ||
| - | | ||
| - | # systemctl status mariadb | ||
| - | |||
| - | ● mariadb.service - MariaDB 10.3.15 database server | ||
| - | Loaded: loaded (/ | ||
| - | Active: active (running) since Thu 2019-07-18 15:31:35 EDT; 9min ago | ||
| - | Docs: man: | ||
| - | https:// | ||
| - | Main PID: 2356 (mysqld) | ||
| - | Status: " | ||
| - | | ||
| - | Memory: 76.4M | ||
| - | CGroup: / | ||
| - | └─2356 / | ||
| - | After installing MariaDB database server, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots. | ||
| - | # systemctl stop mariadb.service | ||
| - | # systemctl start mariadb.service | ||
| - | # systemctl enable mariadb.service | ||
| - | |||
| - | ==== Database location ==== | ||
| - | Database is located at: | ||
| - | # cd / | ||
| - | |||
| - | ==== Check location used config file ==== | ||
| - | The location of the used config file can be found by: | ||
| - | / | ||
| - | |||
| - | ==== MariaDB initial Security ==== | ||
| - | By default, MariaDB uses unix_socket plugin for authentication and thus, it doesn’t require password to login. You can simply run mysql or mysql -u root to login to MariaDB server. | ||
| - | # mysql | ||
| - | |||
| - | | ||
| - | Your MariaDB connection id is 48 | ||
| - | | ||
| - | | ||
| - | Type ' | ||
| - | | ||
| - | |||
| - | You can now run the mysql_secure_installation script to remove MariaDB test databases, anonymous users and disallow remote root login. To run the script, just run the command below | ||
| - | # mysql_secure_installation | ||
| - | |||
| - | When prompted, answer the questions below by following the guide. | ||
| - | |||
| - | Enter current password for root (enter for none): Just press the Enter | ||
| - | * Set root password? [Y/n]: Y | ||
| - | * New password: Enter password | ||
| - | * Re-enter new password: Repeat password | ||
| - | * Remove anonymous users? [Y/n]: Y | ||
| - | * Disallow root login remotely? [Y/n]: Y | ||
| - | * Remove test database and access to it? [Y/ | ||
| - | * Reload privilege tables now? [Y/ | ||
| - | * Restart MariaDB server | ||
| - | |||
| - | To test if MariaDB is installed, type the commands below to logon to MariaDB server | ||
| - | |||
| - | # sudo mysql -u root -p | ||
| - | |||
| - | Then type the password you created above to sign on… if successful, you should see MariaDB welcome message | ||
| - | |||
| - | ==== Remote Access ==== | ||
| - | By default the remote access is disabled. In order to enable remote access make the following changes to the configuration file: | ||
| - | < | ||
| - | # nano / | ||
| - | |||
| - | Disabled the line: bind-address = 127.0.0.1. | ||
| - | # | ||
| - | |||
| - | #And add 2 new lines: | ||
| - | skip-networking=0 | ||
| - | skip-bind-address | ||
| - | </ | ||
linux/mariadb/mariadb-setup.1568368694.txt.gz · Last modified: (external edit)
