Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9

    Can't connect to MySQL server on '(my domain name)' (10061)


    I've been trying to get MySQL to work for the last week. I've tried looking all over the web but nothing seems to work...

    My domain name links to a directory on my home computer.

    I'm running Windows with Apache, PHP, and now MySQL. Apache and PHP work fine and I can connect to MySQL on localhost, but when I try to connect to (my domain name) it keeps giving me the "can't connect on 10061" error. I'm entering "mysql -h (my domain name) -u guest -p". I made a user named guest and as I said, can connect if I use "mysql -h localhost -u guest -p." mysqld.exe is running as a service. Window's firewall is disabled. Can't connect using mysql_connect in PHP either.

    Please help - It seems like I've tried everything and still can't connect.
  2. #2
  3. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    create a php file with

    Code:
    <?php
    phpinfo()
    ?>
    after that open that file in your browser. if you don't see a specific area for mysql then php is not recognizing that mysql is running.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    Originally Posted by Guelphdad
    after that open that file in your browser. if you don't see a specific area for mysql then php is not recognizing that mysql is running.
    OK yeah I tried that and there's no area for mysql. The only place mysql shows up is in the pathnames a few times (like Apache Environment -> PATH). So what can I do to fix that?

    Thanks for the help.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    275
    Rep Power
    10
    Ive got the same problem.
    It comes up with the same error.
    I tried to turn on winmysqladmin.exe and ran it but when I right clicked and clicked start the service and clicked yes it came up with a message saying failed to start the service please wait 30 seconds to try again.

    How do I get it to work?
  8. #5
  9. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    Originally Posted by johnnybeem
    OK yeah I tried that and there's no area for mysql. The only place mysql shows up is in the pathnames a few times (like Apache Environment -> PATH). So what can I do to fix that?

    Thanks for the help.
    You can install the three of mysql, php, apache using something like XAMPP or WAMPP, do a search for them in google or another search engine.

    Or you can search on here and figure out how to tweak your php installation so it recognizes mysql.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9

    XAMPP Problems


    Originally Posted by Guelphdad
    You can install the three of mysql, php, apache using something like XAMPP or WAMPP, do a search for them in google or another search engine.

    Or you can search on here and figure out how to tweak your php installation so it recognizes mysql.
    well that was a pain... I couldn't get PHP to recognize mysql so I installed XAMPP and got rid of all the otherr stuff. Now I have two more problems:

    1) In the Security section it's telling me "These XAMPP pages are accessible by network for everyone," so I went into the link that lets you "Make safe the XAMPP directory," but it wants a password. I never even set a password so what do I enter in?

    2) nevermind - fixed the second problem

    Thanks again. I'm new to this stuff and can't find much documentation on XAMPP.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    alright wow nevermind that was easier than I thought... I just found a .htpassword file and put that in as the user and password
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    Originally Posted by johnnybeem
    alright wow nevermind that was easier than I thought... I just found a .htpassword file and put that in as the user and password
    Just when I thought it was fixed... I'm getting the same error I was getting before but now with XAMPP... "can't connect to MySQL server on '(my domain name)' (10061)" - php recognizes mysql now so I don't know what's going on. somebody please help this is such a pain.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    23
    Rep Power
    0
    Originally Posted by johnnybeem
    Just when I thought it was fixed... I'm getting the same error I was getting before but now with XAMPP... "can't connect to MySQL server on '(my domain name)' (10061)" - php recognizes mysql now so I don't know what's going on. somebody please help this is such a pain.
    this is not a problem with PHP not recognizing mySQL. If PHP didn't know about the mySQL extension, you'd be getting an error stating that the mysql_connect() function isn't recognized.
    On your machine, get to a command prompt and type:
    nslookup yourdomain
    do you get a result? If not, you have a DNS issue.

    There are a lot of reasons this can happen though...try also making sure that skip-networking is NOT enabled in your my.cnf file.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    Originally Posted by jimfuse
    this is not a problem with PHP not recognizing mySQL. If PHP didn't know about the mySQL extension, you'd be getting an error stating that the mysql_connect() function isn't recognized.
    On your machine, get to a command prompt and type:
    nslookup yourdomain
    do you get a result? If not, you have a DNS issue.

    There are a lot of reasons this can happen though...try also making sure that skip-networking is NOT enabled in your my.cnf file.
    Here's what I get from nslookup:
    C:\>nslookup mydomain
    *** Can't find server name for address 192.168.1.1: Non-existent domain
    *** Default servers are not available
    Server: UnKnown
    Address: 192.168.1.1

    Non-authoritative answer:
    Name: mydomain
    Address: mydomain'sip

    I looked at the my.cnf file also, and skip-networking is commented out. Any other ideas? Thanks again.
  20. #11
  21. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    If you are trying to connect via localhost either use localhost or 127.0.0.1
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    Originally Posted by Guelphdad
    If you are trying to connect via localhost either use localhost or 127.0.0.1
    Do you mean since my computer is the server, I can't connect to it by putting in (my domain name)? In other words, my computer can't connect to itself? I thought that should work, because I can get to my website from this machine by entering my domain in a browser, but maybe it is different with mysql.
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    59
    Rep Power
    12
    Hello,

    Um, I don't mean to state the obvious, but did you execute a GRANT command on the mysql command line to allow connections from 'your domain name'. for example...

    Code:
    GRANT ALL PRIVILEGES ON testdb.* TO 'guest'@'mydomainname'  IDENTIFIED BY 'goodpassword';
    where testdb.* replace with the database you want to be able to connect to or use *.* to be able to connect to all databases

    Also - Are you using port 10061 instead of the default port 3306?
    Which version of Mysql is it?


    Regards,
    Mike
  26. #14
  27. Hockey face
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    St. Catharines, Canada
    Posts
    8,144
    Rep Power
    1316
    Originally Posted by johnnybeem
    Do you mean since my computer is the server, I can't connect to it by putting in (my domain name)? In other words, my computer can't connect to itself? I thought that should work, because I can get to my website from this machine by entering my domain in a browser, but maybe it is different with mysql.
    Mysql and php recognize 127.0.0.1 as the default for the local machine or localhost. you should be able to type in http://localhost or http://127.0.0.1 in your browser and see the default page for php.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2006
    Posts
    51
    Rep Power
    9
    Originally Posted by hobbsm
    Hello,

    Um, I don't mean to state the obvious, but did you execute a GRANT command on the mysql command line to allow connections from 'your domain name'. for example...
    OK well I was pretty sure I did that, but I dropped the old "guest" user and made a new one again anyway, then restarted mysql and apache - still doesn't work - even using 'guest'@'%' and all privleges. Mistakenly, I had it connecting with the wrong password in the PHP file, but it doesn't work with the right password either. I don't need to enter my domain name anywhere in the mysql configuration files, do I (having Apache and mysql running is enough)? As I said, I can get to the website by entering my domain in a browser so apache is working.
    Also - Are you using port 10061 instead of the default port 3306?
    Which version of Mysql is it?
    As for that, I haven't changed the default port so I don't know why it's running on 10061. I'm using whichever version of mysql comes with XAMPP...
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 1 to server version: 5.0.18-nt
    ... if that's what you mean

    Thanks a lot,
    John
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo