MySQL 5.6 installation
user@user-VirtualBox:~$ sudo apt-get install mysql-server-5.6
MySQL root password
Run MySQL
user@user-VirtualBox:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.6.33-0ubuntu0.14.04.1 (Ubuntu)
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> create database employee_DB;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| employee_DB |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
mysql> exit;
bye
Create table EMP_INFO under employee_DB
mysql> CREATE TABLE EMP_INFO (emp_ID VARCHAR(10),emp_name VARCHAR(40),emp_age INT,emp_sex VARCHAR(1),PRIMARY KEY(emp_ID));
Query OK, 0 rows affected (0.05 sec)
mysql> show tables;
+----------------------------+
| Tables_in_employee_DB |
+----------------------------+
| EMP_INFO |
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| django_content_type |
| django_migrations |
| django_session |
+----------------------------+
10 rows in set (0.00 sec)
mysql>
Insert values into table EMP_INFO
mysql> describe EMP_INFO;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| emp_ID | varchar(10) | NO | PRI | | |
| emp_name | varchar(40) | YES | | NULL | |
| emp_age | int(11) | YES | | NULL | |
| emp_sex | varchar(1) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
4 rows in set (0.06 sec)
mysql> INSERT INTO EMP_INFO(emp_ID,emp_name,emp_age,emp_sex)VALUES("E1","Abhisek Roy",32,"M");
Query OK, 1 row affected (0.09 sec)
mysql> describe EMP_INFO;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| emp_ID | varchar(10) | NO | PRI | | |
| emp_name | varchar(40) | YES | | NULL | |
| emp_age | int(11) | YES | | NULL | |
| emp_sex | varchar(1) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> select * from EMP_INFO;
+--------+-------------+---------+---------+
| emp_ID | emp_name | emp_age | emp_sex |
+--------+-------------+---------+---------+
| E1 | Abhisek Roy | 32 | M |
+--------+-------------+---------+---------+
1 row in set (0.03 sec)
mysql>
MySQL 5.6 installation
MySQL root password
Run MySQL
Create table EMP_INFO under employee_DB
Insert values into table EMP_INFO