In MySQL, the LOAD_FILE() function reads a file and returns its contents as a string. grammar
Where file_name is the full path to the file. Here is an example of me selecting content from a file:
result:
An example of a database Here is an example of a query that inserts the contents of a file into a database:
In this example, the column MyBlobColumn has a BLOB data type (allowing it to store binary data). Now that it is in the database, we can select it:
result:
If the file does not exist, returns NULL:
result:
You may also be interested in:
|
<<: JD Vue3 component library supports the detailed process of mini program development
>>: Linux uses iftop to monitor network card traffic in real time
Table of contents Preface 1. Background 2. Simula...
Preface: When we want to clear a table, we often ...
1. Sometimes we use ES Due to limited resources o...
To deploy war with Docker, you must use a contain...
<br />This article is mainly to let beginner...
rep / egrep Syntax: grep [-cinvABC] 'word'...
Dataframe is a new API introduced in Spark 1.3.0,...
vue+element UI encapsulates a public function to ...
Table of contents Overview Form validation withou...
Mind Map He probably looks like this: Most of the...
Last year, the open letter was a huge hit, even a...
MySQL8.0.22 installation and configuration (super...
When using MySql's window function to collect...
Table of contents Preface How to implement Vuex f...
Serious MySQL optimization! If the amount of MySQ...