MySQL使用方法 |
發(fā)布時間: 2012/8/2 18:14:59 |
在shell下使用mysql,按照下面的方法。 $mysql -u -p password: mysql>show databases; //顯示有哪些數據庫 mysql>create DATABASE lll; //創(chuàng)建一個名為lll的數據庫 mysql>use lll; //使用名為lll的數據庫 mysql>show tables; //顯示當前數據庫中有哪些表 mysql>CREATE TABLE user (username TEXT not null , userpassword TEXT not null ) //創(chuàng)建一個表 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代碼實現數據庫的創(chuàng)建; 3、使用php3創(chuàng)建一個表: 本文出自:億恩科技【mszdt.com】 |