Mysql: Difference between revisions

From roonics
Jump to navigation Jump to search
No edit summary
Line 25: Line 25:
===Show table layout===
===Show table layout===
<pre>describe <table_name>;</pre>
<pre>describe <table_name>;</pre>
[[Category:mysql]]
[[Category:linux]]

Revision as of 11:20, 15 March 2019

MySQL

Useful Commands

Connect to database

mysql -u <username> -p

Show process list

mysqladmin -p processlist

or if already connected to MySQL

show processlist;

Create database

CREATE DATABASE <db_name;

Show databases

show databases;

Select database

use <db_name>;

Show tables

show tables;

Show table layout

describe <table_name>;