SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Create DB

  1. #1
    SitePoint Addict
    Join Date
    Oct 2008
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create DB

    Hi,

    Is there is any option to create mysql data base automatically without using cpanel to create database, I use the following code but it does not create's Db on website.
    mysql_query("CREATE DATABASE fig",$connection);

    It creates DB in local but not in website?

  2. #2
    SitePoint Member captaincarne's Avatar
    Join Date
    Dec 2008
    Location
    Las Vegas, NV
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does the user you are logging to MySQL as have CREATE privileges?

    Try running:

    Code:
    GRANT CREATE ON fig.* TO <username goes here>@localhost IDENTIFIED BY "<your password goes here>"

  3. #3
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most hosts don't give any of the users you can use CREATE privileges.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •