You are here
Home > featured > MySQL Cheatsheet

MySQL Cheatsheet

Login to MySql:
mysql -u username -p password

Create Database:
create database databasename character set utf8 collate utf8_general_ci;
grant all on databasename.* to databaseUser@’localhost’ identified by ‘password’;

Delete Database:
drop database databasename

Import Database:
mysql -u username -p password databasename < /importfilePath

Import Database:
mysqldump -u username -p password databasename > /exportfilePath

List all Databases:
show databases;

Select Database:
use databasename;

List Tables of a database:
show tables;