SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Zealot BuyAnswersLinks's Avatar
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sharing database login info privately

    I need to set up a simple way to view customers details on another database that is owned by another person. My company is taking over customer support for the other ecommerce website so I need to code up an area so I can view his customers details.

    I would like to find a way so that I can connect to his database from my server without being able to view his database login info. This will make it very secure for both parties.

    My question is; does anyone know a way so I can access his db info such as customers names, shipping addresses, date ordered, date shipped, etc on my server without needing to view or use his database config info?

    Please let me know if anyone knows a little tip or secret? Thanks in advance.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    He can create another database user for you with only as much permissions as your company will need (for example, the ability to view the customer table but not to drop tables).

  3. #3
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    does anyone know a way so I can access his db info such as customers names, shipping addresses, date ordered, date shipped, etc on my server without needing to view or use his database config info?
    Watch your question. Isn't it like "does anyone know a way so I can access his safe without a key?"
    without being able to view his database login info. This will make it very secure for both parties.
    It will make it way insecure!
    If you can view it without proper credentials - so, anyone can.

    Please let me know if anyone knows a little tip or secret?
    lock pick you mean? No, there is not, of course.

    Of course, there is no way as you describe it.
    But there is a lot of ways of secure data interchange

  4. #4
    SitePoint Zealot BuyAnswersLinks's Avatar
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shrapnel_N5 View Post
    Watch your question. Isn't it like "does anyone know a way so I can access his safe without a key?"

    It will make it way insecure!
    If you can view it without proper credentials - so, anyone can.


    lock pick you mean? No, there is not, of course.

    Of course, there is no way as you describe it.
    But there is a lot of ways of secure data interchange
    Hello, I actually agree with you. That is why I am asking this forum, I am hoping that someone more knowledgeable then me knows a trick to make it so I can access his db without me being able to UPDATE it and view his actual db login info.

    Dan has a great idea which I will be trying out first. But I was hoping that there was someone to access his db without actually being able to view his login details. But I guess you are saying that its impossible?

    I have always used the following code on my config files. I know it wont make it much more secure but it better then nothing:

    if ($_SERVER['SERVER_ADDR'] == "serveriphere") {

    config info here

    }

    That makes it so I can only access my config file from my server ip (im pretty sure but I am a newb).

    I will be trying out Dans suggestion today, but I am guessing you are saying it is impossible to do what I am asking?

  5. #5
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I must correct myself.
    It is impossible without knowing any login info.
    But it is possible with dedicated login, as Dan said.
    Mysql has great privileges system. Another user can be added, granted with only SELECT privilege only to view certain table.

  6. #6
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    You will need him to make you a user name like stated previously.
    Ryan B | My Blog | Twitter

  7. #7
    SitePoint Zealot BuyAnswersLinks's Avatar
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I am not a server guy at all, and I have never needed to do this, but can I make 2 database users for the same database?

    I need to have the normal database user (which is already set up... its the db user that your using currently) to have all of the normal privileges..... then I need to add a new database user that will have limited privileges such as not being able to create/update/destroy rows.

    My question: Can my host create 2 db users with different privileges for the same database?

    Probably a stupid question, but I have never done this before. thanks

  8. #8
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    You will want to ask that in the correct forum here... We are php people here not DBA's.
    Ryan B | My Blog | Twitter

  9. #9
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BuyAnswersLinks View Post
    My question: Can my host create 2 db users with different privileges for the same database?
    You can probably do it yourself if you have something like cpanel.

  10. #10
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BuyAnswersLinks View Post
    Ok, I am not a server guy at all, and I have never needed to do this, but can I make 2 database users for the same database?

    I need to have the normal database user (which is already set up... its the db user that your using currently) to have all of the normal privileges..... then I need to add a new database user that will have limited privileges such as not being able to create/update/destroy rows.

    My question: Can my host create 2 db users with different privileges for the same database?

    Probably a stupid question, but I have never done this before. thanks
    Indeed you can, it's a standard feature.

    Check out the MySQL docs relating to privileges.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  11. #11
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,076
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    You would need something along the lines of

    Code:
    GRANT SELECT ON dbname.* TO username@localhost INDENTIFIED BY "password";
    Where of couse "username" should be your username, and "password" should be your preferred password, and "dbname" should be the name of the database you want to access.

    See MySQL's GRANT syntax.


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
  •