ericp502 Posted April 4, 2008 Posted April 4, 2008 Ok...installing Oscommerce 2.2 RC2A on CentOS 5.1. The MySQL server is on a seperate server and is setup correctly. Using the commandline mysql client I can connect to the remote database using the same authentication and host information as I'm putting into the oscommerce step 2. In the server capabilities all green checkmarks. When I input the DB info I get the error message: **************************** There was a problem connecting to the database server. The following error had occured: Can't connect to MySQL server on 'IP ADDRESS' (13) **************************** I've tried using both the IP address of the Mysql server and the hostname that is configured in the /etc/hosts file with the same error. I've run tcpdump on the oscommerce webserver itself and its never even attempting to make a connection to the DB server. When you click on the "Continue" button the install.php code passes the authentication and host information for the DB to a piece of code called rpc.php. I've run that code manually with the correct DB information and it does not even attempt to make the remote connection. /oscommerce2/catalog/install/rpc.php?action=dbCheck&server=IPADDRESS&username=USERNAME&password=PASSWORD&name=DBNAME Just for testing purposes I installed a local Mysql server and oscommerce connected to the local system just fine. Looking like this is either a php-mysql issue or a issue with a default setting in php.ini. Anyone else seen this issue? The webserver and DB server must be on seperate systems with a hardware FW between them or you cannot obtain PCI compliance. I've attempted to change the settings within the configure.php code to point to the remote DB but then you just get a error saying it could not connect to the DB. Any suggestions would be appreciate as it looks like this is a code issue. I've seen this issue posted a couple times in the forums but everyone just says to use a DB on the localhost of the webserver. This is not the correct way to fix this issue.
Guest Posted April 4, 2008 Posted April 4, 2008 this should work. what kind of properties does the user have to connect to the remote database? full priviledges or did you lower them?
ericp502 Posted April 4, 2008 Author Posted April 4, 2008 this should work. what kind of properties does the user have to connect to the remote database? full priviledges or did you lower them? Full priviledges on the database. It never even attempts to make a DB connection though. The webserver never sends a single network packet to the DB server. Nothing. Not a single packet. Even if it was a DB issue I'd still see the network connection going out to even attempt a DB connection.
Guest Posted April 4, 2008 Posted April 4, 2008 have you tried mysql admin from a remote computer (local windwos) to connect to the db the same way? if this doesnt connect, then you know it is access problems on the destination server, perhaps not all settings correct.
ericp502 Posted April 4, 2008 Author Posted April 4, 2008 have you tried mysql admin from a remote computer (local windwos) to connect to the db the same way? if this doesnt connect, then you know it is access problems on the destination server, perhaps not all settings correct. Yep "Using the commandline mysql client I can connect to the remote database using the same authentication and host information as I'm putting into the oscommerce step 2." From the webserver I can use the mysql command line tool to connect to the DB server with the oscommerce database. The user I'm connecting with has full privileges on the DB. None of this actually matters though because the oscommerce webserver never actually attempts any type of connection with the DB server. Even if there was a permission issue on the DB server how would the webserver know if it never makes an attempt to connect?
Guest Posted April 4, 2008 Posted April 4, 2008 not sure what is going on. if you want to create a dummy database with a user and password and then send to me in pm i can see if i can connect via here.
ericp502 Posted April 4, 2008 Author Posted April 4, 2008 not sure what is going on. if you want to create a dummy database with a user and password and then send to me in pm i can see if i can connect via here. Ok guys...this is now figured out. Its selinux not allowing apache to make remote connections. You can disable this selinux feature by: /usr/sbin/setsebool -P httpd_can_network_connect=1 I think more than a few people are having this same problem. I've seen multiple people with this same problem and their solution has always been to just run the DB server on the localhost. You do not want to do this. You can not be PCI complaint and it is not a secure solution to have your public facing application and your database that contains critical or sensitive data on the same system.
ericp502 Posted April 4, 2008 Author Posted April 4, 2008 not sure what is going on. if you want to create a dummy database with a user and password and then send to me in pm i can see if i can connect via here. Oh..and Mibble thanks for the offer to help. I'm sure I'll take you up on that in the future. :)
dj-nijo Posted June 22, 2010 Posted June 22, 2010 Ok guys...this is now figured out. Its selinux not allowing apache to make remote connections. You can disable this selinux feature by: /usr/sbin/setsebool -P httpd_can_network_connect=1 I think more than a few people are having this same problem. I've seen multiple people with this same problem and their solution has always been to just run the DB server on the localhost. You do not want to do this. You can not be PCI complaint and it is not a secure solution to have your public facing application and your database that contains critical or sensitive data on the same system. hi.. my oscommerce is on ISP server with php support and the mysql server is on remote server, i can connect the mysql server with mysqladmin, but not with oscommerce.. and i cannot run that command, i get this error when i try to connect my mysql server: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'server_address' (1) in /where/is/the/catalog/includes/functions/database.php on line 19 Unable to connect to database server! is there anything that i can do to get my catalog to work?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.