Basic CRUD operation of MySQL database

https://blog.csdn.net/weixin_46083166/article/details/105298325 Intimate Tip: clear screen command CLS;
: MySQL online reference manual
first log database server :
mysql -uroot -p,
mysql -uroot -p123456(123456) is your password
Note: Sign the back of the statement Do not add later ; Insert picture description here
check the database:
show database;
these are the databases that come with MySQL, do not delete them. Insert picture description here
Create a database :
create database 数据库的名称;
such as: create database day06;

this is built;
---- specify the character set when creating the database:
create datebase 数据库的名称 character set 字符集;
such as: create database day06_1 character set utf8;
Insert picture description here
create database 数据库的名称 charater set 字符集 collate 校对规则;(The system uses utf8 Character set, if the utf8_bin collation rule is used to execute SQL query, it is case sensitive, and utf8_general_ci is case-insensitive (the collation rule corresponding to the default utf8 character set is utf8_general_ci).) For
example: create database day06_2 charater utf8 collate utf8_bin;
Insert picture description hereyou can view all databases:
Insert picture description here
view the statements defined by the database :
show create database 数据库的名字
Such as: show create database day06;
Insert picture description here
modify the character set of the data
alter database 数据库的名称 character set 字符集;
ru: alter database day06_1 character set gbk;Insert picture description heredelete the database:
drop database 数据库的名字;
such as: drop database day06_2;
Insert picture description here
other database operation commands:
__ check the database currently in use: select database();
Insert picture description here
__ switch the database
use 数据库名字;
such as:use day06;
Insert picture description here
CRUD operation of MySQL table structure: https://blog.csdn.net/weixin_46083166/article/details/105298325

Guess you like

Origin blog.csdn.net/weixin_46083166/article/details/105294842