MySQL Forums
Forum List  »  Newbie

SOLVED: Re: mysql runs on computername instead of IP
Posted by: pet pres
Date: July 01, 2013 03:27AM

Ok, I solved the problem:

Originally I transferred all data from my original single webhosting where I had only 1 mysql and therefore everything was on localhost TO my new pc where I have TWO IPs and TWO MySQL servers on 3306 port and therefore no longer localhost is allowed. And the problem was that all users included the those with global privileges were trying to connect to localhost or computername.

SITUATION OF TWO WEBHOSTINGS WITH TWO IP ON ONE PC (Windows 2008 R server) - here dealing with MySQL only.

1. I went back to my old mysql server I temporarily set host of global user to "%" and again transferred all data (mysql database is enough) to my new server.

2. Add one line in - (myphpadmin)
$cfg['Servers'][$i]['host'] = 'mynewhost.tld';
Thus, myphpAdmin binds to its address

3. Add one line in my.ini (in mysql/bin)

Thus you can run MySQL server on 3306 port while other MySQL server on the same pc runs on the same port and other IP.

4. Open myphpAdmin and change hosts in all users starting with pma to this computer or this IP and it must be the IP of mynewhost.tld
It is a crucial. I do not recommend to allow host=%, even if it would would work for ever everywhere, because of higher security risk.

5. Go to every php script defining the connection to database and change localhost to mynewhost.tld.

That´s it. No restarts necessary.

PS: Of course if you have previous settings at some users that they must allow host from anywhere (%) so leave it be.

Edited 5 time(s). Last edit at 07/01/2013 03:35AM by pet pres.

Options: ReplyQuote

Written By
SOLVED: Re: mysql runs on computername instead of IP
July 01, 2013 03:27AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.