在shell下使用mysql方法
2016-03-29 11:55
519 查看
在shell下使用mysql,按照下面的方法。
$mysql -u -p
password:
mysql>show databases; //显示有哪些数据库
mysql>create DATABASE lll; //创建一个名为lll的数据库
mysql>use lll; //使用名为lll的数据库
mysql>show tables; //显示当前数据库中有哪些表
mysql>CREATE TABLE user (username TEXT not null , userpassword TEXT not null ) //创建一个表
mysql>ALTER TABLE user ADD email TEXT not null; //当前表增加一个字段
mysql>ALTER TABLE test DROP come; //当前表丢弃一个字段
mysql>ALTER TABLE test CHANGE pass pass LONGTEXT not null; //更改当前表中的一个字段
mysql>DROP TABLE user; //丢弃当前数据库中的一个表。
2、php3代码实现数据库的创建;
3、使用php3创建一个表:
$mysql -u -p
password:
mysql>show databases; //显示有哪些数据库
mysql>create DATABASE lll; //创建一个名为lll的数据库
mysql>use lll; //使用名为lll的数据库
mysql>show tables; //显示当前数据库中有哪些表
mysql>CREATE TABLE user (username TEXT not null , userpassword TEXT not null ) //创建一个表
mysql>ALTER TABLE user ADD email TEXT not null; //当前表增加一个字段
mysql>ALTER TABLE test DROP come; //当前表丢弃一个字段
mysql>ALTER TABLE test CHANGE pass pass LONGTEXT not null; //更改当前表中的一个字段
mysql>DROP TABLE user; //丢弃当前数据库中的一个表。
2、php3代码实现数据库的创建;
3、使用php3创建一个表:
相关文章推荐
- .bash和.zsh的切换
- Warshell's Algorithms
- shell 脚本:使用过程中使得变量能够赋值
- mac 常用shell命令
- Linux进阶之bash编程三
- Linux进阶之bash编程二
- Shell特殊字符
- shell awk sed实战
- Linux进阶之bash编程基础一
- Shell脚本分割Nginx日志,并定期清理
- shell ftp 自动上传下载文件
- 使用shell脚本实现自动SSH互信功能
- Shell颜色及显示git分支配置
- shell脚本--部署应用到tomcat并启动tomcat
- 利用shell输入整块文字
- shell读文件的方法
- bash ----循环控制
- CentOS6 Shell脚本/bin/bash^M: bad interpreter错误解决方法
- shell 中并发执行
- Linux 通过 shell 脚本修改密码