MySQL运行SQL脚本文件
mysql运行sql脚本文件
3
推荐
建立my.sql文件:
create table mytable(name char(10),id char(4));
用root用户登陆数据库:
E:\mysql\bin>mysql -u root -p password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.0.37-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
更改数据库:
mysql> use mysql;
Database changed
第一种方法:运行该脚本文件:
命令在mysql命令提示符下用,例如:mysql> source my.sql;(这里my.sql要放在data目录下)
Query OK, 0 rows affected (0.08 sec)
第二种方法:运行该脚本文件:
命令在dos命令提示符下用,例如:c:\documents and settings\administrator>mysql -uroot -p password<my.sql
查看hi表的结构:
mysql> desc mytable;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| name | char(10) | YES | | NULL | |
| id | char(4) | YES | | NULL | |
+-------+----------+------+-----+---------+-------+
2 rows in set (0.02 sec)
相关文档:
import java.sql.*;
/*
* JAVA连接ACCESS,SQL Server,MySQL,Oracle数据库
*
* */
public class JDBC {
public static void main(String[] args)throws Exception {
Connection conn=null;
//====连接ACCESS数据库 ......
http://www.umgr.com/blog/PostView.aspx?bpId=36294
1. 执行sql语句
int sqlite3_exec(sqlite3*, const char *sql, sqlite3_callbacksql 语法
, void *, char **errmsg );
这就是执行一条 sql 语句的函数。
第1个参数不再说了,是前面open函数得到的指针。说了是关键数据结构。
第2个参数const char ......
Blog系统作为大家最常接触的互联网东东,在站长群体中几乎人手一博,从知名门户的博客频道,到网络营销专家博客,网民对博客的关注度在不断提高并深化。目前网上免费的blog系统太杂,在此整理PHP版的Blog介绍如下:
1、wordpress:http://www.wordpress.org 功能也很全面,应该是支持blog的首选。它有最强的模版功能,已经 ......