Introduction
This page describes how Alexis Huxley installed the MariaDB server software on his own systems.
Procedure
This procedure is very very rough because I wrote it after actually doing it rather than in parallel.
- Run:
apt-get install mariadb-server
- To allow TCP connections from anywhere edit /etc/mysql/mariadb.conf.d/50-server.cnf and set:
[mysqld] ... bind-address = 0.0.0.0
and then run:
service mariadb restart
MariaDB basics
- Create a user and allow them to create databases that start with their login by running something like:
arata# mariadb MariaDB> CREATE USER 'alexis'@'%' IDENTIFIED BY 'alexispassword';
(see:
CREATE USER
) - Allow the user to do anything (except grant privileges):
MariaDB> GRANT ALL PRIVILEGES ON *.* TO 'alexis'@'%';
or create a database and grant the user priviliges on that database only:
MariaDB> CREATE DATABASE testdb; MariaDB> GRANT ALL PRIVILEGES ON testdb.* TO 'alexis'@'%';
(see:
CREATE DATABASE
,GRANT
) - Show all grants:
MariaDB> SELECT grantee, privilege_type FROM information_schema.user_privileges;
- Revoke all grants:
MariaDB> REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'alexis'@'%';
(see:
REVOKE
) - Configure client to autoconnect:
echo -e '[mysql]\nhost=arata.pasta.net\npassword="alexispassword"' > ~/.my.cnf
(see: mariadb man page; file options are command line options but without the
--
prefix.)