Question: Need help on MySql...? I type in this code:\n\nif (@mysql_query ('CREATE DATABASE\nmyblog')) {\nprint 'Database has been created.';\n} else { \ndie ('Could not create database because: ' . mysql_error() . '<p>');\n}\n\nand I get this:\n\n\nSuccessfully Connected to Database.Could not create database because: Access denied for user: 'user@localhost' to database 'myblog'

Answer: Many hosting companies have already created a database for you and they might not let you create any of your own.  Check with your hosting company to see if you have the permissions to create databases (as opposed to CREATE TABLE).\n\nAlso, I'm assuming that you were able to CONNECT to the MySQL host like this:\n\nmysql_connect("$DBHost","$DBUser","$DBPass");\n\nYou have to CONNECT before you can do anything else.
This question from the Yahoo Q&A forum is categorized in the topic: Science & Mathematics