Mysql: Difference between revisions

From roonics
Jump to navigation Jump to search
Line 10: Line 10:


<pre>show processlist;</pre>
<pre>show processlist;</pre>
===Create database===
<pre>CREATE DATABASE <db_name;</pre>
===Show databases===
<pre>show databases;</pre>
===Select database===
<pre>use <db_name>;</pre>
===Show tables===
<pre>show tables;</pre>
===Show table layout===
<pre>describe <table_name>;</pre>

Revision as of 11:18, 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>;