SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot martin's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External connection for MySQL

    I have installed PHP and MySQL as per Kevin's excellent tutorial. It all works perfectly, but I need to access MySQL from another station on our ethernet network.

    I can access the Linux box itself without problems for file upload etc. but when I try to access it via PHP from my remote station I get the following error:

    Server Configuration denies access to data source.

    Can anyone tell me how to configure MySQL to allow external access? I am using Suse Linux 7.1 on a Macintosh Box.

    I know this is a bit vague, but any help in pointing me in the right direction would be greatly appreciated.
    Martin

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YOu need to either change your Host field for your user in the user table of the mysql database to % from localhost. That will open a connection from anywhere, by changing this feild to a specific IP or domain will allow the user to connect from a certian domain or IP.
    Make sure to run flush privileges from the mysql command prompt or use mysqladmin -u username -p reload from the regular command prompt to recognize the permissions changes.
    Does that help?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Member
    Join Date
    Sep 2001
    Location
    Clifton Park, NY
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remote Grants for MySQL

    Hi,
    For setting up remote access from MySQL you need to do it like this:

    mysql> grant all privileges on DATABASENAME.* to USERNAME@'%' identified by 'PASSWORD';

    This will allow all access to all tables being connected from any location as long as they provide the correct login info. If you want to restrict where it can be connected from you can use something like this:

    mysql> grant all privileges on DATABASENAME.* to USERNAME@'IPORHOSTNAME' identified by 'PASSWORD';

    And have IPORHOSTNAME be the IP address or host name of the machine that you are connecting from.

    -John Reyes
    Tech Support
    Http://HostRocket.Com
    The Future of Managed Hosting

  4. #4
    SitePoint Zealot martin's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Now I'm in BIG Trouble

    Oh boy now I've done it!!!!!!

    Don't ask me how, but I've managed to change the root user password for MySQL. Now I cannot log in to mysqladmin and I've know Idea what I have amended it to.

    Is there any way of finding out what the password is? or at least deleting it and resetting MySQL? I have full root access to the server

    As you can imagine I'm not having a good day....
    Martin

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I get myself into a mess like this - I just got to go away from the computer for a couple of hours and have a break and avoid the temptation of hitting the pub!

    I have a feeling that if you go to the manual and read the installation instructions, you will see that there is a step where you run a script which copies the mysql and test databases from the source dir into the install dir. You could:

    1) back up the mysql database that is there now it wil be have a directory /path/to/mysql/data/mysql - so you can just copy the entire directory

    2) run that script - whatever it is, that copies the fresh copy of the mysql database into your /path/to/mysql/data directory.

    But - read the install documentation - I am only going from memory in what I am saying. BTW - there may be an easier way.

    OK - well, funny enough, do a search in google for "forgot mysql password" and what do you get?:
    http://www.mysql.com/doc/R/e/Resetting_permissions.html


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
  •