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

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

WBOY
Release: 2016-06-07 16:16:52
Original
3092 people have browsed it

导入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可能出现以下错误

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template