MariaDB is an open-source relational database management system (RDBMS) that is a fork of MySQL. It was created by the original developers of MySQL after concerns arose over Oracle Corporation's acquisition of MySQL. MariaDB aims to maintain high compatibility with MySQL, ensuring that users and applications can easily transition from MySQL to MariaDB without significant changes.
mysql -h <Hostname> -u root
mysql -h <Hostname> -u root@localhost
show databases; # see all databases on the device
use <database>; # use a database
connect <database>; #
show tables; # display tables in current database
describe <table_name>; # see detailed info about the table
show columns from <table>; # see detailed info about table
CREATE TABLE SHIPS (
NAME VARCHAR(50),
CLASS VARCHAR(50),
LAUNCHED INT
);
CREATE TABLE BATTLES (
NAME VARCHAR(50),
DATE DATETIME
);
CREATE TABLE CLASSES (
CLASS VARCHAR(50),
TYPE VARCHAR(2),
COUNTRY VARCHAR(20),
NUMGUNS INT,
BORE REAL,
DISPLACEMENT INT
);
CREATE TABLE OUTCOMES (
SHIP VARCHAR(50),
BATTLE VARCHAR(50),
RESULT VARCHAR(10)
);