Solved

How to connect MySql server from client machine ?

Posted on 2008-10-08
16
2,500 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL Backup Strategy 15 64
migrating to phpbb forum from vBulletin 4.2 3 95
mysql qry 1 38
MySQL-Design Help 12 67
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…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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