Solved

How to connect MySql server from client machine ?

Posted on 2008-10-08
16
2,474 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-
Comment Utility
How do you want to access it? Command line? Graphicial utility? From a programming language?
0
 

Author Comment

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

Thanks,
dAshish
0
 
LVL 1

Expert Comment

by:fReAkCoRp
Comment Utility
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
 
LVL 3

Expert Comment

by:wktang83
Comment Utility
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-
Comment Utility
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
Comment Utility
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-
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Expert Comment

by:Ara-
Comment Utility
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
Comment Utility
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-
Comment Utility
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
Comment Utility
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-
Comment Utility
It should be 'root'@'172.18.1.215'
0
 

Author Comment

by:dashish
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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