Solved

How to connect MySql server from client machine ?

Posted on 2008-10-08
16
2,493 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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 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

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.

Question has a verified solution.

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

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
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…

756 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