PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 19th, 2001, 04:10 PM
SammyK's Avatar
SammyK SammyK is offline
Happy Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2001
Location: UK (University of Kentucky)
Posts: 1,810 SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 7 sec
Reputation Power: 45
Changing localhost IP address for MySQL

I am moving a bunch of my database sites to a new server. I have to keep the databases hot durring the switch. Is there a way to change the IP address of 'localhost' to another IP address when you connect in PHP to MySQL? That way I wouldn't have to change 'localhost' to the new IP address on every script.

Thanks In Advance!
Sam Powers
__________________

Reply With Quote
  #2  
Old December 19th, 2001, 04:56 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,966 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 188
yes, there is. But youŽd rather not.
"localhost" is used by many services and programs to connect to other services and programs on the same machine.

you could do something in your /etc/hosts like changing
"127.0.0.1 localhost"
to
"192.168.1.10 localhost"

but you better do a full-text search-and-replace to the FQDN if you donŽt want to **** up the system or if you donŽt own the machine you do this on:

for i in /home/myname/*.php; do cat "$i"|sed -e "s/localhost/mynewname/g" > "/tmp/phptmp"; cat /tmp/phptmp >"$i"; done; rm -f /tmp/phptmp

using bash. (make backups BEFORE!)

and:
use mysql; update hosts set host="your-name.de" where host="localhost";
and then tell mysql to reload the grant tables. (mysqladmin is your friend...)

(dont use this literally. i am at home right now and dont have mysql running on my new system yet!!!)

using Win****? - dont do it. weŽll find another solution.

Reply With Quote
  #3  
Old December 19th, 2001, 05:11 PM
SammyK's Avatar
SammyK SammyK is offline
Happy Monkey
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2001
Location: UK (University of Kentucky)
Posts: 1,810 SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level)SammyK User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 7 sec
Reputation Power: 45
Thanks. I own both the machines - the one I am currently using and the one I am moving to, and they are both running Linux, just like at home. Linux all the way, baby!!! Down with Microgay!!

This isn't a PHP question, but I forgot how to do a search and replace on all the files in a directory from the Kernel... do you think you could help me on that one?

Thanks Again!
Sam Powers

Reply With Quote
  #4  
Old December 19th, 2001, 05:20 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,966 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 188
this is not a kernel but a bash question.

see the "for i in ..." line. i think this is what you are asking for.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Changing localhost IP address for MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap