代码拉取完成,页面将自动刷新
MariaDB [(none)]> SHOW DATABASES; # 查看有哪些数据库
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
MariaDB [(none)]> CREATE DATABASE tedu1 CHARSET utf8; #建库
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| tedu1 | # 查到tedu1,创建成功
+--------------------+
MariaDB [(none)]> USE tedu1; # 选择要操作的数据库
Database changed
MariaDB [tedu1]> SHOW TABLES; # 查看当前库下有哪些表
Empty set (0.000 sec)
tedu1]> CREATE TABLE bumen(bumen_id INT, bumen_name VARCHAR(30));
Query OK, 0 rows affected (0.00 5 sec) # 建表语句
MariaDB [tedu1]> INSERT INTO bumen VALUES(1, "OPS"); # 插入数据
MariaDB [tedu1]> INSERT INTO bumen VALUES(2, "DEV");
MariaDB [tedu1]> SELECT * FROM bumen; # 再次查询,2条数据入库
+----------+------------+
| 1 | OPS |
| 2 | DEV |
+----------+------------+
MariaDB [tedu1]> UPDATE bumen SET bumen_name="HR" WHERE bumen_id=1;
Query OK, 1 row affected (0.003 sec) # 更新语句
MariaDB [tedu1]> SELECT * FROM bumen;
+----------+------------+
| 1 | HR | # 从ops变成了hr
| 2 | DEV |
+----------+------------+
MariaDB [tedu1]> DELETE FROM bumen; # 删除表数据
MariaDB [tedu1]> SELECT * FROM bumen;
Empty set (0.000 sec)
MariaDB [tedu1]> DROP TABLE bumen; # 删除表
MariaDB [tedu1]> SHOW TABLES;
Empty set (0.000 sec)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。