Create Database using MySqladmin

You can create any database using MySQL mysqladmin binary. Either it is a local server made by using Xampp or Online servers. This way you can have a database ready.


A simple example to Show you as how to  create database named as “Database tutorials”:

[[email protected]]# mysqladmin -u root -p create Database tutorials

Enter password:*****

The above-given code will create a MySQL database  “Database Tutorials”.


Create Database using PHP Script:

Create MySQL Database Using Command...
Create MySQL Database Using Command Prompt XAMPP | 2020

PHP uses the mysql_query function in order create or delete a MySQL database.


bool mysql_query( SQL, connection );

Commands Details
sql Required – SQL query in order to create or delete a MySQL database
connection “Optional” – if it is not specified, then last opened connection which a user used by mysql_connect will be used in the current one.



Creating a database:


$Result = mysql_query( $sql, $con );
if(! $result )
die(‘Could not create database due to error: ‘ . mysql_error());
echo “Database TUTORIALS created successfully without any error\n”;


Related Article

Leave a Comment