SHOW DATABASES 展示数据库
alter table 表名 AUTO_INCREMENT=1;表自增从1开始
–alter table 表名
auto_increment=1; //重置表的主键
– CREATE DATABASE tpshop 创建数据库
– USE tpshop
;使用这个表
– SHOW TABLES;显示所有的表
– SHOW COLUMNS FROM dp_admin_log;
– SELECT * FROM dp_admin_log;
– DROP TABLE dp_admin_log 删除表
– CREATE TABLE dp_admin_log(
– id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
– admin_name VARCHAR(255) NOT NULL,
– add_time INT NOT NULL,
– msg VARCHAR(255)
– )新建表字段
– INSERT INTO dp_admin_log VALUES (“1”,“admin_user”,“125156156151”,“kkkklllm”);
– UPDATE dp_admin_log SET admin_name=“dahainizainali” WHERE id=1 插入数据
– DELETE FROM dp_admin_log WHERE id=1 删除数据
– SELECT A.id,B.name,A.nickname ,A.password FROM dp_admin_user AS A INNER JOIN dp_admin_role AS B WHERE A.nickname = B.name 联合查询
– DROP DATABASE haitun 删除数据库
ALTER TABLE dp_admin_log DROP num 修改增加(ADD)和删除字段
日常MYSQL语句
最新推荐文章于 2024-08-12 23:11:19 发布