Friday 22 July 2016

Create database

Step 1: Connect to MySQL server.

Use the command 'mysql -u krishna -p'
$ mysql -u krishna -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.13 Homebrew

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

Step 2: Use the statement "CREATE DATABASE DATABASE_NAME" to create database.

Ex: 'CREATE DATABASE sample' creates database sample.
mysql> CREATE DATABASE sample;
Query OK, 1 row affected (0.00 sec)



Previous                                                 Next                                                 Home

No comments:

Post a Comment