does anyone know if there's a script out there that will create a mysql database automatically instead of having to go into cpanel and create a database, username and password manually?
thanks
|
You cannot create a username and password unless you log in yourself with a user with a higher level. That's usually the root. Creating database is a breeze after using the username and password with sufficient privileges.
In this script, I assumed your root user is called "root" and its password is empty if that's not the case, change line 4 to match. |
|||||
|
you cannot create new user without logging in. You can create database with root account or user with privileges |
|||
|
When you are connected with the servers root-account (or account with db/user-adding permissions) you can create databases and users. Adding a user:
Creating a database:
Give user permissions on database:
|
|||
|
You definitely can! You can use PHP. First you need to connect to the database. Then you need to run a SQL query on that database that creates the database. (which is essentially what cpanel does) EDIT: Updated since my_sql is deprecated Heres a stackoverflow post on how to do it... |
|||||||||||||
|