Tuesday, November 14, 2017

MariaDB on CentOS 7

With Docker

https://hub.docker.com/_/mariadb/

docker run --name some-mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mariadb:10.3.9

docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b02cd9d0dff0 mariadb:10.3.9 "docker-entrypoint.s…" 13 seconds ago Up 10 seconds 3306/tcp some-mariadb



port is 3306


IMPORTANT: read here https://mariadb.com/kb/en/library/installing-and-using-mariadb-via-docker/ the customization to be done on the Mariadb container.

container linking : docker run --name some-app --link some-mariadb:mysql -d application-that-uses-mysql



Without docker:

https://www.tecmint.com/install-mariadb-in-centos-7/



Useful introduction for digitalocean https://www.digitalocean.com/community/tutorials/how-to-create-and-manage-databases-in-mysql-and-mariadb-on-a-cloud-server


sudo systemctl start mariadb
sudo systemctl daemon-reload
sudo systemctl start mariadb
sudo mysql_secure_installation


Here https://www.heidisql.com/download.php?download=portable a MariaDB UI

Otherwise you can use https://razorsql.com/ which comes with a cost (free evaluation available)

Apparently you can try also with good old SQLDeveloper https://oracle-base.com/articles/mysql/mysql-connections-in-sql-developer



CREATE DATABASE calories
GRANT ALL PRIVILEGES ON calories.* TO 'calories'@'localhost' IDENTIFIED BY 'calories' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON calories.* TO 'calories'@'%' IDENTIFIED BY 'calories' WITH GRANT OPTION;

CREATE TABLE calories.users
(id INT(10) NOT NULL,
email VARCHAR(100) NOT NULL,
PRIMARY KEY (id))






No comments: