Mariadb continue..

here is how to verify that mariadb is listening on all interface.

Server > ss -tulpn | grep mysql

result: tcp LISTEN 0 50 *:3306 *:* users:(("mysqld", 13611,13))

here is how to enable skip-networking directive. this will disable the mysql from listening to all interface.
Server > vi  /etc/my.cnf

add below line
skip-networking=1

to login into your mysql server
Server > mysql -u root -p

to show database
mariadb > SHOW DATABASES;

create a database
mariadb > CREATE DATABASE inventory;
mariadb > USE inventory;
mariadb > DESCRIBE inventory;

what is CRUD
C-reate (INSERT)
R-ead (SELECT)
U-pdate (UPDATE)
D-elete (DELETE)

to insert data into table.
mariadb > INSERT INTO table (field1, field2..) VALUES ('value1', 'value2'..);

to delete a record with delete
mariadb > DELETE FROM table where id = x;

to update
mariadb > UPDATE product SET value1 where id = x;

to read
mariadb > SELECT attribule FROM table;



Comments