Create Database in MySQL


Rajesh Bhujbal's Blog

The syntax in SQL for creating new database is:

CREATE DATABASE your-database-name

Create new database by running below php script.

<?php
  $host="mysql123.myserver.org";
  $uname="your-db-username";
  $pass="your-db-password";
  
  $connection= mysql_connect ($host, $uname, $pass);
  if (!$connection) {
    die ("A connection to the server could not be established!");
  }

  $result=mysql_create_db (“your-database-name”);

  if (!$result) {
    die (“database could not be created!”);
  }
  echo “Database your-database-name was created successfully.”;
?>

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s