Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What Happens If You Do Not Have Privileges to Create Database
What Happens If You Do Not Have Privileges to Create Database? - MySQL FAQs - PHP Connections and Query Execution
✍: 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.
2007-05-10, 5735👍, 0💬
Popular Posts:
What Happens If One Row Has Missing Columns? - XHTML 1.0 Tutorials - Understanding Tables and Table ...
How To Increment Dates by 1? - Oracle DBA FAQ - Understanding SQL Basics If you have a date, and you...
What is the purpose of Replication ? Replication is way of keeping data synchronized in multiple dat...
Managed Code and Unmanaged Code related ASP.NET - How do you hide Public .NET Classes and other publ...
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...