Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to connect MySql server from client machine ?

Posted on 2008-10-08
16
Medium Priority
?
2,575 Views
Last Modified: 2013-11-05
Hello All,

I have installed mysql server on linux machine (172.18.2.205) and I have also installed mysql server on my windows machine.

Now I want to access mysql server on linux machine from my windows machine as this is happends in oracle (sever and client).

Please assist me.

Thanks in advance.

Thanks,
dAshish
0
Comment
Question by:dashish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 4

Expert Comment

by:Ara-
ID: 22667877
How do you want to access it? Command line? Graphicial utility? From a programming language?
0
 

Author Comment

by:dashish
ID: 22667971
I want access MySQL on linux machine using command line from my window machine.

Thanks,
dAshish
0
 
LVL 1

Expert Comment

by:fReAkCoRp
ID: 22668576
Check this information about connecting to mysql server from various types of OS, this info is directly from MySQL WepPage.

http://dev.mysql.com/doc/refman/5.0/en/connecting.html

or either way try using MySQL Administrator that you can download from
http://dev.mysql.com/downloads/gui-tools/5.0.html

this tool is specially design to connect to any MySQL Server and manage all of your info in a more easy way, this tool is also from the MySQL group.

Hope this helps, regards.

0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 3

Expert Comment

by:wktang83
ID: 22669753
You need a windows SSH client to connect to the linux machine. (PuTTy is a free and a good one, download here: http://www.chiark.greenend.org.uk/~sgtatham/putty/)

Make sure you have installed openSSH (Not sure which distro you're using) in your linux machine. Then, in your windows machine PuTTy SSH client, enter the IP address of the linux machine, and connect through SSH. If you successfully login, you should see a command prompt in the terminal window.

Then, type mysql -u username -p to connect to the MySQL server. (Assuming you've installed MySQL correctly).
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22676146
On the windows machine open up a command line (Run->"cmd").

Type "mysql -u usr -p -h host"
Exchange usr for the username you want to use (root if you haven't created users) and exchange host with ip og hostname for your linux machine.
0
 

Author Comment

by:dashish
ID: 22685551
Hello Ara, I run following command on windows machine

mysql -u root -p -h 172.18.2.205

It gives me following error

ERROR 1045 (28000): Access denied for user 'root'@'172.18.1.215' (using password: YES)

here 172.18.1.215 is the windows machine.

Please help me.

thanks
dAshish
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22686310
The command:
mysql -u root -p -h 172.18.2.205
should prompt you for a password. Have you typed the right password? Is root the user you are using?
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22686351
And you probably need to set the permission on the server end first. Usually root i only allowed login from localhost. You need to add permission to 'root'@'ip/host'  where ip/host is where you are connecting from ('172.18.1.215' ).
0
 

Author Comment

by:dashish
ID: 22718486
Yes I am using root user and I typed password correctly after this command
mysql -u root -p -h 172.18.2.205.

How to set the permission on the server end.

Thanks,
dAshish
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22720352
Try this:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'host' IDENTIFIED BY 'password' WITH GRANT OPTION;

Replace host and password.
Host is probably 172.18.1.215
0
 

Author Comment

by:dashish
ID: 22728239
It is giving error while running grant command.
ERROR 1470 (HY000): String 'root@172.18.1.215' is too long for user name (should be no longer than 16)

thanks,
dAshish.
0
 
LVL 4

Expert Comment

by:Ara-
ID: 22738120
It should be 'root'@'172.18.1.215'
0
 

Author Comment

by:dashish
ID: 22738937
GRANT command executes successfully,

but this command -
mysql -u root -p -h 172.18.2.205

giving same error -
ERROR 1045 (28000): Access denied for user 'root'@'rajesh.lionking.com' (using password: YES)

Thanks,
dAshish
0
 
LVL 4

Accepted Solution

by:
Ara- earned 200 total points
ID: 22740485
Try this then:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'rajesh.lionking.com' IDENTIFIED BY 'password' WITH GRANT OPTION;

Remember to replace password.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

670 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