Storing a EXE inside MySQL

It’s possible to store a EXE file inside a MySQL database. You can try this out. For demonstration purposes I’m running MySQL in my localhost. I will be creating a simple database and a table big enough to store the exe file. Since we convert the exe to a hex file the content would be larger than the original exe file. I will be using ‘putty.exe’ as the binary.

CREATE DATABASE testupload;

USE testupload

CREATE TABLE uploads (
 id INT(3) NOT NULL AUTO_INCREMENT,
 name VARCHAR(1000000) NOT NULL,
 PRIMARY KEY (id)
 );

Continue reading

Advertisements

Unofficial Way of Commenting in MySQL and MariaDB

In MySQL and MariaDB the official methods of commenting would be

--
#
/* comment */

The ‘#’ is also known as a “fragment identifier” and is typically used to identify a portion of an HTML document that sits within a fully qualified URL.
When passing ‘#’ inside a URL to the back-end database we can use ‘%23’.
Continue reading