MySql Installation

- Posted in Server Configuration by

Mysql Installation

$ apt install -y mariadb-server mariadb-client $ systemctl status mariadb $ mysql_secure_installation Set root password Remove anonymous users. Disable remote login for root user. Remove test database and access to it.

$ mysql -u root -p --Enter password: Maria DB [(none)]>

CREATE DATABASE crunch; CREATE USER 'crunch'@localhost IDENTIFIED BY 'password'; (check its status by entering: SELECT User FROM mysql.user;)

GRANT ALL PRIVILEGES ON . TO 'crunch'@localhost IDENTIFIED BY 'andibutt1986'; (GRANT ALL PRIVILEGES ON 'crunch'.* TO 'crunch'@localhost;)

FLUSH PRIVILEGES; SHOW GRANTS FOR 'crunch'@localhost;

SHOW DATABASES; Exit

DROP USER 'crunch'@localhost;