{"id":3127,"date":"2014-02-15T07:58:49","date_gmt":"2014-02-15T15:58:49","guid":{"rendered":"http:\/\/www.mysqltutorial.org\/?page_id=3127"},"modified":"2023-12-28T05:01:19","modified_gmt":"2023-12-28T12:01:19","slug":"import-csv-file-mysql-table","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-basics\/import-csv-file-mysql-table\/","title":{"rendered":"Import CSV File into MySQL Table"},"content":{"rendered":"\n<p>Summary: in this tutorial, you will learn how to import a CSV file into a MySQL table using the <code>LOAD DATA INFILE<\/code> statement and MySQL Workbench.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1) Importing a CSV file on the MySQL server into a table using LOAD DATA INFILE statement<\/h2>\n\n\n\n<p>The <code>LOAD DATA INFILE<\/code> statement allows you to read data from a CSV file in a specified directory on the MySQL server and import its contents to into a table.<\/p>\n\n\n\n<p>Before importing the file, you need to prepare the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A table that you want to import data into.<\/li>\n\n\n\n<li>A CSV file with data that matches the number of columns of the table and the type of data in each column.<\/li>\n\n\n\n<li>A MySQL user account that has FILE and INSERT privileges.<\/li>\n<\/ul>\n\n\n\n<p>Suppose you have a table called <code>discounts<\/code> with the following structure:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"157\" height=\"160\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png\" alt=\"discounts table\" class=\"wp-image-3133\" title=\"discounts table\"\/><\/figure>\n\n\n\n<p>And the following\u00a0 <code>discounts.csv<\/code> file contains the first line as column headings and the other three lines of data:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">id,title,expired date,amount\n<span class=\"hljs-number\">1<\/span>,Spring <span class=\"hljs-keyword\">Break<\/span>,<span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-01<\/span><span class=\"hljs-number\">-01<\/span>,<span class=\"hljs-number\">20<\/span>\n<span class=\"hljs-number\">2<\/span>,Back to School,<span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-09<\/span><span class=\"hljs-number\">-01<\/span>,<span class=\"hljs-number\">25<\/span>\n<span class=\"hljs-number\">3<\/span>,Summer Holiday,<span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-08<\/span><span class=\"hljs-number\">-25<\/span>,<span class=\"hljs-number\">10<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To import the <code>discounts.csv<\/code> file into the <code>discounts<\/code> table, you follow these steps:<\/p>\n\n\n\n<p>First, open the Command Prompt on Windows or the Terminal on Unix-like systems and <a href=\"https:\/\/www.mysqltutorial.org\/getting-started-with-mysql\/connect-to-mysql-server\/\">connect to the MySQL server<\/a>:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">mysql -u root -p<\/code><\/span><\/pre>\n\n\n<p>Second, change the current database to <code>classicmodels<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">use<\/span> <span class=\"hljs-title\">classicmodels<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, create a <code>discounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">CREATE TABLE discounts (\n    id INT NOT <span class=\"hljs-keyword\">NULL<\/span> AUTO_INCREMENT,\n    title VARCHAR(<span class=\"hljs-number\">255<\/span>) NOT <span class=\"hljs-keyword\">NULL<\/span>,\n    expired_date DATE NOT <span class=\"hljs-keyword\">NULL<\/span>,\n    amount DECIMAL(<span class=\"hljs-number\">10<\/span> , <span class=\"hljs-number\">2<\/span> ) <span class=\"hljs-keyword\">NULL<\/span>,\n    PRIMARY KEY (id)\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Fourth, show the value of the <code>@@secure_file_priv<\/code> variable:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">SELECT<\/span> @<span class=\"hljs-keyword\">@secure_file_priv<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">+------------------------------------------------+\n| @@secure_file_priv                             |\n+------------------------------------------------+\n| C:\\ProgramData\\MySQL\\MySQL Server <span class=\"hljs-number\">8.0<\/span>\\Uploads\\ |\n+------------------------------------------------+\n<span class=\"hljs-number\">1<\/span> row <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-keyword\">set<\/span> (0.00 sec)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The\u00a0<code>secure_file_priv<\/code>\u00a0option indicates the directory where you are allowed to store the input file and execute it with the <code>LOAD DATA INFILE<\/code> statement.<\/p>\n\n\n\n<p>Fifth, copy the <code>discounts.csv<\/code> file to the directory specified by the <code>secure_file_priv<\/code> option.<\/p>\n\n\n\n<p>Sixth, import data from the <code>discounts.csv<\/code> file into the <code>discounts<\/code> table by executing the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">LOAD<\/span> <span class=\"hljs-keyword\">DATA<\/span> <span class=\"hljs-keyword\">INFILE<\/span> <span class=\"hljs-string\">'C:\/ProgramData\/MySQL\/MySQL Server 8.0\/Uploads\/discounts.csv'<\/span> \n<span class=\"hljs-keyword\">INTO<\/span> <span class=\"hljs-keyword\">TABLE<\/span> discounts \n<span class=\"hljs-keyword\">FIELDS<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">','<\/span> \n<span class=\"hljs-keyword\">ENCLOSED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\"'<\/span>\n<span class=\"hljs-keyword\">LINES<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\\n'<\/span>\n<span class=\"hljs-keyword\">IGNORE<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">ROWS<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">Query<\/span> <span class=\"hljs-selector-tag\">OK<\/span>, 3 <span class=\"hljs-selector-tag\">rows<\/span> <span class=\"hljs-selector-tag\">affected<\/span> (0<span class=\"hljs-selector-class\">.01<\/span> <span class=\"hljs-selector-tag\">sec<\/span>)\n<span class=\"hljs-selector-tag\">Records<\/span>: 3  <span class=\"hljs-selector-tag\">Deleted<\/span>: 0  <span class=\"hljs-selector-tag\">Skipped<\/span>: 0  <span class=\"hljs-selector-tag\">Warnings<\/span>: 0<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The output indicates that the statement has loaded the file with three rows successfully.<\/p>\n\n\n\n<p>Here&#8217;s how the <code>LOAD DATA INFILE<\/code> works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>LOAD DATA INFILE 'C:\/ProgramData\/MySQL\/MySQL Server 8.0\/Uploads\/discounts.csv'<\/code>: Specifies the path to the input file (<code>discounts.csv<\/code>) that contains the data to be loaded into the table.<\/li>\n\n\n\n<li><code>INTO TABLE discounts<\/code>: Specifies the target table  (<code>discounts<\/code>) where you want to load the data<\/li>\n\n\n\n<li><code>FIELDS TERMINATED BY ','<\/code>: Specifies that the fields in the input file are separated (terminated) by a comma (<code>,<\/code>). This indicates that the file is a CSV (Comma-Separated Values) file.<\/li>\n\n\n\n<li><code>ENCLOSED BY '\"'<\/code>: Specifies that the fields in the input file are enclosed by double quotation marks (<code>\"<\/code>). This is common in CSV files to handle cases where a field may contain the delimiter <code>,<\/code>.<\/li>\n\n\n\n<li><code>LINES TERMINATED BY '\\n'<\/code>: Specifies that each line in the input file is terminated by a newline character (<code>\\n<\/code>). This indicates the end of a record (row) in the CSV file.<\/li>\n\n\n\n<li><code>IGNORE 1 ROWS<\/code>: Instructs the statement to ignore the first row in the input file. This is useful when the first row contains headers and should not be imported as data.<\/li>\n<\/ul>\n\n\n\n<p>Finally, retrieve the data from the <code>discounts<\/code> table to verify the import:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">SELECT * FROM discounts;<\/code><\/span><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">+----+----------------+--------------+--------+\n| id | title          | expired_date | amount |\n+----+----------------+--------------+--------+\n|  <span class=\"hljs-number\">1<\/span> | Spring Break   | <span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-01<\/span><span class=\"hljs-number\">-01<\/span>   |  <span class=\"hljs-number\">20.00<\/span> |\n|  <span class=\"hljs-number\">2<\/span> | Back to School | <span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-09<\/span><span class=\"hljs-number\">-01<\/span>   |  <span class=\"hljs-number\">25.00<\/span> |\n|  <span class=\"hljs-number\">3<\/span> | Summer Holiday | <span class=\"hljs-number\">2014<\/span><span class=\"hljs-number\">-08<\/span><span class=\"hljs-number\">-25<\/span>   |  <span class=\"hljs-number\">10.00<\/span> |\n+----+----------------+--------------+--------+\n<span class=\"hljs-number\">3<\/span> rows <span class=\"hljs-keyword\">in<\/span> <span class=\"hljs-keyword\">set<\/span> (0.00 sec)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Notice that if you don&#8217;t place the file in the directory specified by the <code>secure_file_priv<\/code> variable, you&#8217;ll get the following error:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">ERROR <span class=\"hljs-number\">1290<\/span> (HY000): The MySQL server is running <span class=\"hljs-keyword\">with<\/span> the --secure-file-priv option so it cannot execute <span class=\"hljs-keyword\">this<\/span> statement<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Transforming data while importing<\/h3>\n\n\n\n<p>Sometimes the format of the data does not match the target columns in the table. In simple cases, you can transform it by using the <code>SET<\/code> clause in the&nbsp; <code>LOAD DATA INFILE<\/code> statement.<\/p>\n\n\n\n<p>Suppose the expired date column in the\u00a0 <code>discount2.csv<\/code> file is in the\u00a0 <code>mm\/dd\/yyyy<\/code> format:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">id,title,expired date,amount\r\n<span class=\"hljs-number\">1<\/span>,Spring <span class=\"hljs-keyword\">Break<\/span>,<span class=\"hljs-number\">01<\/span>\/<span class=\"hljs-number\">01<\/span>\/<span class=\"hljs-number\">2014<\/span>,<span class=\"hljs-number\">20<\/span>\r\n<span class=\"hljs-number\">2<\/span>,Back to School,<span class=\"hljs-number\">09<\/span>\/<span class=\"hljs-number\">01<\/span>\/<span class=\"hljs-number\">2014<\/span>,<span class=\"hljs-number\">25<\/span>\r\n<span class=\"hljs-number\">3<\/span>,Summer Holiday,<span class=\"hljs-number\">08<\/span>\/<span class=\"hljs-number\">25<\/span>\/<span class=\"hljs-number\">2014<\/span>,<span class=\"hljs-number\">10<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When importing data into the <code>discounts<\/code> table, you can transform it into MySQL date format by using <a href=\"https:\/\/www.mysqltutorial.org\/mysql-date-functions\/mysql-str_to_date\/\">STR_TO_DATE()<\/a> function:<\/p>\n\n\n\n<p>First, <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-truncate-table\/\">truncate<\/a> the <code>discounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">TRUNCATE TABLE discounts;<\/code><\/span><\/pre>\n\n\n<p>Second, transform and load data from the <code>discount2.csv<\/code> file into the <code>discounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">LOAD<\/span> <span class=\"hljs-keyword\">DATA<\/span> <span class=\"hljs-keyword\">INFILE<\/span> <span class=\"hljs-string\">'C:\/ProgramData\/MySQL\/MySQL Server 8.0\/Uploads\/discounts2.csv'<\/span>\n<span class=\"hljs-keyword\">INTO<\/span> <span class=\"hljs-keyword\">TABLE<\/span> discounts\n<span class=\"hljs-keyword\">FIELDS<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">','<\/span> <span class=\"hljs-keyword\">ENCLOSED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\"'<\/span>\n<span class=\"hljs-keyword\">LINES<\/span> <span class=\"hljs-keyword\">TERMINATED<\/span> <span class=\"hljs-keyword\">BY<\/span> <span class=\"hljs-string\">'\\n'<\/span>\n<span class=\"hljs-keyword\">IGNORE<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-keyword\">ROWS<\/span>\n(<span class=\"hljs-keyword\">id<\/span>, title, @expired_date,amount)\n<span class=\"hljs-keyword\">SET<\/span> expired_date = <span class=\"hljs-keyword\">STR_TO_DATE<\/span>(@expired_date, <span class=\"hljs-string\">'%m\/%d\/%Y'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">2) Importing a CSV file from a local computer to a table on a remote MySQL  server<\/h2>\n\n\n\n<p>The <code>LOAD DATA INFILE<\/code> allows you to import a CSV file from your local computer to a table in a remote MySQL server via the <code>LOCAL<\/code> option.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuration<\/h3>\n\n\n\n<p>MySQL disables loading a local file to the server by default. To load a local file to the MySQL server, you need to enable the option on both the client and server sides. <\/p>\n\n\n\n<p>The <code>local_infile<\/code> controls whether the client and server permit the use of the <code>LOCAL<\/code> option in the <code>LOAD DATA INFILE<\/code> statement.<\/p>\n\n\n\n<p>First, open the MySQL configuration file (<code>my.ini<\/code> or <code>my.cnf<\/code>) and add the following line to enable loading the local file on the MySQL server:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">&#91;mysqld]\r\nlocal_infile=1<\/code><\/span><\/pre>\n\n\n<p>Second, restart the MySQL server to apply the change.<\/p>\n\n\n\n<p>Third, open the mysql client program on the local computer to connect to the MySQL server<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">mysql -h hostname -u root -p<\/code><\/span><\/pre>\n\n\n<p>You need to replace the hostname with your remote MySQL server.<\/p>\n\n\n\n<p>Fourth, set the global variable local_infile  to 1 (or ON):<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">SET <span class=\"hljs-keyword\">GLOBAL<\/span> local_infile = <span class=\"hljs-number\">1<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>We have configured the <code>local_infile<\/code> on both the server and client.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Loading the local file<\/h3>\n\n\n\n<p>First, change the current database to the one that contains the <code>discounts<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-keyword\">USE<\/span> <span class=\"hljs-title\">classicmodels<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, execute the <code>LOAD DATA INFILE<\/code> statement to import data from a CSV file located in the <code>C:\\temp\\<\/code> directory to the MySQL server:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">LOAD DATA LOCAL INFILE  <span class=\"hljs-string\">'c:\/temp\/discounts.csv'<\/span>\nINTO TABLE discounts\nFIELDS TERMINATED BY <span class=\"hljs-string\">','<\/span> \nENCLOSED BY <span class=\"hljs-string\">'\"'<\/span>\nLINES TERMINATED BY <span class=\"hljs-string\">'\\n'<\/span>\nIGNORE <span class=\"hljs-number\">1<\/span> ROWS;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The only addition to the <code>LOAD DATA INFILE<\/code> statement is the <code>LOCAL<\/code> option. <\/p>\n\n\n\n<p>If you load a big CSV file, you will see that with the\u00a0<code>LOCAL<\/code> option, it will take time to transfer the file to the MySQL server.<\/p>\n\n\n\n<p>Note that if you don&#8217;t configure both client and server properly, you will get the following message:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">ERROR <span class=\"hljs-number\">3948<\/span> (<span class=\"hljs-number\">42000<\/span>): Loading local data is disabled; <span class=\"hljs-keyword\">this<\/span> must be enabled on both the client and server sides<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">3) Importing CSV files into a table using MySQL Workbench<\/h2>\n\n\n\n<p>MySQL workbench provides a tool to import data into a table <\/p>\n\n\n\n<p>First, open the <code>discounts<\/code> table:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"223\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-1.png\" alt=\"\" class=\"wp-image-13638\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-1.png 427w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-1-200x104.png 200w\" sizes=\"auto, (max-width: 427px) 100vw, 427px\" \/><\/figure>\n\n\n\n<p>Second, click the import button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"106\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-2.png\" alt=\"\" class=\"wp-image-13639\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-2.png 542w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-2-200x39.png 200w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<p>Third, select the path to the CSV file and click the Next button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-3.png\" alt=\"\" class=\"wp-image-13640\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-3.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-3-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-3-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Fourth, select the destination table, which is the <code>classicmodels.discounts<\/code> in this case. Note that you can create a new table before importing the file and\/or truncate the table before import:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-4.png\" alt=\"\" class=\"wp-image-13644\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-4.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-4-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-4-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Fifth, map the columns in the source file with the columns in the destination table and click the Next button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-5.png\" alt=\"\" class=\"wp-image-13641\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-5.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-5-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-5-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Sixth, review the steps that the Workbench will do and click the Next button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-6.png\" alt=\"\" class=\"wp-image-13642\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-6.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-6-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-6-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Seventh, review the steps that the Workbench will do and click the Next button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-7.png\" alt=\"\" class=\"wp-image-13643\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-7.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-7-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-7-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Eight, review the import result and click the Finish button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"641\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-8.png\" alt=\"\" class=\"wp-image-13645\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-8.png 782w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-8-200x164.png 200w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-8-768x630.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/figure>\n\n\n\n<p>Finally, show the contents of the discounts table:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"128\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-9.png\" alt=\"\" class=\"wp-image-13646\" srcset=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-9.png 560w, https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2023\/12\/step-9-200x46.png 200w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>LOAD DATA INFILE<\/code> statement to import a CSV file into a table.<\/li>\n\n\n\n<li>Use MySQL Workbench to import a CSV file from the local computer to a table on a remote MySQL server.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"3127\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/import-csv-file-mysql-table\/\"\n\t\t\t\tdata-post-title=\"Import CSV File into MySQL Table\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"3127\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/import-csv-file-mysql-table\/\"\n\t\t\t\tdata-post-title=\"Import CSV File into MySQL Table\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table. <\/p>\n","protected":false},"author":2,"featured_media":0,"parent":174,"menu_order":85,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-3127","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Import CSV File Into MySQL Table<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Import CSV File Into MySQL Table\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-28T12:01:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/\",\"name\":\"Import CSV File Into MySQL Table\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/discounts-table.png\",\"datePublished\":\"2014-02-15T15:58:49+00:00\",\"dateModified\":\"2023-12-28T12:01:19+00:00\",\"description\":\"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/discounts-table.png\",\"contentUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/discounts-table.png\",\"width\":157,\"height\":160,\"caption\":\"discounts table\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/import-csv-file-mysql-table\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Basics\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Import CSV File into MySQL Table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Import CSV File Into MySQL Table","description":"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/","og_locale":"en_US","og_type":"article","og_title":"Import CSV File Into MySQL Table","og_description":"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.","og_url":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-12-28T12:01:19+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png","type":"","width":"","height":""}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/","url":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/","name":"Import CSV File Into MySQL Table","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png","datePublished":"2014-02-15T15:58:49+00:00","dateModified":"2023-12-28T12:01:19+00:00","description":"This tutorial shows you how to use LOAD DATA INFILE statement to import CSV file into MySQL table.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/#primaryimage","url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png","contentUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2014\/02\/discounts-table.png","width":157,"height":160,"caption":"discounts table"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/import-csv-file-mysql-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"MySQL Basics","item":"https:\/\/www.mysqltutorial.org\/mysql-basics\/"},{"@type":"ListItem","position":3,"name":"Import CSV File into MySQL Table"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/3127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=3127"}],"version-history":[{"count":4,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/3127\/revisions"}],"predecessor-version":[{"id":13649,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/3127\/revisions\/13649"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/174"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=3127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}