1、第一步,查询语句:select*fromtable_name或select*fromtable_namewhere[条件]
2、第二步,增加语句或插入数据insertintotable_name(clus...)values(values...)实例如图:
3、修改数据:updatetablenamesetxx=xx,xxx=xxwherexxx=xxxandxxx=xxx
4、第四步,删除语句deletetable_namewhere条件实例如图:
mysql>CREATE DATABASE sakila
mysql>USE sakila
mysql>CREATE TABLE actor (
actor_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
first_name VARCHAR(45) NOT NULL,
last_name VARCHAR(45) NOT NULL,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (actor_id),
KEY idx_actor_last_name (last_name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8
ALTER TABLE {库名}.{表名} DISCARD TABLESPACE
例:
mysql>ALTER TABLE sakila.actor DISCARD TABLESPACE
cp /backup_directory/actor.ibd path/to/mysql-5.7/data/sakila/
ALTER TABLE {库名}.{表名} IMPORT TABLESPACESHOW WARNINGS
例:
mysql>ALTER TABLE sakila.actor IMPORT TABLESPACESHOW WARNINGS
Query OK, 0 rows affected, 1 warning (0.15 sec)
Warning | 1810 | InnoDB: IO Read error: (2, No such file or directory)
Error opening './sakila/actor.cfg', will attempt to import
without schema verification
mysql>SELECT COUNT(*) FROM sakila.actor
+----------+
| count(*) |
+----------+
| 200 |
+----------+
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)