mysql forige key
Love in coding...
Free and Susan
[引]MySQL INNODB类型表的外键关联设置
Here is a simple example that relates parent and child tables through a single-column foreign key:
CREATE TABLE parent (id INT NOT NULL,
PRIMARY KEY (id)
) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT,
INDEX par_ind (parent_id),
FOREIGN KEY (parent_id) REFERENCES parent(id)
ON DELETE CASCADE
) ENGINE=INNODB;
A more complex example in which a product_order table has foreign keys for two other tables.
One foreign key references a two-column index in the product table.
The other references a single-column index in the customer table:
CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
price DECIMAL,
PRIMARY KEY(category, id)) ENGINE=INNODB;
CREATE TABLE customer (id INT NOT NULL,
PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
product_category INT NOT NULL,
 
相关文档:
可以查看mysql文件目录my.ini文件,可以找到类似于
datadir="D:/beeagle/Program Files/MySQL/MySQL Server 5.0/Data/"的字段
该路径为mysql data目录
默认在:"C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\Data\"
注意:Application Data文件夹是隐藏的!!!
可以修改上述配置, ......
此文章的安装方法适用于Windows XP下的Apache+PHP+MySQL安装。 1. 安装环境
操作系统是 Windows XP 中文版, Apache, PHP, MySQL 的最新版本是截止到 2007.09.07,分别在其官网下载的:
* Apache 2.2.6:http://apache.mirror.phpchina.com/httpd/binaries/win32/
* PHP 5.2.4 (Windows Binaries PHP 5.2.4 z ......
启动Mysql 错误 1067 进程意外终止的一种解决方法
mysqld-nt --defaults-file=my.ini --standalone --console
查看信息内容
发现MYSQL INNODB初始化错误。
错误如下:
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
100115 10:14:04 InnoDB: Setti ......
create procedure all_joiner_message( in captions varchar(255), in contents text, in objectid int, in types int , out count int)
begin
declare userids int;
DECLARE _done IN ......