|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Before you bag me too much ... I have been searching for a fix to this problem for a week or so in this forum, in the MySQL doc and anywhere that remotely looked like it had a solution.
I am running MySQL 3.23.57-nt on Windows XP Pro and have struggled to get it working with anything other phpMyAdmin, which appears to be the only app that can connect to the server port. I am also running apache web server on the same machine. My current my.ini file looks like ... #This File was made using the WinMySQLAdmin 1.4 Tool #13/07/2003 8:31:03 PM #Uncomment or Add only the keys that you know how works. #Read the MySQL Manual for instructions [mysqld] basedir=D:/mysql #bind-address=10.0.0.1 datadir=D:/mysql/data #language=D:/mysql/share/your language directory #slow query log#= #tmpdir#= #port=3306 #set-variable=key_buffer=16M [WinMySQLadmin] Server=D:/mysql/bin/mysqld-nt.exe user=root password=<password> The troubleshooting I have gone through so far is: - 1. Checked the hosts file to ensure there were no conflicts. I have removed everything except localhost (127.0.0.1). 2. telnet localhost 3306 - works OK. 3. phpMyAdmin works OK. 4. set the root password and tried (I don't know why I did this but I thought the no password option was causing some error :confused ![]() 5. Removed MySQL 4.x and re-installed 3.23 6. Checked that a firewall was not running on XP and it wasn't 7. Removed my.ini so that winMySqlAdmin would re-create it - worked OK. 8. Removed every entry in the my.ini except datadir, basedir and user. 9. scratched my head a lot. 10. cursed. 11. Tried connect with mysqladmin but get the same error 12. started mysqld in standalone mode and connecting that way forgive me if this is a bit stupid, I am new at MySQL). 13. Changed the mysqld program to "run as" my user rather than system (read this somewhere as a possible fix) ... no good. 14. setup a new user for access only from localhost (also read that this was needed but no good. 15. I have also tried telnet to port 3306 when MySQL is not running just in case something else is grabbing the port. It failed with a connection refused message as expected. So after all that I am at a loss. I would really love to get this working as I want to try some OLAP stuff using MySQL. Any help would be greatly appreciated. brettm |
|
#2
|
|||
|
|||
|
Quote:
Please check following: [1] What kinds of application you are is trying to connect to MySQL server? Do you need to install ODBC? If yes, install it and check once again your connection string. [2] If you connect with the internet trough a gateway. If your DNS is enabled. After disableing DNS, try again to connect to MySQL server. |
|
#3
|
|||
|
|||
|
Thanks for the quick response ...
I am trying to connect to the DB using MySQL Control Center and other various management tools as I am just trying to set up my DB. I have also installed the ODBC driver and received exactly the same error. Further, I wrote a small test Java/JDBC program and received the same error. I will check the DNS and report back. Sorry cannot do it now ... got to go to work Thanks. |
|
#4
|
|||
|
|||
|
Brett,
Are you using MySQL solely for Java purposes? If so, have you installed wConnector/J? Check that link if you haven't already done so...
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
Tried Connector/J already but re-installed anyway. Got the following ...
C:\JBuilder8\jdk1.4\bin\javaw -classpath "C:\Documents and Settings\brett\jbproject\t_golfer1\classes;D:\java \jre\lib\ext\mysql-connector-java-3.0.8-stable-bin.jar;C:\JBuilder8\jdk1.4\demo\jfc\Java2D\Java2D emo.jar;C:\JBuilder8\jdk1.4\demo\plugin\jfc\Java2D \Java2Demo.jar;C:\JBuilder8\jdk1.4\jre\lib\charset s.jar;C:\JBuilder8\jdk1.4\jre\lib\ext\dnsns.jar;C: \JBuilder8\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuil der8\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilder 8\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuild er8\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilder8\jdk 1.4\jre\lib\jaws.jar;C:\JBuilder8\jdk1.4\jre\lib\j ce.jar;C:\JBuilder8\jdk1.4\jre\lib\jsse.jar;C:\JBu ilder8\jdk1.4\jre\lib\rt.jar;C:\JBuilder8\jdk1.4\j re\lib\sunrsasign.jar;C:\JBuilder8\jdk1.4\lib\dt.j ar;C:\JBuilder8\jdk1.4\lib\htmlconverter.jar;C:\JB uilder8\jdk1.4\lib\tools.jar" t_golfer1.t_golfer1 java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1622) at com.mysql.jdbc.Connection.<init>(Connection.java:491) at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346) at java.sql.DriverManager.getConnection(DriverManager .java:512) at java.sql.DriverManager.getConnection(DriverManager .java:193) at t_golfer1.t_golfer1.main(t_golfer1.java:12) Exception in thread "main" Thanks for your help! |
|
#6
|
|||
|
|||
|
Why can I connect with PHPMyAdmin?
What is so different about PHPMyAdmin? It can connect and has always been able to.
I would appreciate any further suggestions! |
|
#7
|
|||
|
|||
|
phpMyAdmin connects with the php mysql function mysql_connect(); using the information you specified in your config.inc.php file. Have you tried to connect from the command line? mysql -u username -p -h localhost
If you're running windows 2k or xp, do you have the firewall running? Have you verified that port 3306 is even open for connections? |
|
#8
|
|||
|
|||
|
Yes, I have checked that the port is open. In my initial message I stated that I had telnet'ed successfully to the port. No, there is no firewall running.
My question was not about the config of PHP connecting to the MySQL db but the method it used, i.e., emulated telnet, pure sockets, how??? The reason I asked the question was because it is the only app that connect to the db. As for "mysql -u username -p -h localhost", this returned the same error. I would appreciate any other feedback. Many thanks. brettm |
|
#9
|
||||
|
||||
|
Could it have anything to do with the fact that your bind-address is listed as 10.0.0.1 and localhost is the standard 127.0.0.1? This may be standard procedure, but it seems to me that it could cause some sort of conflict. Try mysql -u username -p -h 10.0.0.1 for kicks. Then check to see if phpMyAdmin is using 10.0.0.1 or localhost or 127.0.0.1. Telnetting to 3306 on localhost tells you that the port is open but says nothing about the state of mysql (unless you got a prompt of some sort). This is certainly perplexing.
|
|
#10
|
|||
|
|||
|
When I telnet localhost 3306 I get the following ...
1 4.0.14-max-debug^I2_fdC ►☺♦Bad handshake Connection to host lost. The bad handshake only comes after hitting enter twice. However if I telnet to 10.0.0.1 (same port) I do not get the connection message nor the bad handshake message. PHPMyAdmin is using localhost to connect. I have installed MySQL 4.0.14a just to see if this made a difference. I unstalled 3.23 and installed the new version in a different directory (and disk) but I still get the same error. Any other suggestions would be greatly appreciated. Thanks. brettm |
|
#11
|
||||
|
||||
|
Quote:
Yeah, this is because you start the connection, but the server's waiting for input before it sends anything back to you. Same thing happens if you telnet to port 80. It just sits there until you type "GET," at which point it spits out the default page. Have you tried any other PHP apps? I suspect they'd probably work. The only thing I can recommend is that you sniff around php.net or try to find something about the internal methods PHP uses to connect. I'm not sure even that'll wind up being very helpful. I wish I had something more helpful to contribute. |
|
#12
|
|||
|
|||
|
I had the same problem as you have.
Because I have a ADSL-connection with my provider, the DNS-lookup goes via the provider. This confuses MySQL (localhost cannot be found by it anymore.) The solution could be : enable-named-pipe in the my.ini file. It worked for me...... a sample my.ini file : [mysqld] basedir=C:/mysql enable-named-pipe datadir=C:/mysql/data [WinMySQLadmin] Server=C:/mysql/bin/mysqld-nt.exe QueryInterval=10 |
|
#13
|
|||
|
|||
|
Quote:
Hi |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > HELP! Can't connect to MySQL server on localhost (10061) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|