基本的MySQL操作
1.創(chuàng)建數(shù)據(jù)庫(kù)
在登陸 MySQL 服務(wù)后,使用 create 命令創(chuàng)建數(shù)據(jù)庫(kù)
操作語(yǔ)法:create database 數(shù)據(jù)庫(kù)名;
2.查看已有數(shù)據(jù)庫(kù)
操作語(yǔ)法:show databases;
3.選擇數(shù)據(jù)庫(kù)
操作語(yǔ)法:use 數(shù)據(jù)庫(kù)名;
4.刪除數(shù)據(jù)庫(kù)
操作語(yǔ)法:drop database 數(shù)據(jù)庫(kù)名;
5.創(chuàng)建數(shù)據(jù)表
使用(use 數(shù)據(jù)庫(kù)名;)選擇好數(shù)據(jù)庫(kù)后進(jìn)行數(shù)據(jù)表的創(chuàng)建。
操作語(yǔ)法:create table table_name (column_name column_type);
6.查看已有數(shù)據(jù)表
操作語(yǔ)法:show tables;
7.插入數(shù)據(jù)
操作語(yǔ)法:
INSERT INTO table_name ( field1, field2,...fieldN )VALUES( value1, value2,...valueN );8.查看數(shù)據(jù)表內(nèi)容
操作語(yǔ)法:select * from table_name;
9.刪除數(shù)據(jù)表
操作語(yǔ)法:drop table table_name;
10.更多操作語(yǔ)法可參考:https://www.yiibai.com/mysql
總結(jié)
以上是生活随笔為你收集整理的基本的MySQL操作的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 优酷回应 1 元会员退费争议:活动规则已
- 下一篇: 遭遇一次MySQL猜解注入攻击