Mysql on console

Work with MySQL on console

BASICS

Connect to Mysql
mysql -hlocalhost -uusername -ppassword databasename
Show Databases
SHOW DATABASES;
Use a Database
USE database;
Show Database Settings
Show Variables;
Show tables in a Database
SHOW TABLES;
Show table structure
mysql> DESCRIBE table;

PROCESSES

Show Processlist
show processlist;
Kill process
kill process id;

BACKUP

mysqldump -hhost.example.com -uusername -ppasswort dbname > /home/user/backup/backup_db.sql