After connection, you can create a new database.
The CREATE DATABASE command is used to create a database in MySQL
For example, create a testdb database:
<?php $conn = mysqli_connect("localhost", "root", "password"); if (!$conn) { //check connection die("Error: " . mysqli_connect_error()); } // // create testdb database $sql = "CREATE DATABASE testdb3"; if(mysqli_query($conn, $sql)){ echo "Database is created"; } else{ echo "Database creating failed! " . mysqli_error($conn); } //stop the connection mysqli_close($conn); ?>