Update a column using LOAD_FILE function I have created a table lfile. The structure of table is:

CREATE TABLE `lfile` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |


In the table I have 3 records:

select * from lfile;
+----+-------+
| id | name  |
+----+-------+
|  1 | ravi  |
|  2 | kumar |
|  3 | ark   |
+----+-------+


Now I want to update 'ravi' with 'ravikumar' using LOAD_FILE.

  UPDATE lfile SET name=LOAD_FILE('/home/ravi/Desktop/t') WHERE id=1;


But it updates the name column with a NULL value.

mysql&gt; select * from lfile;
+----+-------+
| id | name  |
+----+-------+
|  1 | NULL  |
|  2 | kumar |
|  3 | ark   |
+----+-------+


Settings:

show variables like 'character_set_filesystem';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| character_set_filesystem | utf8  |
+--------------------------+-------+
Now i want to update 'ravi' with 'ravikumar'


LOAD FILE loads an entire table, not one column, not one cell.

Instead,

UPDATE lfile
    SET name = 'ravikumar'
    WHERE name = 'ravi';