在shell下使用mysql方法

来源:互联网 发布:美国农业数据 美元指数 编辑:程序博客网 时间:2024/06/09 23:38

在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创建一个表:

0 0
原创粉丝点击