Mitch's Technical Blog

MySQL (MariaDB) Notes

October 25, 2018
mysql, notes
permalink

My personal reference notes. A living document.

Installation

sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation

sudo systemctl status mariadb
sudo systemctl enable mariadb

Questions

- Why does mysql -u root -p not work?
- But sudo -u root -p DOES work?
- Both are after running mysql_secure_installation (with sudo)
- After creating 'admin'@'localhost' account (see statement below) it was possible to login with mysql -u admin -p [no sudo].

Statements

GRANT ALL ON . TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

USE test;

describe books;

Recap

- mysql -u admin -p

Contact: hello at escapefromsql.net