Start/Stop MySQL Service under MacOS
Local connection MySQL Service, user name: root, Password: abc123
$ mysql-hlocalhost-uroot-pabc123
Show Database list
mysql> show databases;
Displaying data tables in a library
mysql> use MySQL;
Mysql> Show tables;
Building libraries and deleting libraries
mysql> CREATE DATABASE BCU;
mysql> drop Database BCU;
Establishment and deletion of tables
mysql> use BCU;
Mysql> CREATE TABLE Finance (name varchar (+), amount int);
mysql> drop table Finance;
Show the structure of a data table
Mysql> describe finance;
Emptying records in a table
mysql> Delete from finance;
Show records in a table
Mysql> select * from Finance;
Add a record to the table
mysql> INSERT INTO finance values ("Tanyun", 100);
Updating data in a table
Mysql> Update finance set amount=150 where name= ' Tanyun ';
Delete data from a table
mysql> Delete from finance where name = ' Tanyun ';
MySQL Basic Operations Command