ADMINISTRATION

AUTHENTICATION & INTERACTION (LOCAL)

#authentication & interaction
root@oco:~$ mysql -u {username} -p{password}
 * the -u is used to supply the username
 * the -p is used to supply the password
    - -p flag should be passed empty, so we are prompted to enter the 
      password and do not pass it directly on the command line since it could
      be stored in cleartext in the bash_history file, logs or terminal history
    - there shouldn't be any spaces between the -p and the password!
 * when no host is specified, login will default to the localhost server.
 
mysql> show grants
 * view which privileges the logged-in user have

AUTHENTICATION & INTERACTION (REMOTE)

root@oco:~$ mysql -u root -h {docker.cnd.dev} -P 3306 -p 
 * the -h is used to supply the remote host DBMS server
 * the -P refers to the remote port
    - 3306 is the default MySQL/MariaDB port

CREATING USERS

CREATING DATABASES

CREATING TABLES

ADDING RECORDS (SINGLES)

ADDING RECORDS (MULTIPLE)

REMOVING TABLES & DATABASES

MODIFICATIONS: ADDING NEW COLUMNS

MODIFICATIONS: RENAME COLUMNS

ALTERATIONS/MODIFICATIONS: CHANGING COLUMN DATA TYPE

MODIFICATIONS: DROPPING COLUMNS

MODIFICATIONS: CHANGING TABLE PROPERTIES

Last updated