Professional Documents
Culture Documents
on 2023/08/15 16:12
Quick help
Table of Contents
Maria DB quick reference guida ........................................................................................................................................... 3
Functions and operators ..................................................................................................................................................... 3
Maria DB commands ............................................................................................................................................................. 4
Show session and global variables ................................................................................................................................... 4
Show tables and views ....................................................................................................................................................... 4
Show tables and columns ................................................................................................................................................... 5
Show tables and records .................................................................................................................................................... 5
Show store procedures and functions ............................................................................................................................... 5
Strict mode ............................................................................................................................................................................ 5
Foreign key check ................................................................................................................................................................ 5
SQL Server commands ......................................................................................................................................................... 6
List functions and store procedures .................................................................................................................................. 6
List tables, views and rows ................................................................................................................................................ 6
Linux commands ..................................................................................................................................................................... 7
Update Ubuntu Server ........................................................................................................................................................ 7
Create user name ................................................................................................................................................................ 7
Add user to sudo group ...................................................................................................................................................... 7
Switch to user ....................................................................................................................................................................... 7
Change password ................................................................................................................................................................ 7
Name Description
+ Addition operator
/ Division operator
* Multiplication operator
% Modulo operator. Returns the remainder of N divided by M
- Subtraction operator
= Not equals
< Less than
<= Less than or equal
<=> NULL-safe equal
= Equal
> Greater than
>= Greater than or equal
Logical NOT
&& Logical AND
XOR Logical XOR
|| Logical OR
BETWEEN AND True if expression between two values.
CASE Returns the result where value=compare_value or for the first
condition that is true
CAST Casts a value of one type to another type
CONCAT Returns concatenated string
CONCAT_WS Concatenate with separator
CONVERT Convert a value from one type to another type
Maria DB commands
Show session and global variables
show global variables;
show session variables;
-- Show tables
SHOW FULL TABLES
WHERE Table_Type LIKE 'TABLE';
Strict mode
set global innodb_default_row_format='dynamic';
set session innodb_strict_mode=OFF;
Name,
reserved AS [Tama ñ o en Disco (KB)],
data AS [Datos (KB)],
index_size AS [Indices (KB)],
Unused AS [No usado (KB)],
Rows AS Filas FROM #results
ORDER BY
CONVERT(bigint, reserved) DESC
--Eliminar la tabla temporal
DROP TABLE #results
Linux commands
Update Ubuntu Server
-- Update Ubuntu server
sudo apt update;
sudo apt upgrade;
sudo reboot;
-- List available packages
sudo apt list --upgradable;
sudo cat /var/lib/update-notifier/updates-available;
-- List security updates
sudo unattended-upgrade --dry-run
Switch to user
su - username
Change password
passwd
Show