Mysql Commands: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
**Using defaults | **Using defaults | ||
:: <code> mysql> CREATE DATABASE param; </code> | :: <code> mysql> CREATE DATABASE param; </code> | ||
:*Using specific parameters | :*Using specific parameters | ||
:: <code> mysql> CREATE DATABASE param DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; </code> | :: <code> mysql> CREATE DATABASE param DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; </code> | ||
*Delete database: param | *Delete database: param |
Revision as of 12:45, 10 January 2020
Installation
- Installation on ubuntu server through terminal
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo systemctl status mariadb
- Start or stop mariadb server services
sudo systemctl stop mariadb
sudo systemctl start mariadb
Database Management
- Create database: param
- Using defaults
mysql> CREATE DATABASE param;
- Using specific parameters
mysql> CREATE DATABASE param DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Delete database: param
mysql> DROP DATABASE param;
- List the databases created in the database server
SHOW DATABASES;