Home  >  Article  >  Database  >  Linux平台下MySQL命令操作

Linux平台下MySQL命令操作

WBOY
WBOYOriginal
2016-06-07 17:05:491155browse

Linux shell 批量创建数据库/表 Shell 脚本如下: # create database and table HOST=

Linux shell 批量创建数据库/表

Shell 脚本如下:

执行脚本后,结果如下:



MySQL 从常用操作命令:

显示数据库

show databases;

切换数据库
use top123;

显示数据库表

show tables;

修改主键

alter table gametop800 add primary key(id);

删除主键

alter table gametop800 drop primary key;

添加组合主键

alter table gametop800 add primary key(id, dtime);


如果感兴趣的话,可以深入综合运用awk,cut,paste,正则表达式,数据库操作等较为复杂的语法,完成MySQL数据库操作

下面是实现了一个抓取网页,,提取特征,抽取信息,结果汇总,批量插入数据库永久保存

示例:

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn