Database Questions

hansmosh

New Member
Messages
2
Reaction score
0
Points
0
I want to be able to create a database using
mysql_query("CREATE DATABASE my_db")
Is this possible?

I realize I can create a database by using MySQL Databases, but I want to create it in my code. I'm getting the error
Error creating database: Access denied for user '<user>'@'localhost' to database 'my_db'

I hope this question makes sense. Thank you in advance for any help.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
No, You have to create databases using cPanel. You cannot create them from inside scripts.
 

gomarc

Member
Messages
516
Reaction score
18
Points
18
@ hansmosh

Are you sure you need to create a new database?

Why not just add tables to an existing one?

You could add a unique prefix to these tables so they would not be confused with any others tables you already have.
 
Top