When using the LOCAL option, you must ensure that data-loading is enabled on both the client side and server side. I have not tested this capability beyond that. The first was another Mac computer and the other was Windows 11 virtual machine. Note: The MySQL documentation states that “if LOCAL is specified, the file must be located on the client host.” However, I was able to run a LOAD DATA statement that included the LOCAL option and that pulled data from other systems on my network. If you use the LOCAL option, you do not need the FILE privilege to run a LOAD DATA statement, and you can store the source text file in any local folder that can be accessed by the client application, which in this case, is MySQL Workbench. I also think that for many database administrators and developers, locating source files on the client side is preferable to uploading those files to the MySQL server, if they’re even permitted to do so. If you check out the various forum postings that discuss connectivity issues around the LOAD DATA statement, you’ll find that in many cases, people responding to a post suggest the use of the LOCAL option as a simple workaround to the various challenges. Not only are the MySQL connectivity requirements more complicated without it, but they are also not well documented, adding to the frustration should you run into any glitches. Connectivity is typically much easier to establish when you use the LOCAL option.įor the examples in this article, I have used the LOCAL option. ![]() The LOCAL option also works if the client and MySQL are on the same machine, which is the approach I’ve taken for this article. The client reads the file and sends the content to the server, where it is stored in a temporary file until it is loaded into the target table for processing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |