Solved

How to connect MySql server from client machine ?

Posted on 2008-10-08
16
2,478 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
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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 50 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 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…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

816 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

10 Experts available now in Live!

Get 1:1 Help Now