Solved

Can't connect to the MySQL server 5.2.22 community edition

Posted on 2012-04-02
9
1,215 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
ID: 37798662
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
ID: 37798720
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
ID: 37798732
You can see from the error message that it is connecting to localhost, not the server.  Can you post your connection parameters?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 77

Expert Comment

by:arnold
ID: 37798772
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
 
LVL 6

Expert Comment

by:Patrick Tallarico
ID: 37798777
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
ID: 37799036
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 77

Accepted Solution

by:
arnold earned 200 total points
ID: 37799084
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
ID: 37799102
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
ID: 37801207
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simple shopping cart database structure 5 71
RDBMS and No sql database 4 63
MySQL Backup Strategy 15 44
Formating field inside mysql query 2 13
Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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