|
#1
|
|||
|
|||
|
I don't see a forum for questions, so I will post it here: Is there a way to create a database directly from a php script. When I try do it I get an error saying that I don't have permissions, I can't do it with phpMyAdmin neither. So I have to do it manually using the MySQL Database Wizard.
Any suggestions will be much appreciated.
|
|
#2
|
|||
|
|||
|
Is not possible to do this, or is it and am I missing something here?
|
|
#3
|
||||
|
||||
|
Are you on a shared server? My understanding is that if you are on a shared server, then you have to use the MySQL Database Wizard or MySQL Databases page to create/delete SQL databases and create/delete SQL database users. You can, however, still use phpMyAdmin for database operations. I don't know about creating a database directly from a php script.
|
|
#4
|
|||
|
|||
|
It can very well be done (but if you are going to do this for subselling reasons that is a violation of the tos (terms of service). Please look into using the cpanel api http://tinyurl.com/8svykg good luck =)
-Chris |
|
#5
|
|||
|
|||
|
You can do it through your PHP code as long as you use the MySQL username and password assigned to the database you wish to drop, and you have given ALL permissions in cPanel to that user for the database.
Code:
root@test [/home/test/]# mysql -utest_test -pq1w2e3r4 test_test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 80296 Server version: 5.0.67-community MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> drop database test_test; Query OK, 0 rows affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | +--------------------+ 1 row in set (0.00 sec) mysql> \q Bye DISCLAIMER: Server name, username and password have been modified to protect the account. |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create a image like this | ghpk | Off-Topic | 5 | 07-16-2007 05:50 PM |
| Job board script and SQL Database | jasonec | Webhosting | 3 | 09-26-2006 11:54 PM |
All times are GMT -5. The time now is 12:59 PM.









