!!! MySQL Database

"mysql" is the name of the command line utility.


“MySQL Workbench” is the gui utility

“root” is the top level user.

mysql  -h  <host>  -u  <USER>  -p<PASSWORD>  <DBNAME>

!! mysql commands

status;

source <filename>

show databases;

use <database>

show tables;

use <DBNAME>;

exit

drop database <dbname>;

create database <dbname>;

describe <table>;

show create table <table>;

select * from <table> LIMIT N;

!!Data Types

| TINYINT | 1
| SMALLINT | 2
| MEDIUMINT | 3
| INT | 4
| BIGINT | 8
| FLOAT | 4
| DOUBLE | 8
| DATE |
| TIME |
| DATETIME |
| TIMESTAMP | UTC
| CHAR |
| VARCHAR |
| BLOB | binary
| TEXT | text


!!CSV Export
{{{mysql -h HHHHH -u UUUUU -pPPPPP -A -B \
	-e "select …." DBNAME \
	| sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" >file.csv}}}