PDA

View Full Version : Scripting MySQL Databases



robwilkerson
12-18-2007, 12:37 PM
Is there any way to script the creation of a database or do I have to access the Bluehost control panel in order to create a database and assign users? I'm trying to determine whether I can SSH and do something like this:



mysql -umyusername -p < createdb.sql


The source script creates the database and all of its entities. What I get is an access error (Access denied for user 'myusername'@'localhost' to database 'mynewdatabase'). So maybe the real question is what are the permissions for my bluehost user (before any MySQL-specific users are created)?

Thanks.

Rob

areidmtm
12-18-2007, 01:15 PM
As far as i know, you can only create databases with cPanel, security issue.

robwilkerson
12-18-2007, 01:31 PM
Okay. I kind of thought that might be the case, but was hoping otherwise. So much for my carefully crafted Ant scripts that do all of my work for me. :-)

Thanks for verifying.