LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-13-2006, 01:28 AM   #1
vbsaltydog
Member
 
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Rep: Reputation: 15
hostname - sendmail - mysql


Hello everyone.

I have a RH9 server that is being used as a web server for several php/mysql apps. I recently had to setup the sendmail function in order for certain scripts to be able to send update notification emails via web based scripts as my php.ini is setup to use sendmail vs. smtp

The server has been running well for a while now but the hostname was the default localhost.localdomain in the hosts file and now I need it set to a valid fqdn in order for sendmail to work properly. This seems like no biggie but when I altered my /etc/hosts to give me a good hostname according to sendmail I noticed that my sites could not connect to their respective mysql databases as they were setup to connect as username@localhost and now my hostname is no longer localhost. So my question is ....how do I setup RH9 with a valid hostname so that sendmail can send properly without hosing up my mysql database connections?

It would seem like I would simply need to edit the db connection scripts to use mysqlusername@newhostname but I was hoping I could change the server's hostname to whatever and then set the mysqld to use server name of localhost even though the server's hostname is example.exampledomain.com

Any suggestions are appreciated.
 
Old 02-13-2006, 02:25 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Did you keep the entry:
Code:
127.0.0.1               localhost
in your /etc/hosts? There must be such ab entry in order to be able to use localhost to connect to mysql.

Regards
 
Old 02-13-2006, 03:59 AM   #3
vbsaltydog
Member
 
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Original Poster
Rep: Reputation: 15
yes, I kept the loopback as localhost and I set the static ip to the fqdn hostname, then I placed an entry for hostname to define the fqdn as the hostname. The issue is that I am connecting to the mysql db from another server on my lan and so it uses the static ip of the web server for the connection and the static ip of the webserver gets resolved to the fqdn by the hosts file and the db runs on localhost so the remote db user of whatever@localhost does not work.

Thanks for your reply
 
Old 02-13-2006, 04:44 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
In that case you should grant privileges to the root@IP or root@FQDN in your mysql users table.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail using wrong hostname schentor Linux - Networking 6 12-09-2005 01:53 PM
Hostname and Sendmail caps_phisto Linux - Networking 2 10-30-2004 11:51 AM
Residual hostname in Sendmail pauljtester Linux - Software 4 10-25-2004 01:54 PM
sendmail and unqualified hostname wlfdgcrkz Linux - Software 1 06-02-2003 03:53 PM
Sendmail and Hostname Change bmh.01 Linux - Software 3 05-31-2003 07:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:30 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