简体   繁体   English

更新MySQL XML Blob

[英]Update mysql XML blob

I am working on a Windows 7 machine and need to update a mySql row on an Ubuntu server. 我正在Windows 7机器上工作,需要在Ubuntu服务器上更新mySql行。 I open Workbench and run "show grants;" 我打开工作台并运行“显示赠予”; and it returns with GRANT ALL 然后返回GRANT ALL

I have a column in the database that shows as xml in the Workbench viewer when I run:select UNCOMPRESS(data) from database.detail where file_id = 57; 我在数据库中有一列,当我运行时在工作台查看器中显示为xml:从database.detail中选择UNCOMPRESS(data),其中file_id = 57;

I need to update that row, I tried to save the blob as xml on disk and run: select LOAD_FILE('C:\\Trash\\544357.xml'); 我需要更新该行,我尝试将Blob作为xml保存在磁盘上并运行:select LOAD_FILE('C:\\ Trash \\ 544357.xml'); but that returns nothing so: UPDATE database.detail SET data = LOAD_FILE("C:\\Trash\\544357.xml") where file_id = 57; 但这什么也没有返回:UPDATE database.detail SET数据= LOAD_FILE(“ C:\\ Trash \\ 544357.xml”)其中file_id = 57; does not work either. 也不起作用。

Rack on up for not reading some of the answers I found on Google!! 不要阅读我在Google上找到的一些答案,烦恼! This LINK explained that the file must be on the server. 链接说明该文件必须在服务器上。 I moved the file from my local windows 7 machine to the Ubuntu mysql box tmp folder and ran: UPDATE database.detail SET data = LOAD_FILE("/tmp/544357.xml") where file_id = 57 我将文件从本地Windows 7计算机移至Ubuntu mysql box tmp文件夹并运行:UPDATE database.detail SET数据= LOAD_FILE(“ / tmp / 544357.xml”)其中file_id = 57

DONE!!! 完成!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM