Insert images in MYSQL database table Using Local directory



In this blog, we will learn how to insert an image from the local directory in the database, here some basic command in which we will insert an image.


Go to Mysql bin and type this-


C:\Program Files\MySQL\MySQL Server 8.0\bin> mysql -uroot -p


After this type your password.

Then create a database like an employee.


mysql> create database employee;


Then use database


mysql> use employee;


Then create table


mysql> create table Naveen;


Creating the table

Here we use "load_file" function to load the file:


CREATE TABLE pictures ( image_id int(10) NOT NULL auto_increment, image blob, PRIMARY KEY (image_id) );


Inserting value with directory


INSERT INTO pictures VALUES(1, LOAD_FILE('d:\flower.gif'));


Get your project or assignment completed by Deep learning expert and experienced developers and researchers.

Submit a proposal


OR


If you have project files, You can send at codersarts@gmail.com directly



Contact Us

Tel: (+91) 0120  4118730  

Time :   10 : 00  AM -  08 : 00 PM IST 

Registered address: G-69, Sector 63, 

 Noida - 201301, India

We Provide Services Across The different countries

USA    Australia   Canada   UK    UAE    Singapore   New Zealand    Malasia   India   Ireland   Germany

CodersArts is a Product by Sofstack Technology Solutions Pvt. Ltd.

  • CodersArts | Linkedin
  • Instagram