当前位置:Gxlcms > 数据库问题 > Create a database in mysql for mac

Create a database in mysql for mac

时间:2021-07-01 10:21:17 帮助过:20人阅读

*** Welcome... Type help; or \h for help. Type \c to clear the current input statement. /* view databases */ mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | leave_info_system | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.03 sec) /* create new database */ mysql> create database testDB; Query OK, 1 row affected (0.01 sec) /* If you want to operate at a specific database, you have to change to the db */ mysql> use testDB; Database changed /* create new tables in testDB */ mysql> create table testTB( -> testNum VARCHAR(16) NOT NULL, -> testName VARCHAR(32) NOT NULL, -> testDate DATE NOT NULL); Query OK, 0 rows affected (0.12 sec) /* view fields in testTB */ mysql> describe testTB; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+ | testNum | varchar(16) | NO | | NULL | | | testName | varchar(32) | NO | | NULL | | | testDate | date | NO | | NULL | | +----------+-------------+------+-----+---------+-------+ 3 rows in set (0.01 sec)

 

 

Create a database in mysql for mac

标签:arc   use   key   blog   system   esc   row   ecif   com   

人气教程排行