PHP Classes

PHP MySQL Shell: Execute MySQL queries from the command line shell

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 211 All time: 8,354 This week: 455Up
Version License PHP version Categories
mysqlshell 1.0.0Free For Educatio...5PHP 5, Databases, Console


This class can execute MySQL queries from the command line shell.

It can connect to a MySQL server running on a given host and reads SQL queries that the user can enter on the command line so it can execute them.

The class outputs the query results by dumping the query result rows as arrays to the console output.

If the user enters the command "exit", the class will exit and stops processing the SQL queries entered by the user.

Innovation Award
PHP Programming Innovation award nominee
July 2019
Number 5
MySQL is a very popular SQL database server used by many PHP applications. The client program, when available, can be started from the command line console and it allows you to perform any SQL queries on a given database.

This package provides a pure PHP based alternative to the MySQL client program if for some reason it is not available on the computer from which you want to perform the database queries you want to try.

Manuel Lemos
Picture of Dev Sharma
  Performance   Level  
Name: Dev Sharma <contact>
Classes: 4 packages by
Country: India India
Age: 21
All time rank: 3216210 in India India
Week rank: 195 Up17 in India India Up
Innovation award
Innovation award
Nominee: 2x



require_once 'shell.class.php';

$db = new Shell('localhost', 'username', 'pass', 'database name', 3306);

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Just an example file
Plain text file shell.class.php Class The main class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,354
This week:455Up
User Comments (1)
There is `mysql` command at the CLI-level.
4 years ago (Alexander Ivanou)