Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 4764👍, 0💬
Popular Posts:
How To Control Vertical Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By d...
Can static variables be declared in a header file? You can't declare a static variable without defin...
How will you freeze the requirement in this case? What will be your requirement satisfaction criteri...
What is Native Image Generator (Ngen.exe)? The Native Image Generator utility (Ngen.exe) allows you ...
Enable ASP.NET polling using “web.config” file Now that all our database side is configured in order...