Solved

Can't connect to the MySQL server 5.2.22 community edition

Posted on 2012-04-02
9
1,207 Views
Last Modified: 2012-04-03
Installed MySQL Server 5.2.22 on a Windows 2008 server. Using the MySQL workbench 5.2 cummunityt edition, the database is working on the server and I can actually log into it via ODBC on the server computer. I have tried to log on the MySQL server on windows 7 client machine using ODBC and it will not see the My SQL server. I have disabled the windows firewall on both the server and the client and I still can not see the My SQL server on the client machine. Openned port 3306 and nothing.
Any suggestions?

Thanks,
Mike
0
Comment
Question by:miker454
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 6

Assisted Solution

by:Patrick Tallarico
Patrick Tallarico earned 150 total points
Comment Utility
With the ODBC driver, when you try to set up the connection, there should be a test button that you can use before you finish the setup.  What error does it give?
0
 

Author Comment

by:miker454
Comment Utility
Thanks for the interest. I try to add the ODBC drive MySQL ODBC 5.1 driver version 5.01.08.00 in the client computer and after I enter the connection parameters Data source name, user, password, I can not see any of the databases in the drop down button, and the test fails. (Connection fails: [HY000][ODBC 5.1 Driver]Can't connect to MySQL sever on 'Localhost' (10061). I do the same thing on the server computer and there the databases come up and test is succesfull.

Thanks,
Mike
0
 
LVL 24

Expert Comment

by:johanntagle
Comment Utility
You can see from the error message that it is connecting to localhost, not the server.  Can you post your connection parameters?
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
You need to first to configure MySQL to listen for tcp/ip connections.
You the have to use the advanced firewall settings and open the port you configured in the prior to allow access from the private/domain network.

netstat -an | grep 3306
See whether MySQL is using the default port.
Use the MySQL configuration tool to make sure it is configured to listen on tcp/ip.
Then make sure you add the user you want to connect with to allow connections from hosts other than localhost.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 6

Expert Comment

by:Patrick Tallarico
Comment Utility
Make sure the host parameter is the name of the server rather than localhost, or the IP address of the server.
In addition, you may need to grant permission to the user to allow that database to be accessed from a remote computer, (not on the server as localhost)
Generally speaking the syntax for that type of command is:
grant all on database.tablename to 'user'@'computer or ipaddress' identified by 'password';
tablename could be '*' to specify all tables, and computer or ipaddress could be '%' to specify a user from anywhere.
0
 

Author Comment

by:miker454
Comment Utility
Using the MySQL workbench on the server I created a new New Connection with the name of the client computers as the user (instead of root). I then tried to create the OBDC from the client computer

 Data Source Name: Mike7 (it is the name of the connection on the server)
TCP?IP Server : 192.168.1.180 (servers ipv4 address)
Port: 3306
User: MIKEWIN7 (name of the client computer)
Password: ****** (same password as server connection)

When I hit the test button : Connection Failed: [HY000][MySQL][ODBC 5.1 Driver]
 Host 'MIKEWIN7' is not allowed to connect to this MySQL server.

How do I give this computer permission to connect. I figured once I created a connection that would be enough to give it permission to connect. I specifically used the name MIKEWIN7 as name of the username on the server New Connection. Im still not there.

Thanks for all the suggestions,
Mike
0
 
LVL 76

Accepted Solution

by:
arnold earned 200 total points
Comment Utility
Within workbench use the administrator.
Then add the user at any host %. Note using the same username at times leads to trouble do to conflict especially if the user has separate password
Usename@client
Usename@%

If you prefer using the comman line interface.
http://31bit.com/technology/86-mysql-database/302-how-to-grant-remote-access-to-a-mysql-database
Note that after adding users, you need to flush privileges.
0
 
LVL 24

Assisted Solution

by:johanntagle
johanntagle earned 150 total points
Comment Utility
In addition to @arnold's comment, @stpmt11 already gave you the GRANT syntax above.  You can also refer to http://dev.mysql.com/doc/refman/5.1/en/grant.html for more details.
0
 

Author Closing Comment

by:miker454
Comment Utility
Thanks to all 3 of you. I feel kind of silly for having problem right off the starting gun but you guys helped me connect to the server. I went to the workbech and added users and priviledges. I did it right from the interface.Thanks Arnold, johanntangle, and stpmt11.


Appreciate it,
Mike
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now