file函数作用:
mysql中file函数的作用是用于读取一个文件并将其内容作为字符串返回。
file函数语法:
load_file(file_name) as ontent;
参数:
file_name:需要读取文件的路径。
ontent:需要返回文件的内容。
file函数使用方法:
SELECT LOAD_FILE('c:/data/test.txt') as pink;
输出结果为:
+---------------------------------------------+
| pink |
+---------------------------------------------+
| This is the content of the pink in the file |
+---------------------------------------------+
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: mysql热备份的特点是什么