-
Aug 19, 2003, 09:46 AM
#1
MySQL connectivity
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 25
Converted an ASP to PHP using ASP2PHP however I am getting the above error. I am not sure as to how to setup mysql, however I have it installed. Is that all that is necessary?
What is the equivalent to the following connection?
$strSource="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=".$strDBLocation;
I am using apache on linux 9.0
-
Aug 19, 2003, 11:08 AM
#2
Re:MySQL connectivity
[quote author=Weird_O link=board=22;threadid=1606;start=0#msg15324 date=1061304413]
What is the equivalent to the following connection?
$strSource="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=".$strDBLocation;
[/quote]
Use these functions in the given order:
mysql_connect('<server>', '<user>', '[password]'
mysql_select_db('<database_name>'
If you haven't configured MySQL since it's initial install, then username "root" with a blank password will exist. Or is it username: "root", password: "root"? hmmm....one of the above will work.
P.S. you may also use "mysql_pconnect()" to make a persistent connection to the database. This is useful if you plan to make multiple calls to the server on one page.
-
Aug 25, 2003, 05:14 PM
#3
Re:MySQL connectivity
I have made the replacement however I still have the following errors.
Warning: Can't connect to MySQL server on '172.17.21.125' (111) in /var/www/html/directory/byname.php on line 15
Warning: MySQL Connection Failed: Can't connect to MySQL server on '172.17.21.125' (111) in /var/www/html/directory/byname.php on line 15
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 16
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/directory/byname.php on line 16
Warning: MySQL: A link to the server could not be established in /var/www/html/directory/byname.php on line 16
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/directory/byname.php on line 39
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/directory/byname.php on line 40
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/html/directory/byname.php on line 47
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/directory/byname.php on line 48
-
Aug 26, 2003, 08:39 AM
#4
Re:MySQL connectivity
Is the IP address [172.17.21.125] hard coded in your script ? Is this a relevant address?
Should the 'server' be "localhost" in this case ?
-
Aug 26, 2003, 09:46 AM
#5
Re:MySQL connectivity
The IP address is not hard coded in the script, however it is the correct address.
I don't know waht it should be... ???
-
Aug 26, 2003, 02:42 PM
#6
Re:MySQL connectivity
What is the IP address in reference to ?
-
Aug 28, 2003, 04:27 PM
#7
Re:MySQL connectivity
Sorry about the trouble Stan, I substituted server with localhost alone with a host of other things. However the real problem was that Mysql was not staying up when it started. I had to uninstall the package and re-install, got it work.
Thanx for the help guys.
-
Aug 29, 2003, 09:49 AM
#8
Re:MySQL connectivity
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules