You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@vcl.apache.org by Clark Cooper <Cl...@vc3.com> on 2012/02/27 22:36:51 UTC

failed mysql connection

Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:


Testing mysql connection ...
Error: fsockopen(): unable to connect to localhost:3306 (Permission denied)
Could not connect to port 3306 on localhost


For debugging purposes, I have stopped iptables.  Here is the connection information within my secrets.php file:

[root@rhel61 .ht-inc]# grep vcl secrets.php 
$vclhost = 'localhost'; # name of mysql server
$vcldb = 'vcl';         # name of mysql database
$vclusername = 'vcluser';      # username to access database
$vclpassword = 'vcluserpassword';      # password to access database



Note the following outputs from MySQL:

mysql> show grants for vcluser@localhost;
+----------------------------------------------------------------------------------------------------------------+
| Grants for vcluser@localhost                                                                                   |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'vcluser'@'localhost' IDENTIFIED BY PASSWORD '*BC54E34381D07EB1FF25938A2F524C17201FC22F' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES ON `vcl`.* TO 'vcluser'@'localhost' |
+----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)


mysql> select host, user, password from mysql.user;
+-----------+---------+-------------------------------------------+
| host      | user    | password                                  |
+-----------+---------+-------------------------------------------+
| localhost | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
| 127.0.0.1 | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
| localhost | vcluser | *BC54E34381D07EB1FF25938A2F524C17201FC22F |
+-----------+---------+-------------------------------------------+


Clark Cooper | Senior Systems Engineer
1301 Gervais Street, Suite 1800 | Columbia, SC 29201
(d) 803.978.2699 | (f) 803.733.5888
Clark.Cooper@VC3.com | www.VC3.com
Follow us: 




RE: failed mysql connection

Posted by Clark Cooper <Cl...@vc3.com>.
That was it...  SeLinux was enabled, but apparently not configured to allow as mentioned in the installation steps:

/usr/sbin/setsebool -P httpd_can_network_connect=1


Thank you,
Clark


-----Original Message-----
From: dchebota@gmu.edu [mailto:dchebota@gmu.edu] 
Sent: Tuesday, February 28, 2012 8:53 AM
To: vcl-user@incubator.apache.org
Subject: Re: failed mysql connection

Clark

Could you also check that selinux is disabled?

On Feb 28, 2012, at 8:51 , Clark Cooper wrote:

> Yes, I'm able to make a connection from command line (using the password in the secrets file):
> 
> [root@rhel61 ~]# mysql -u vcluser -p
> Enter password: 
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 3
> Server version: 5.1.61 Source distribution
> 
> 
> I still get the connection error after making the suggested MySQL grant:
> 
> mysql> GRANT ALL ON vcl.* TO 'vcluser'@'localhost';
> Query OK, 0 rows affected (0.00 sec)
> 
> Thanks,
> Clark
> 
> 
> -----Original Message-----
> From: dchebota@gmu.edu [mailto:dchebota@gmu.edu]
> Sent: Monday, February 27, 2012 8:54 PM
> To: vcl-user@incubator.apache.org
> Subject: Re: failed mysql connection
> 
> Clark
> 
> Are you able to connect to mysql from command line on rhel61 host, 'mysql -u vcluser -p' ?
> Can you also try with GRAND ALL ON vcl.* TO 'vcluser'@localhost?
> 
> On Feb 27, 2012, at 16:36 , Clark Cooper wrote:
> 
>> Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:
>> 
>> 
>> Testing mysql connection ...
>> Error: fsockopen(): unable to connect to localhost:3306 (Permission
>> denied) Could not connect to port 3306 on localhost
>> 
>> 
>> For debugging purposes, I have stopped iptables.  Here is the connection information within my secrets.php file:
>> 
>> [root@rhel61 .ht-inc]# grep vcl secrets.php $vclhost = 'localhost'; # 
>> name of mysql server
>> $vcldb = 'vcl';         # name of mysql database
>> $vclusername = 'vcluser';      # username to access database
>> $vclpassword = 'vcluserpassword';      # password to access database
>> 
>> 
>> 
>> Note the following outputs from MySQL:
>> 
>> mysql> show grants for vcluser@localhost;
>> +----------------------------------------------------------------------------------------------------------------+
>> | Grants for vcluser@localhost                                                                                   |
>> +----------------------------------------------------------------------------------------------------------------+
>> | GRANT USAGE ON *.* TO 'vcluser'@'localhost' IDENTIFIED BY PASSWORD 
>> | '*BC54E34381D07EB1FF25938A2F524C17201FC22F' | GRANT SELECT, INSERT, 
>> | UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES ON `vcl`.* TO 
>> | 'vcluser'@'localhost' |
>> +----------------------------------------------------------------------------------------------------------------+
>> 2 rows in set (0.00 sec)
>> 
>> 
>> mysql> select host, user, password from mysql.user;
>> +-----------+---------+-------------------------------------------+
>> | host      | user    | password                                  |
>> +-----------+---------+-------------------------------------------+
>> | localhost | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
>> | 127.0.0.1 | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
>> | localhost | vcluser | *BC54E34381D07EB1FF25938A2F524C17201FC22F |
>> +-----------+---------+-------------------------------------------+
>> 
>> 
>> Clark Cooper | Senior Systems Engineer
>> 1301 Gervais Street, Suite 1800 | Columbia, SC 29201
>> (d) 803.978.2699 | (f) 803.733.5888
>> Clark.Cooper@VC3.com | www.VC3.com
>> Follow us: 
>> 
>> 
>> 
> 
> 
> 
> 
> Thank you.
> 
> -----------------
> Dmitri Chebotarov
> dchebota@gmu.edu
> 703-993-6175
> -----------------
> 
> 




Thank you.

-----------------
Dmitri Chebotarov
dchebota@gmu.edu
703-993-6175
-----------------



Re: failed mysql connection

Posted by Dmitri Chebotarov <dc...@gmu.edu>.
Clark

Could you also check that selinux is disabled?

On Feb 28, 2012, at 8:51 , Clark Cooper wrote:

> Yes, I'm able to make a connection from command line (using the password in the secrets file):
> 
> [root@rhel61 ~]# mysql -u vcluser -p
> Enter password: 
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 3
> Server version: 5.1.61 Source distribution
> 
> 
> I still get the connection error after making the suggested MySQL grant:
> 
> mysql> GRANT ALL ON vcl.* TO 'vcluser'@'localhost';
> Query OK, 0 rows affected (0.00 sec)
> 
> Thanks,
> Clark
> 
> 
> -----Original Message-----
> From: dchebota@gmu.edu [mailto:dchebota@gmu.edu] 
> Sent: Monday, February 27, 2012 8:54 PM
> To: vcl-user@incubator.apache.org
> Subject: Re: failed mysql connection
> 
> Clark
> 
> Are you able to connect to mysql from command line on rhel61 host, 'mysql -u vcluser -p' ?
> Can you also try with GRAND ALL ON vcl.* TO 'vcluser'@localhost?
> 
> On Feb 27, 2012, at 16:36 , Clark Cooper wrote:
> 
>> Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:
>> 
>> 
>> Testing mysql connection ...
>> Error: fsockopen(): unable to connect to localhost:3306 (Permission 
>> denied) Could not connect to port 3306 on localhost
>> 
>> 
>> For debugging purposes, I have stopped iptables.  Here is the connection information within my secrets.php file:
>> 
>> [root@rhel61 .ht-inc]# grep vcl secrets.php $vclhost = 'localhost'; # 
>> name of mysql server
>> $vcldb = 'vcl';         # name of mysql database
>> $vclusername = 'vcluser';      # username to access database
>> $vclpassword = 'vcluserpassword';      # password to access database
>> 
>> 
>> 
>> Note the following outputs from MySQL:
>> 
>> mysql> show grants for vcluser@localhost;
>> +----------------------------------------------------------------------------------------------------------------+
>> | Grants for vcluser@localhost                                                                                   |
>> +----------------------------------------------------------------------------------------------------------------+
>> | GRANT USAGE ON *.* TO 'vcluser'@'localhost' IDENTIFIED BY PASSWORD 
>> | '*BC54E34381D07EB1FF25938A2F524C17201FC22F' | GRANT SELECT, INSERT, 
>> | UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES ON `vcl`.* TO 
>> | 'vcluser'@'localhost' |
>> +----------------------------------------------------------------------------------------------------------------+
>> 2 rows in set (0.00 sec)
>> 
>> 
>> mysql> select host, user, password from mysql.user;
>> +-----------+---------+-------------------------------------------+
>> | host      | user    | password                                  |
>> +-----------+---------+-------------------------------------------+
>> | localhost | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
>> | 127.0.0.1 | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
>> | localhost | vcluser | *BC54E34381D07EB1FF25938A2F524C17201FC22F |
>> +-----------+---------+-------------------------------------------+
>> 
>> 
>> Clark Cooper | Senior Systems Engineer
>> 1301 Gervais Street, Suite 1800 | Columbia, SC 29201
>> (d) 803.978.2699 | (f) 803.733.5888
>> Clark.Cooper@VC3.com | www.VC3.com
>> Follow us: 
>> 
>> 
>> 
> 
> 
> 
> 
> Thank you.
> 
> -----------------
> Dmitri Chebotarov
> dchebota@gmu.edu
> 703-993-6175
> -----------------
> 
> 




Thank you.

-----------------
Dmitri Chebotarov
dchebota@gmu.edu
703-993-6175
-----------------



RE: failed mysql connection

Posted by Clark Cooper <Cl...@vc3.com>.
Yes, I'm able to make a connection from command line (using the password in the secrets file):

[root@rhel61 ~]# mysql -u vcluser -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.61 Source distribution


I still get the connection error after making the suggested MySQL grant:

mysql> GRANT ALL ON vcl.* TO 'vcluser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Thanks,
Clark


-----Original Message-----
From: dchebota@gmu.edu [mailto:dchebota@gmu.edu] 
Sent: Monday, February 27, 2012 8:54 PM
To: vcl-user@incubator.apache.org
Subject: Re: failed mysql connection

Clark

Are you able to connect to mysql from command line on rhel61 host, 'mysql -u vcluser -p' ?
Can you also try with GRAND ALL ON vcl.* TO 'vcluser'@localhost?

On Feb 27, 2012, at 16:36 , Clark Cooper wrote:

> Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:
> 
> 
> Testing mysql connection ...
> Error: fsockopen(): unable to connect to localhost:3306 (Permission 
> denied) Could not connect to port 3306 on localhost
> 
> 
> For debugging purposes, I have stopped iptables.  Here is the connection information within my secrets.php file:
> 
> [root@rhel61 .ht-inc]# grep vcl secrets.php $vclhost = 'localhost'; # 
> name of mysql server
> $vcldb = 'vcl';         # name of mysql database
> $vclusername = 'vcluser';      # username to access database
> $vclpassword = 'vcluserpassword';      # password to access database
> 
> 
> 
> Note the following outputs from MySQL:
> 
> mysql> show grants for vcluser@localhost;
> +----------------------------------------------------------------------------------------------------------------+
> | Grants for vcluser@localhost                                                                                   |
> +----------------------------------------------------------------------------------------------------------------+
> | GRANT USAGE ON *.* TO 'vcluser'@'localhost' IDENTIFIED BY PASSWORD 
> | '*BC54E34381D07EB1FF25938A2F524C17201FC22F' | GRANT SELECT, INSERT, 
> | UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES ON `vcl`.* TO 
> | 'vcluser'@'localhost' |
> +----------------------------------------------------------------------------------------------------------------+
> 2 rows in set (0.00 sec)
> 
> 
> mysql> select host, user, password from mysql.user;
> +-----------+---------+-------------------------------------------+
> | host      | user    | password                                  |
> +-----------+---------+-------------------------------------------+
> | localhost | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
> | 127.0.0.1 | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
> | localhost | vcluser | *BC54E34381D07EB1FF25938A2F524C17201FC22F |
> +-----------+---------+-------------------------------------------+
> 
> 
> Clark Cooper | Senior Systems Engineer
> 1301 Gervais Street, Suite 1800 | Columbia, SC 29201
> (d) 803.978.2699 | (f) 803.733.5888
> Clark.Cooper@VC3.com | www.VC3.com
> Follow us: 
> 
> 
> 




Thank you.

-----------------
Dmitri Chebotarov
dchebota@gmu.edu
703-993-6175
-----------------



Re: failed mysql connection

Posted by Dmitri Chebotarov <dc...@gmu.edu>.
Clark

Are you able to connect to mysql from command line on rhel61 host, 'mysql -u vcluser -p' ?
Can you also try with GRAND ALL ON vcl.* TO 'vcluser'@localhost?

On Feb 27, 2012, at 16:36 , Clark Cooper wrote:

> Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:
> 
> 
> Testing mysql connection ...
> Error: fsockopen(): unable to connect to localhost:3306 (Permission denied)
> Could not connect to port 3306 on localhost
> 
> 
> For debugging purposes, I have stopped iptables.  Here is the connection information within my secrets.php file:
> 
> [root@rhel61 .ht-inc]# grep vcl secrets.php 
> $vclhost = 'localhost'; # name of mysql server
> $vcldb = 'vcl';         # name of mysql database
> $vclusername = 'vcluser';      # username to access database
> $vclpassword = 'vcluserpassword';      # password to access database
> 
> 
> 
> Note the following outputs from MySQL:
> 
> mysql> show grants for vcluser@localhost;
> +----------------------------------------------------------------------------------------------------------------+
> | Grants for vcluser@localhost                                                                                   |
> +----------------------------------------------------------------------------------------------------------------+
> | GRANT USAGE ON *.* TO 'vcluser'@'localhost' IDENTIFIED BY PASSWORD '*BC54E34381D07EB1FF25938A2F524C17201FC22F' |
> | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES ON `vcl`.* TO 'vcluser'@'localhost' |
> +----------------------------------------------------------------------------------------------------------------+
> 2 rows in set (0.00 sec)
> 
> 
> mysql> select host, user, password from mysql.user;
> +-----------+---------+-------------------------------------------+
> | host      | user    | password                                  |
> +-----------+---------+-------------------------------------------+
> | localhost | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
> | 127.0.0.1 | root    | *A195277AB4567B2C3C4CDCAF6B5B48409EFE6765 |
> | localhost | vcluser | *BC54E34381D07EB1FF25938A2F524C17201FC22F |
> +-----------+---------+-------------------------------------------+
> 
> 
> Clark Cooper | Senior Systems Engineer
> 1301 Gervais Street, Suite 1800 | Columbia, SC 29201
> (d) 803.978.2699 | (f) 803.733.5888
> Clark.Cooper@VC3.com | www.VC3.com
> Follow us: 
> 
> 
> 




Thank you.

-----------------
Dmitri Chebotarov
dchebota@gmu.edu
703-993-6175
-----------------



Re: failed mysql connection

Posted by "Scott M. Sorrentino" <sm...@cornell.edu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Feb 27, 2012 at 09:36:51PM +0000, Clark Cooper wrote:
> Still trying to get VCL setup/configured and moving past the php-mcrypt issue, I also receive the following message within my testsetup.php output:
> 
> 
> Testing mysql connection ...
> Error: fsockopen(): unable to connect to localhost:3306 (Permission denied)
> Could not connect to port 3306 on localhost
> 

This might seem like a dumb question but do you have MySQL set up to listen 
on port 3306?  I've seen some installations that only enable the Unix domain
socket for safety reasons.

- -- 
Scott M. Sorrentino <sm...@cornell.edu>
CIT Systems & Operations, Cornell University
726 Rhodes Hall // (607) 254-8535
GnuPG fingerprint: 6E30 0B83 43F8 CF8B 3B44  7DBE 6AAE DFC9 1DE6 8C1C

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk9M3gMACgkQaq7fyR3mjByC4gCdEi/Ko/4DgrLb7jz9+pLQSpCK
1QoAn3MpbECUwxMaSSFpcdVeojTmCBnd
=3dT1
-----END PGP SIGNATURE-----