Home >Database >Mysql Tutorial >把视频文件直接存储到mysql数据库的方法

把视频文件直接存储到mysql数据库的方法

WBOY
WBOYOriginal
2016-06-07 16:16:523094browse

导入jpg、png等图片类似。 创建一个测试表test,使用longblob或者mediumblob 1CREATE TABLE test (id INTEGER NOT NULL PRIMARY KEY,name VARCHAR (20),movie LONGBLOB); 然后把视频文件导入 1INSERT INTO test VALUES(1, 'titanic', LOAD_FILE(/tmp/good.mp

   导入jpg、png等图片类似。

  创建一个测试表test,,使用longblob或者mediumblob

  1CREATE TABLE test (id INTEGER NOT NULL PRIMARY KEY,name VARCHAR (20),movie LONGBLOB);

  然后把视频文件导入

  1INSERT INTO test VALUES(1, 'titanic', LOAD_FILE("/tmp/good.mp4"));

  注意,如果不使用longblob可能出现以下错误

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn