Collections:
Failed to Create a Database in MySQL
What Happens If You Do Not Have Privileges to Create Database in MySQL?
✍: FYIcenter.com
If your MySQL server is provided by your Internet service company, your user account will most likely have no privilege to create new databases on the server. In that case, your CREATE DATABASE statement will fail. Here is an example of using a less privileged user account to create a new database:
<?php
$con = mysql_connect('localhost:8888', 'guest', 'pub');
$sql = 'CREATE DATABASE fyicenter';
if (mysql_query($sql, $con)) {
print("Database fyi created.\n");
} else {
print("Database creation failed.\n");
}
mysql_close($con);
?>
If you run this script, you will get something like this:
Database creation failed.
⇒ Retrieving Execution Error Message in MySQL
⇐ Creating a New Database in MySQL
2017-11-11, 2870🔥, 0💬
Popular Posts:
Collections: Interview Questions MySQL Tutorials MySQL Functions Oracle Tutorials SQL Server Tutoria...
How To Start the Command-Line SQL*Plus in Oracle? If you Oracle server or client installed on your w...
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL? Concatenating two char...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...