怎么把powerdesigner导出的sql用PHP导入MysQL数据库
我们知道用powerdesigner导出的sql文件后缀为'.sql';用phpmyadmin很容易导入MysQL数据库,但是用PHP怎么导入数据库呢?
我用powerdesigner设计一个数据库后导出sql文件(一个投票系统)为'vote.sql';
文件内容为(一些sql语句和注释):
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2010-4-22 17:11:50 */
/*==============================================================*/
drop table if exists account_charge;
drop table if exists account_cost;
drop table if exists account_info;
drop table if exists charge_way;
drop table if exists user_askanswer;
drop table if exists user_info;
drop table if exists vote_fake;
drop table if exists vote_info;
drop table if exists vote_item;
drop table if exists vote_title;
drop table if exists vote_type;
/*==============================================================*/
/* Table: account_charge */
/*==============================================================*/
create table account_charge
(
chargeid int not null,
chargewayid int not null,
accountid
相关文档:
<?php
* xCopy("feiy","feiy2",1):拷贝feiy下的文件到 feiy2,推销员的一天,包括子目录
*参数说明:
* $destination:目的目录名
......
如下php代码
<?php
$type='a';
$target='type';
$a=array(1,2,3);
a($target);
function a($type)
{
global $$type;
var_dump($$type);
}
?>
预计输出的是string(1)”a”
可是结果是
Notice: Undefined variable: a in D:\web\global.php on ......
1. 安装mysql的时候选择字符集utf8
2. 安装结束后修改my.ini,有两个地方要修改,
[mysql] default-character-set=gbk
# The default character set that will be used when a new schema or table is
# created and no character set ......
首先,用windows 身份验证 登陆 sql server 2005
依次展开
安全性->登录名
选中 sa 右键单击
选中 属性
弹出 sa 的属性对话框
就在密码处 改 密码 行了
改了密码后 用 sa 和 你改的密码登陆
如果还登陆不上
就是你没打开 sql server和 windows身份验证
和没授予 sa 登陆权限
解决办法如下
:::: ......