MySQL access question

Discussion in 'Installation/Configuration' started by jang, Sep 3, 2006.

  1. jang

    jang New Member

    I have created a database "NAME" in Mysql as root user using the shell.

    I have setup two sites in ISP Config from one client. How can I make access to the database "NAME" from the two sites?

    Should i get access with web1_u1, web2_u1 or setup a new user. I tried it with adding a new user "A" with privileges in the Manager PHPmyadmin, but that doesn't work. I still get a 'no database selected' error in my two sites. I connect with

    $conn = mysql_connect("localhost", "A", "password");
    mysql_select_db("NAME",$conn);

    What should I change?

    The point is a have a big zipcode database that I want to share, not setup twice in the two domains.

    Jang
     
  2. Ben

    Ben ISPConfig Developer ISPConfig Developer

    If you created the mySQL user independent of ISPConfig you don't have to do anything with it. What you have to do is to use it when connecting with the defined user and password.

    The no database selected error could mean, as I guess, that you created a user giving it no right to access any database, so you have to create the databse as well and let the user access this.

    But to make it more ease for you, just create the stuff with ispconfig, you can use any username / database created with that independent of the web you use.
     
  3. jang

    jang New Member

    Thx Ben, I have it working now.

    I'm not sure how I solved it, because I tried exactly what you told me before I asked my question. Probably a typo somewhere :)

    One other question that puzzles me is the information_schema database that seems to be there for every user.
    Why is it there and what is the use of that?

    Jang
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    This are internal data structures from mysql. Just dont care about them :)
     
  5. jang

    jang New Member

    I just wonder what will happen when customers start editing them.

    They will be confused anyhow by the existence, I guess
     

Share This Page