LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2007, 01:12 PM   #1
kccoop35
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Rep: Reputation: 0
Desktop application connecting to MYSQL on Linux Server


Hello All,

I have a Dedicated server, running Plesk 7.5.4 Linux/Unix. We have developed a desktop application that interacts with mysql. It works fine on local WAMP but the application will not interact with the mysql on the server.

Is there any easy fix for this problem? Do I need to access the root directory of mysql to change the access settings?
Your assistance is greatly apprecieated.

Thanks,

Coop
 
Old 03-09-2007, 06:48 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

First you need to add checks in the application - when it tries to connect to the database and it fails - you need to print out an error message. The network could be down, access denied, service down - it could be many reasons. The mysql documentation has examples on how to connect to the database - including printing out error messages.

Most likely there's some "Access denied". A default MySQL install gives root access to the database from localhost only. There's also an option called "skip-networking" - some distros may turn it on for security reasons.
 
Old 03-09-2007, 07:38 PM   #3
kccoop35
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Original Poster
Rep: Reputation: 0
This is the errors we keep getting

Error No:1045
Access denied for user:'username@135.242.65.281'(using password:YES')

We have tried using a program called putty, we are unable to connect using that either.

How do I set the root password? I dont think its ever been setup.

Thanks again,

Coop
 
Old 03-10-2007, 03:52 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi again

On the server, type mysql, and give the command:
grant all privileges on databasename.* to username identified by 'password';

Change "databasename", "username" and "password" to the values you want.

This will give username access to all tables in the specified database from anywhere.

It is common to not allow access from anywhere. If you want that, try:
grant all privileges on databasename.* to username@135.242.65.281 identified by 'password';

To change the root password:
mysqladmin -u root -p password 'newpassword';

This will ask for the old password first, if it isn't set before, just hit enter.

For more info:
http://dev.mysql.com/doc/refman/5.0/en/grant.html
 
Old 03-10-2007, 09:31 AM   #5
kccoop35
LQ Newbie
 
Registered: Feb 2007
Posts: 7

Original Poster
Rep: Reputation: 0
HI Guttorm,

Thanks for your help. I am going to work on this today. I'll keep you posted.

Thanks again,

Coop
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to a Remote MySQL Server msound Linux - Networking 2 10-18-2006 12:07 PM
Connecting to MS SQL server with MySQL moistTowelette Linux - Desktop 1 10-02-2006 04:46 AM
connecting to mySQL server running on FC5 dessonville50 Fedora 4 05-09-2006 06:00 AM
Grey desktop connecting to VNC server paulsh2k4 Linux - Software 12 01-28-2005 04:12 AM
connecting to remote MySQL server acos7 Linux - Software 2 01-30-2004 11:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration