Before reading the blog, make sure you had succcessfully installed MySQL for Mac.
Create a database:
- Login
- Create a database
- Create tables
$ mysql-u Root-p$ Enter Password:***Welcome ... Type'Help ;'Or'\h' forHelp. Type'\c'ToClearThe current input statement./*View Databases*/MySQL>show databases;+--------------------+| Database |+--------------------+| Information_schema | | Leave_info_system | | MySQL | | Performance_schema | | SYS |+--------------------+5RowsinchSet (0.03sec)/*Create New Database*/MySQL>CREATE DATABASE TestDB; Query OK,1Row affected (0.01sec)/*If you want to operate at a specific DB*/MySQL>Use Testdb;database changed/*Create new tables in TestDB*/MySQL>CREATE TABLE TESTTB (-Testnum VARCHAR ( -) not NULL,-TestName VARCHAR ( +) not NULL,-testdate DATE not NULL); Query OK,0Rows Affected (0.12sec)/*view fields in TESTTB*/MySQL>describe TESTTB;+----------+-------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+----------+-------------+------+-----+---------+-------+| Testnum | varchar -) | NO | | NULL | || testname | varchar +) | NO | | NULL | || TestDate |Date| NO | | NULL | |+----------+-------------+------+-----+---------+-------+3RowsinchSet (0.01Sec
Create a database in MySQL for Mac