gem-in-eyez Posted April 10, 2006 Report Share Posted April 10, 2006 Having issues with trying to get my php commands to allow web browsers to access mysql server to retrieve and insert information. Basically I wrote some php code to access a hidden file, that in turns holds mysql connection params. These params are the host name, user, password and the db that the browser needs to connect to. The code is to first allow web browsers to establish a connection to my mysql DB on my box. once the browser establishes a connection it is supposed to verify a user and pass and then continue to process the rest of my code. basically this is a simple hit counter I created from a tutorial that is supposed to show the collected data on the web page. the code works fine when I use it on my laptop (XP using easyphp to enable and communicate with my apache and mysql). For both systems the users are the same and aswell as the passwords. Now in reality on my linux box when I run the browser I get an error telling that Fatal error: Call to undefined function: mysql_connect() in /var/www/html/main.php on line 74 Basically it cannot perform this function: $link = mysql_connect('localhost:3306', $db_user, $db_password); There already is another php file that holds the values for $db_user, $db_password in a hidden folder in my www root. The localhost part was swapped back and forth between the value of $db_host , localhost, & the full dns name for my box. I also tried using the port # too, to direct the connection to the mysql specific port and still unavailable to connect. Now since it does work with my laptop I know that the code is not the issue. I made sure that my router has the tunneling setting enabled. Used mysqladmin to even try to connect and it failed: telling me that my connection with modem(ISP IP) is not allowed. I then tried with mysqladmin to connect with my internal network ip for the sql server and it too tells me that I am not allowed to connect. how do i go about to allow a user to have remote access to mysql server? I tried various commands online and they do not work entirely and I cannot find a log specific to mysql in my box. I need to verify if the issue is connectivity to my box or to my mysql server. Thanks! Quote Link to comment Share on other sites More sharing options...
ddmcse Posted April 10, 2006 Report Share Posted April 10, 2006 (edited) network connectivity to mysql is disabled by default change the param in my.cnf # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # #skip-networking Edited April 10, 2006 by ddmcse Quote Link to comment Share on other sites More sharing options...
gem-in-eyez Posted April 10, 2006 Author Report Share Posted April 10, 2006 yeah i was reading that on a site but the thing is that I had to recreate my own my.cnf file. I doing so I took it from my-medium.cnf and renamed it. that got my web min to access the file for managing. however in that file there is no reference to skip-networking so i am at a lost on what to do from here on out. I tried messing around with variable but trying to create usr' with "php@"%" variables to try and set it and it still won't work. I tried to look in my logs but I cannot find any logs that shows any mentioning to ysql let along any connection attempts to the box. If I could do that atleast I guess I would be able to at least see if the connection is trying to be established... is that correct? Quote Link to comment Share on other sites More sharing options...
ddmcse Posted April 11, 2006 Report Share Posted April 11, 2006 cut out the middle-man and use a mysql connector type thing to plain old access the db over the net verifing that works and worry about the php later mysql has one or two that you can pop right in withan rpm and i know there are many others to use , the names aren't coming to me right now Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted April 11, 2006 Report Share Posted April 11, 2006 I normally use phpMyAdmin, works really well, and dead easy to install and get working. Quote Link to comment Share on other sites More sharing options...
Qchem Posted April 11, 2006 Report Share Posted April 11, 2006 I normally use phpMyAdmin, works really well, and dead easy to install and get working. I can echo that recommendation. Since I found it I don't use anything else. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.