Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

remote access mysql can't connect when changed from localhost to IP#

195 views
Skip to first unread message

css-discuss.org

unread,
May 13, 2012, 8:58:47 PM5/13/12
to
Hello
I get this error when starting mysql using MysqlAdmin application
service window
>. ERROR! Manager of pid-file quit without updating file.
>Failed to start server.
But when I relaunch mysqladmin I get the error
>connection error, could not connect to mysql instance at XX.XX.XXX.XX (61)(code 2003)
There is no error log I can find with May 13 date
What changed is I got a permanent IP address using dyndns pro account
I did bind-address: XX.XXX.XX.XX on the IP address given.
I did listen XX.XXXX.XX.XX:80 in apache
in my.cnf I have this for pid-file
pid-file = /var/run/mysqld.pid but I wonder if there is some error
starting msyql because of what it says about manager of pid-file quite
without updating the file? It is a strange error message because I
only get it when logged in as root with mysqladmin tool and I try to
start using the service.
I cannot locate an error log file in the data directory for May 13
I could find a mysqld-relay-bin.000008 file which means replication
is turned on? How do I turn that off?
I want to use this database for a demo file, it is only a demo
database but I would like to get it working remotely which means I
need to start mysqld on the right host. Mysqld was working fine on
localhost but that is not what I want it for. This is a test server.
I have another one for development on my laptop on localhost.

thanks,
jr




Message has been deleted

css-discuss.org

unread,
May 14, 2012, 11:06:40 AM5/14/12
to
The problem is I cannot connect to the database.
I changed the permissions and I can connect via mysqladmin tool now.
If I navigate to the static IP address then open PHPmyadmin,
I get the server as localhost. Is the server supposed to be localhost
or the static IP address?
In the priviledges section of phpmyadmin, I have added the host IP
number and password
as root because server is running on root and I just want to get it to
work on the outside ip first and then
run it as mysql user. When I try to connect below I get the error
cannot connect. I just want to connect to database. I do not know
why it is saying css-discuss.org on this usenet group. I corrected it
once.
thanks,

$dbname= "taskos";
$link = mysql_connect('XX.XX.XX.XX:3306', 'root', 'xxxx');
mysql_select_db($dbname);

if ( !mysql_select_db($dbname,$link) ) {
echo 'Could not select database taskos<br>';
exit;}else{echo "connected to taskos!";}

Jerry Stuckle

unread,
May 15, 2012, 7:40:19 AM5/15/12
to
"localhost" is simply the loopback adapter and refers to the same
machine the application is running on. This generally equates to IP
address 127.0.0.1. If you're accessing TCP/IP resources on the same
machine the application is running on, you normally use "loopback" or
"127.0.0.1".

The other IP address (whether static or dynamic) is required to access
TCP/IP resources from outside of this machine.

> In the priviledges section of phpmyadmin, I have added the host IP
> number and password
> as root because server is running on root and I just want to get it to
> work on the outside ip first and then
> run it as mysql user. When I try to connect below I get the error
> cannot connect. I just want to connect to database. I do not know
> why it is saying css-discuss.org on this usenet group. I corrected it
> once.
> thanks,
>
> $dbname= "taskos";
> $link = mysql_connect('XX.XX.XX.XX:3306', 'root', 'xxxx');
> mysql_select_db($dbname);
>
> if ( !mysql_select_db($dbname,$link) ) {
> echo 'Could not select database taskos<br>';
> exit;}else{echo "connected to taskos!";}

Do you need to access MySQL from another machine? In most instances,
the answer is no, and it's better to disable networking in MySQL for
security reasons. (Note that if you're connecting to PHPMyAdmin on the
server then accessing the database, you are accessing MySQL locally from
the application).

Also note that dyndns does NOT give you a static IP address. Only your
ISP can assign IP addresses. What dyndns gives you is a static domain
name which can be equated to your ip address. They are two different
things.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

jans

unread,
May 15, 2012, 10:45:54 AM5/15/12
to
P.S. when I go to www.whatismyIPaddress.com my IP address is 99.33.25.193.

jans

unread,
May 15, 2012, 10:43:21 AM5/15/12
to
> ';
> > exit;}else{echo "connected to taskos!";}
>
> Do you need to access MySQL from another machine? In most instances,
> the answer is no, and it's better to disable networking in MySQL for
> security reasons. (Note that if you're connecting to PHPMyAdmin on the
> server then accessing the database, you are accessing MySQL locally from
> the application).
>
> Also note that dyndns does NOT give you a static IP address. Only your
> ISP can assign IP addresses. What dyndns gives you is a static domain
> name which can be equated to your ip address. They are two different
> things.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstu...@attglobal.net
> ==================
HELLO JERRY,
yes I do need to access the database from another domain. I want to show a demo database to a client so I added the IP address in my.cnf. I thought the same as you. Dyndns gives a named host and the IP address changes related to that domain. However, I found out there is a Dyndns pro account that actually gives you a static IP address. Mine is 99.33.25.193 and it is permanent. Do you have any idea why I can't mysql_connect using this account ro...@99.33.25.193? It seems to be in order with the db priviledges because I can connect via MySQLAdmin but should it be localhost server in mysql or 99.33.25.193 server? Do I need to set up another phpmyadmin? thanks,

jans

unread,
May 15, 2012, 10:59:48 AM5/15/12
to
It is just to demonstrate a Jquery app. The data in the database is dummy data. I just want to connect using mysql_connect from another domain.

The Natural Philosopher

unread,
May 15, 2012, 11:05:20 AM5/15/12
to
jans wrote:

> yes I do need to access the database from another domain. I want to show a demo database to a client so I added the IP address in my.cnf.

I thought the same as you. Dyndns gives a named host and the IP address
changes related to that domain.
However, I found out there is a Dyndns pro account that actually gives
you a static IP address. Mine is 99.33.25.193 and it is permanent.
Do you have any idea why I can't mysql_connect using this account
ro...@99.33.25.193?
It seems to be in order with the db priviledges because I can connect
via MySQLAdmin but should it be localhost server in mysql or
99.33.25.193 server?
Do I need to set up another phpmyadmin? thanks,

well you have te server set up OK

from here...


telnet 99.33.25.193 3306
Trying 99.33.25.193...
Connected to 99.33.25.193.
Escape character is '^]'.
4
5.0.77 v(a1o]bV, e|^AhhSD=Cz\Connection closed by foreign host.


So its accepting connections. It may not allow your particular username
to connect to your particular database from a remote host, however.

I cant remember which database or table its in, but a user permssions
entry generally has a host - which might be 'localhost' '127.0.0.1' or
'Any' ..the first two will not work using a wide area link.


--
To people who know nothing, anything is possible.
To people who know too much, it is a sad fact
that they know how little is really possible -
and how hard it is to achieve it.

Denis McMahon

unread,
May 15, 2012, 12:59:30 PM5/15/12
to
On Tue, 15 May 2012 07:43:21 -0700, jans wrote:

> changes related to that domain. However, I found out there is a Dyndns
> pro account that actually gives you a static IP address. Mine is
> 99.33.25.193 and it is permanent. Do you have any idea why I can't

Janis

DynDNS Pro accounts do not give you a permanent fixed IP!

99.33.25.193 is an ATT assigned IP address that is used by "PPPox Pool",
which I imagine is a dynamic dsl ip assignment.

Rgds

Denis McMahon

Jerry Stuckle

unread,
May 15, 2012, 1:06:33 PM5/15/12
to
> HELLO JERRY,
> yes I do need to access the database from another domain. I want to show a demo database to a client so I added the IP address in my.cnf. I thought the same as you. Dyndns gives a named host and the IP address changes related to that domain. However, I found out there is a Dyndns pro account that actually gives you a static IP address. Mine is 99.33.25.193 and it is permanent. Do you have any idea why I can't mysql_connect using this account ro...@99.33.25.193? It seems to be in order with the db priviledges because I can connect via MySQLAdmin but should it be localhost server in mysql or 99.33.25.193 server? Do I need to set up another phpmyadmin? thanks,

OK, I suspect they've set up a proxy server on that ip, and are just
forwarding all requests to your dynamic ip address. This must be new
since I last used them (but it has been a few years).

I checked, and I can connect to the port, so MySQL is working OK. I
suspect your problem is your login.

MySQL keeps separate ids and privileges for local and remote users.
root@localhost is not the same as ro...@example.com. If you want to be
able to sign in from both, you need two users - one being root@localhost
(which you have) and the other for the remote login.

You can use root@'%', which grants access to root from any computer, but
that's also obviously a security exposure. If you're only accessing
MySQL from a single machine, you can use that machine's domain name or
ip address, which will limit access (but then requires updating MySQL if
the domain name or ip address changes, whichever you use).

The Natural Philosopher

unread,
May 15, 2012, 3:16:17 PM5/15/12
to
His name is Jans, Dennis..
;-)

Gordon

unread,
May 16, 2012, 1:31:47 AM5/16/12
to
On 2012-05-14, css-discuss.org <janis...@gmail.com> wrote:
> On May 13, 5:58 pm, "css-discuss.org" <janis.ro...@gmail.com> wrote:
>> Hello
>> I get this error when starting mysql using MysqlAdmin application
>> service window>. ERROR! Manager of pid-file quit without updating file.
>> >Failed to start server.
>>
>> But when I relaunch mysqladmin I get the error
>connection error, could not connect to mysql instance at
> XX.XX.XXX.XX (61)(code 2003)

[snip]

>
> The problem is I cannot connect to the database.

Yes you appear to have Error 2003. (See that code 2003 above)

http://forge.mysql.com/wiki/Error2003-CantConnectToMySQLServer

MySQL gives 2000 something errors. 2002 is one I sometimes get.


jans

unread,
May 17, 2012, 1:59:08 PM5/17/12
to
It works now for ro...@99.185.244.210 for just that one database . Thanks,

jans

unread,
May 17, 2012, 1:57:48 PM5/17/12
to
My experiment worked! The problem was DYDNS hadn't assigned the static IP yet so it was the relayed one. It took a day for them to process the request. I did connect with mysql. It looks like I have a static IP for $20.00 :-)

jans

unread,
May 17, 2012, 2:04:03 PM5/17/12
to
It works for testing snippets from work also.

The Natural Philosopher

unread,
May 17, 2012, 6:57:54 PM5/17/12
to
You can get a whole domain for $10, and if you have a static address,
set up a world visible node name for DNS.
0 new messages