1、在shell下使用mysql,按照下面的方法。
$mysql -u <your username> -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代码实现数据库的创建;
<?php
$dbc=mysql_connect("localhost","youruser","yourpassword");
mysql_create_db(zzz); //创建一个名为zzz的数据库
echo "成功";
?>
3、使用php3创建一个表:
<?php
$dbc=mysql_connect("localhost","root","");
mysql_select_db("zzz",$dbc);
mysql_query("create table user (username text not null , userpassword text not null )");
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器