MySql / MariaDB

Connect to mySql

mysql -h localhost -u myname -p mydb
  • -h: host ip
  • -u: username
  • -p: password

Advance tag for connect

  • --port=13306: specific port
  • --protocol=TCP: specific protocol

Inside usage

Show all database

SHOW DATABASES;

Goto that database

USE my_target_db;

Shows all tables in database

SHOW TABLES