Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Warning: Mysql_connect(): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2) In /home/custcare/dbconn.inc On Line 2


It's really strange. I downloaded the latest 4.0.16 RPM from mysql.com
and installed it to my Fedora system, and did *not* do anything else
(Actually I am completely new to mysql).

I wrote a test php script to test mysql (ftp_connect('localhost',
'root');), but got the following error:

Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2) in /home/custcare/dbconn.inc on line 2

I ran phpBB2 installation page, got the same error. But it can connect
to mysql using my computer name.




View Complete Forum Thread with Replies

Related Forum Messages:
Warning: Mysql_connect(): Can't Connect To Local MySQL Server Through Socket
A friend sent me a PHP script he uses to manage data. He wants me to do some minor changes on some of the tables. He sent the binaries , the database dump and the php files in a tar file. I set up a database for testing on my server. I ftp'd the php files to my server. When I try to access any of the php files I get this...


Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/m/e/n/menlo/html/pmtool/goremote/common/CommonLib.php on line 130
Failed to connect to the database ..!

Do I need to do something with the database dump?

View Replies !
Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
this is a new error message I've not encountered before. looking at the phpinfo data, it says mysql.max_links is "unlimited" I'm using mysql_connect (vs pconnect). When I try inserting mysql_close() in my functions, I get the :

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

View Replies !
PHP Warning: Mysql_connect(): Can't Connect To Local MySQL Server
PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/*****/public_html/mysqlconnection.php on line 2

whats this error mean?

View Replies !
Could Not Connect To MySQL: Can't Connect To Local MySQL Server Through Socket
To connect to a MySQL database, hosted on my machine, an iMAC G5 with OS 10.4, I am using the following code:

$dbc = mysql_connect ('localhost', 'guestuser', �')
OR die ('Could not connect to MySQL: '.mysql_error() );

However, I receive an error message: Could not connect to MySQL: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2). MySQL server is running, and user name/password are valid.

View Replies !
Connect To MySQL - Can't Connect To Local MySQL Server Through Socket
I've finished coding php, run it localhost and uploaded to my Apache server with Linux OS. However, I'm seemingly unable to connect to mysql at the server side. and received the following message: Could not connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock'(111) What's this message abt? I tried to get into MySQL without php on the server. and received the same message at the console.

View Replies !
Can't Connect To Local MySQL Server Through Socket
I created a test web form, that successfully input the data into my test database.  However, today I created a second form, added the layout code, putting the layout and mysql connection details into a php include code. 

These are the only changes I have made, apart from field names etc, but today, I get the following error message:

QuoteWarning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50

Warning: mysql_query(): A link to the server could not be established in /home/fhlinux177/f/further-flight.co.uk/user/htdocs/napsters/enter.php on line 50

Your nap has been added to the database. Good Luck!
I checked, but the nap hasn't been added to the database.

I use the code I found on phpmac.com.  It currently looks like this: Code:

View Replies !
Warning: Mysql_connect() [function.mysql-connect]: Lost Connection To MySQL Server
I've set up a test server on an Ubuntu system. I installed and configured Apache, PHP and MySQL however, whenever I try to connect to a MySQL database I get this error:
PHP Code:

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/index.php on line 8
Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Does anyone know what is causing this and how I can solve the problem?

View Replies !
Warning: Mysql_connect() [function.mysql-connect]: Unknown MySQL Server Host 'sql1bravehostcom'
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'sql1bravehostcom' (1) in /misc/13/000/126/295/2/user/web/jeppers90.com/includes/fiction_mysql.inc.php on line 11
Cannot connect to server

this message is what i get when i try to upload it to a webserver..things i have done set up database put in correct information from the database in to my php form. what ever i try i can't seem to set it up .

View Replies !
Error: Mysql_query(): Can't Connect To Local MySQL Server Through Socket
Any idea what it is:

mysql_query(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)

i am calling a function in another page using include at the top of the page to get a connection to the database Code:

View Replies !
Warning: Mysql_connect(): Can't Connect To MySQL Server On 'localhost' (10061)
i was coding a database script in php which uses mysql as backend, am not a newbie to either mysql or php, its been fun for years for me, but during my coding 5 mins before i just got

Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061)

I was not connected to internet so no chance of virus or so, niether any chance of configuration change issue by someone, how can this happen at once? i restarted machine but still the same. I am on a windows server.

View Replies !
Warning: Mysql_connect() [function.mysql-connect]:
i am haveing an issue connecting to a mysql database i get the following error

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /home/cutencud/public_html/testing.php on line 1

now testing.php only has one line and it looks like this

<?php mysql_connect("66.97.165.60", "root", "") ?>
anyone know what would cause that? (and i removed the password before posting

View Replies !
PHP Warning: Mysql_connect() [<a Href='function.mysql-connect'>function.mysql-connect</a>]
I am getting the following error

PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections in /usr/share/pear/adodb/drivers/adodb-mysql.inc.php on line 340

Can anyone tell me the possible reasons for this.

View Replies !
Warning: Mysql_connect() [function.mysql-connect]: Access Denied For
please anybody of u please help me to solve this problem. i don't know what happen.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'mysql_user'@'localhost' (using password: YES) in C:AppServwwwmangrovedatabase.php on line 2 Could not connect: Access denied for user 'mysql_user'@'localhost' (using password: YES)

View Replies !
Connection Failure (Can't Connect To MySQL Server Through Socket) (111)
I am receiving the message WARNING MySQL Connection failed: Can't connect to MySQL server through socket '/var/lib/mysql/mysql.sock' (111).

I have been following the script 'Setting Up Database Driven Websites' by Ying Zhang posted on this website and all was well up to the point of executing the index.php3. That is, MySQL is working and the <? echo "Hello World"; ?> script to verify that PHP is functional worked.

I did a global search on 'mysql.sock' and found only 1 which is in /tmp/mysql.sock. Based upon the date/timestamp it was either created or touched by the 'Hello World' script mentioned above. Software: Mandrake 6.0 (RedHat 6.0), MySQL 3.23.2, PHP 3.0.8, Apache 1.3.6.

I only installed MySQL, as PHP3 was already in Apache. After checking all the conf and ini files of which I am aware, I am at a loss as to a remedy.

View Replies !
Cannot Connect To The Mysql Server Using Php - Undefined Function Mysql_connect()
I'm surfing the net looking for answers but I thoguht I should post the question somewhere so I have something to fall back on. I am running:

Windows Xp SP2
apache2
php5
mysql4.x

The are all running fine from what I can tell. I have 1 problem, I cannot connect to the mysql server using php, it's giving me the error noted in the subject line. The error says the function is undefined but I assume it is in the .dll file that the php.ini file loads(php5apache2.dll for php to work on apache and php_mysql.dll loaded as an extension for php to talk to mysql). Everything loads fine, I don't get any errors when starting up apache, the phpinfo() page works perfectly, but it juts won't talk to mysql server.

View Replies !
Socket '/var/db/mysql/mysql.sock' (2)
I'm just uploading a site to a new hosting company, and i get this error
socket '/var/db/mysql/mysql.sock' (2)

I know my script is sound as it runs fine local and on my usual server, from googling it, it appears that it may be an problem server side, can anyone help?

View Replies !
Can't Connect To Local MySQL Server Through Socke
What does this mean. The code below is where its occuring:

Error retrieving records adam: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Code:

View Replies !
Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result Resource In /home/scaspco/public_html/testing/reviews.php On Line 41
I'm trying to outtput records from a mysql table and I get an error here

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/scaspco/public_html/testing/reviews.php on line 41
in

PHP Code:

<?php
$i = 0;
while ($result = mysql_fetch_array($query)) {
    if($i++ % 2) {
        $bgcolor = "category";
    } else {
        $bgcolor = "#DFE6EF";
    }
    print "<tr bgcolor="$bgcolor">";
    print "<TD>".$result['ASP_Name']."</TD>";
    print "<TD>".$result['Username']."</TD>";
...............

View Replies !
Warning: Mysql_fetch_row(): Supplied Argument Is Not A Valid MySQL Result Resource In /home/dyingtwi/public_html/functions/matchdb.php On Line 61
1: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dyingtwi/public_html/functions/matchdb.php on line 61

2: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dyingtwi/public_html/functions/playerdb.php on line 69

3: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dyingtwi/public_html/functions/teamdb.php on line 71

View Replies !
5 / MySQL Connect - '/tmp/mysql.sock'
I've installed php5 and phpMyAdmin (MySQL) via synaptics. Both seem to work fine on their own, but when running a php mysql_connect I get a socket error (see below). I have included as much information as think will be relevent. Code:

View Replies !
Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result Resource In /home/szauerne/public_html/sites/yourcapecoral/wizard/listings.php On Line 364.
PHP Code:

$number = mysql_query("SELECT * $housesTable WHERE house_id='".$select."'");
$row = mysql_fetch_array($number);

returns

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/szauerne/public_html/sites/yourcapecoral/wizard/listings.php on line 364.

View Replies !
Can't Connect To MySQL Via Mysql_connect();
I am running PHP 5.04, Apache 2, along with MySQL 4. I am trying to connect to my database using PHP Code:

<?php
        $conn = mysql_connect("localhost", "usrname", "passswrd");
        echo $conn;
?>

I guess this as a result: Code:

Fatal error: Call to undefined function mysql_connect() in F:WEBROOTpublicmainPHPPHPnMySQLListing16.1.php on line 15

All my other PHP scripts are working. This is my first time actually trying to get PHP to interact with MySQL.

View Replies !
Warning: MySQL Connection Failed: Can't Create IP Socket (10036)
I have a Problem with together MySQL, PHP3 and Apache-Server on Windows95. I run Apache-Server as Webserver, also on this machine runbs MySQLWIN32. Ihave written a simple PHP3 code as follows: Code:

View Replies !
Connection With MySQL. Navicat - CANNOT CONNECT TO MYSQL SERVER ON LOCALHOST
I am new in PHP & MYSQL. I installed PHP & MYSQL properly. To easy
operate for MYSQL I installed Navicat and it installed properly. But
when I am going to test the connection between MYSQL & Navicate the
error message showing CANNOT CONNECT TO MYSQL SERVER ON LOCALHOST
(10022) it should mention that my connection name = localhost, Ip =
localhost,port = 3306 , user name = root in Navicat.


View Replies !
How To Connect Remote Site - Can't Connect To MySQL Server
Lets say, i have two php sites named Site-A and Site-B. I want to use MySql
Datbase of Site-B for Site-A.

Generally i use :

$Host="localhost";
$User="username";
$Pass="password";
$DB="databse";
mysql_connect($Host,$User,$Pass);
mysql_select_bd($DB);

When i connect to Site-B database from Site-A what will be the $Host name?
I have tried with: $Host="www.mysite.com";

but it shows the warning:
Warning: mysql_connect(): Can't connect to MySQL server on....

View Replies !
Mysql_connect - Can't Connect To The Server
i have installed Apache 2.0.52 + mysql 5.0.16 + php-5.1.0 + phpMyAdmin 2.6.4-pl4 exactly how it is described at but i can't connect to the mysql server. for example this script that i wrote only prints "1" And thats why i think that i can't connect to the server

<?php
echo "1";
$db = mysql_connect("localhost");
echo "2";
.....
?>

View Replies !
Warning: Ereg_replace(): REG_BADRPT In /home/user/www/www/folder/file.php On Line 133
What is wrong with this line of code?

$picture1 = ereg_replace("+","", $picture1);
it returns

Warning: ereg_replace(): REG_BADRPT in /home/user/www/www/folder/file.php on line 133

View Replies !
Mysql - Error Warning Cant Connect To Localhost.
simple problem i cant seem to sort out.

i can login to mysql account through mydb studio windows program

but i try to login through php script

// Database Connection
$connect = mysql_connect("localhost", "root", "admin") or die(mysql_error());
mysql_select_db("databasename") or die (mysql_error());

i get error warning cant connect to localhost.


View Replies !
How To Use Multiplce MySQL Socket On A Single Web Server?
in the php.ini, i can't only config to use one mysql socket, but my
applications require connection to ultiple local mysql server, using
unix socket, listening different port

View Replies !
Warning: Session_start() [function.session-start]: Cannot Send Session Cache Limiter - Headers Already Sent (output Started At /home/user/public_html/index.php:8) In /home/user/public_html/nmdeluxe/index.php On Line 2
I'm having a problem with one of my files. I keep on getting the following error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/user/public_html/index.php:8) in /home/user/public_html/nmdeluxe/index.php on line 2

The second line of the nmdeluxe/index.php file has the session_start(); code. There aren't any spaces before the <?php line. The file is in ANSI form. I'm also including this file in one of my other files using PHP includes.

<? include("/home/user/public_html/nmdeluxe/index.php") ?>

The public_html/index.php has that code in it. The nmdeluxe/index.php does include itself into the public_html/index.php file, but I that error message appears at the top of the page. How can I fix this?

View Replies !
Php MySQL Works On Remote Server, Only Partially On Local Server
code to populate form select fields with data from a MySQL database, so a user
can use those to sort/filter and view the 3,000 records. No inserts --
just selects; very simple.

I originally set this up using URL-based query strings at
http://stjuliana.org/school/ar/BUindex.php but since that only allowed
sorting and not filtering, hence all 3k records load, I made a form
verson at http://stjuliana.org/school/ar/index.php . Everything works
just fine, however, there's still a lot of tweaking I want to do, such
as splitting the form input and output into two pages (_blank), having
a printable version, etc. To that end I just set up the latest builds
of Apache, php and MySQL on my local Windows XP box, lest I blow my
beer budget for the month on bandwidth overage. <g>

I have a very simple page I used to test my localhost setup and
everything's fine. I can connect to MySQL, create, insert and select
from DBs, so I know my config is fine. All my other .php pages on this
site work fine locally as well.

The two abovementioned pages, however, are giving me fits when run
locally...

For the URL-query-string version, it loads up with the default view
(=name_ns), which grabs all records and sorts by name and point asc.
No matter which of the other sort 'views' I might choose, it still
loads up all the records in that default sort. The server's holding on
to something and I don't know how to clear it. The remote version
correctly sorts based on the query string chosen.

The form version is worse. It connects to the DB and populates the
select boxes with the field data -- that part's fine. But no matter
which submit button is selected, no data is retrieved. I get no error,
but no data either. The form's action is set to $_SERVER['PHP_SELF']
and I've tried both GET and POST -- no change.

Since the exact same pages work on the remote server I know it has to
be something on the local setup. But where do I look if there's no
obvious error?

This is probably something incredibly basic but I'm bleary-eyed from
reading tutorials and forums all over the Internet and can't come up
with anything.

View Replies !
Warning: Session_start() [function.session-start]: Cannot Send Session Cookie - Headers Already Sent By (output Started At /home/comm/public_html/local_dynamic/br.php:6) In /home/comm/public_html/local_dynamic/br.php On Line 168
A visitor selects some options from a page and press the submit button,then the second page shows his selected options and there he fill his details and again press the submit button then the selected options with his details is stored in db

i have used sessions to move the data from one page to another.with localhost it is working good but when i upload the scripts to my site it is showing following warnings.how to overcome with this.

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/comm/public_html/local_dynamic/br.php:6) in /home/comm/public_html/local_dynamic/br.php on line 168

View Replies !
MySQL Connect Failure - Command Line
I have the following code

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

@ $db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

The first echo is executed but the second is not. I have ran the very same
parameters from the command line using:

mysql -h localhost -u Fred -p

Then

use house

and I connect to the house database.

I tried this in both IE 7 and Firefox with the same results.

View Replies !
Warning: Cannot Send Session Cookie - Headers Already Sent By (output Started At /home/hkia/public_html/09archive/list1.php:11) In /home/hkia/public_html/09archive/list1.php On Line 53
i add session_start() on the top of a php file, the first time i visit the page is ok, but when i visit it the second and after, the following error is output. what should i do for that?? Quote:

Warning: Cannot send session cookie - headers already sent by (output started at /home/hkia/public_html/09archive/list1.php:11) in /home/hkia/public_html/09archive/list1.php on line 53

Warning: Cannot send session cache limiter - headers already sent (output started at /home/hkia/public_html/09archive/list1.php:11) in /home/hkia/public_html/09archive/list1.php on line 53

View Replies !
Mail(): ' Warning: Failed To Connect In ... On Line ...'
I'm a newbie using PHP4 and Apache 1.3 on Win98.

When I launch a script just having this instruction:

mail ("test.address@example.com", "My Subject", "My message");

I got this annoying message:

Warning: Failed to Connect in myscript.php on line ...

Of course the e-mail address provided is a real one; I have also
changed in the following way the values in php.ini file :

SMTP=localhost;
sendmail_from=my.real.address@my.provider.com

Do you have any hints or suggestions ?

View Replies !
Warning: Mysql_connect(): Access Denied For User 'ODBC'@'localhost' (using Password: YES) In C:Program FilesApache GroupApache2htdocsExercisesDBTest.php On Line 1
I have this error when i try to load my php file which reads a database. I only have a password setting for mySQL database.Although i have supplied the correct password, this error appears in the page.

Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: YES) in C:Program FilesApache GroupApache2htdocsExercisesDBTest.php on line 1

View Replies !
Warning: Failed To Connect In E:_3000_Php4projectxt_Compose.php4 On Line 2
I'm using PHP4.0 with IIS and i'm trying to send a mail.
The code is as follows

mail("me@domain.com","subject","message");

then the error comes as follows:

Warning: Failed to Connect in E:_3000_Php4projectxt_Compose.php4 on line 2

View Replies !
Transferring A MySQL Database From Local PC Onto An ISP Server
If I have an MySQL database on my local w2k, how do I transfer it onto my
ISP server?
The ISP gave me the name of an empty MySQL database they set up for me, the
username and the password with no further explanations.
I came here from ASP/Access where I was just uploading a mdb file into my
webspace.
But with MySQL there should be a different procedure,

View Replies !
Using PHP To Connect To MYSQL Server
I am new to PHP and MYSQL. I recently installed both PHP and MYSQL (the community edition) on my computer and I have been trying to use PHP to connect to and access MYSQL (instead of using the MYSQL command line).

I used the mysql_connect() function on a test script but I am getting the following error message when I test the script.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ' '@'localhost' (using password: YES) in filename on line 10.

I understand that I am being denied access because I have not submitted the right credentials. However, I am testing this code on my local computer where I have full privileges. What might be the reasons I am getting this message? What are the possible solutions? Do I need to configure mysql such that it recognizes that I am using it on a local computer?

View Replies !
Can't Connect To MySQL Server
I am getting this error, while try to connect to mysql, what might be the problem, I tried to download other version, all are giving me the same error.

ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

How can I correct it?

View Replies !
Connect To MySql Server
I have MySQL database in my web server. Now I have to create a form (in my website)to allow user enter data and then the data will be store in the MySQL database. In the same website, the data in the database will be display out for other user.

Can I know, how to connect my website to the database when user enter their data? Any guide or example? Any tutorial?

View Replies !
Connect With The MySQL From A Different Server
I need connect with the MySQL from a different server, if tried everything and it's still not letting me, through cpanel I allowed the host to access the mysql, and I'm trying to connect like this:

mysql_connect("11.111.1.111", "username", "password");

it's returning the error:

"Warning: mysql_connect(): Lost connection to MySQL server during query in /home/awesomea/public_html/csp.php on line 6" iv'e also tried connecting to ports: 11.111.1.111:3306 and its returning the same error.

View Replies !
Mysql.sock Question
This is a mysql/php question (but a little more on the mysql side.)
The two are so closely related these days, I thought it would be ok to
ask here.

I installed on my Suse Linux system mysql 4.0 using an rpm. I also
installed all of the appropriate PHP 4.3 and Apache 2.0 rpms.

I set my socket path in my.cnf to /tmp/mysql.sock.
I then, just to be safe and thorough, copied this my.cnf to ~/.my.cnf
and to the /var/lib/mysql directory with my databases (basically
everywhere it might be looked for).

If I sign into mysql under my root account, I get in fine.
If I sign in under any other account, it gives me the error that it
cannot open /var/lib/mysql/mysql.sock. I don't know why it would
think to use this path since I have changed reference to it in my.cnf
and placed my.cnf everywhere.

I grepped through my entire system for any other mention of this path
since I had already fixed my.cnf which should have been enough. I
found reference to it in /init.d/mysql and rc.d/mysql. I don't know
why these files exist, but I fixed to /tmp/mysql.sock here too.

Also references where found within the rpm binaries I installed from.

My question: Is it possible that the MySQL binary I installed via rpm
is tainted in such a way that it tries to create
/var/lib/mysql/mysql.sock, even overriding the direction I gave in
my.cnf? Could it be hardwired into the executable mysql binary? Not
only did I fix my.cnf, but I fixed all references to
/var/lib/mysql/mysql.sock to /tmp/mysql.sock in every text file in the
system and rebooted and still had the same problem!

It is frustrating, but PHP gives me a work-around to make it possible
for me to still write php-mysql code. I do
mysql_connect("127.0.0.1:/tmp/mysql","user","password");
which works and apparently was added to PHP somewhere in version 3. (I
mean support for specifying the socket path).

2nd Question: Is there any solution other than removing mysql as
installed by rpm and re-installing actual mysql binary from mysql.com?

It's so frustrating when the program promises to look in my.cnf and
ignores what I have put in there (unless I am root).

View Replies !
Cannot Make Connection To Local MySQL Server From Within Dreamweaver.
I am using OS X and Dreamweaver MX. I am trying to make a connection
to the MySQL Server from within Dreamweaver using the Applications
panel and clicking on the "+". A window opens asking for:
Connection Name: Apress
MySQL Server: localhost
User Name: apress
Password: xxxxxx
Database (Select):
When I click select so the Dreamweaver can browse to the databases in
MySQL the connection is not being made because Dreamweaver cannot find
the MySQL Server. I think that "localhost" is wrong even though I am
using the APRESS book: PHP Dreamweaver MX 2004 and it says to use
localhost. MySQL and PHP are on my local machine. I am NOT using a
remote machine. I used phpMyAdmin to create the databases.

View Replies !
Can't Connect To Remote MySQL Server Using PHP
i am trying to connect to a remote mysql server through php. Here's the
code:

mysql_connect("my.hostname.edu", "username", "password") or die
(mysql_error());
mysql_select_db("db_name") or die ("unable to select
db".mysql_error());
$r1 = mysql_query('SELECT * FROM table') ;

Using the mysql prompt on the remote server, the mysql -h -u -p works
just fine with the parameters i've specified here. According to the
user table I have the proper permissions. I just can't figure out what
could be preventing the connection here, although I am no expert...can
anyone help?!

BTW, I am using PHP 4.4.1 and mysql 5.0.

View Replies !
Connect To Remote MySQL Server
I have a fully functional page hosted on my PC that uses PHP and
connects to MySQL on my PC to generate it's code.

I now have some web hosting available which includes both PHP and MySQL
support, however the webhost is still in the process of getting the
MySQL support activated and functional.

I therefore have uploaded my webpage to the host and edited the webpage
code to access the MySQL server on my home PC - once the host gets
MySQL working then the webpage will of course use the MySQL that my
host will provide.

The original code in my webpage to connect to MySQL is:

$panorama_database=mysql_connect(localhost,$userna me,$password) or
mysql_fail("Unable to connect to MySQL database.");

I have edited this to:

$panorama_database=mysql_connect(ļ.207.???.???: 3306',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

(My IP masked by ?).
And it's works no problems - however i have a dynamic IP address and
wish to replace the hardcoded IP address with an alias from
www.no-ip.com.

So i tried both:

$panorama_database=mysql_connect('http://mynoipalias.no-ip.org:3306',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

and (with no port specified):

$panorama_database=mysql_connect('http://mynoipalias.no-ip.org',$username,$password)
or mysql_fail("Unable to connect to MySQL database.");

Both attempts to use my www.no-ip.com alias fail and i'm not sure where
to look for logs to debug the problem.

View Replies !
Cannot Connect To MySQL Server Using PHP On Localhost
I have set up MySQL on my home computer, and I am writing a PHP enabled web
site to run queries on this database.

I have created a database called 'weather' on mysql that I want to access
via my website.

I have also created a user with a password (this isn't the real one, but
I'll use this to illustrate my point)
User: carlotam
Password: blah
Host: localhost

To which user I have granted all on database weather.

Using a PHP call: I try:

$username="carlotam";
$password="blah";
$database="weather";
$host="localhost";

$var = $_POST['topic'];

echo "<center><h1>ESCape Database Query</h1></center>";
echo "You have queried <b>$var</b><br><br>";
echo "Your database is: <b>$database</b>.<br>";
echo "Your username is: <b>$username</b>.<br><br>";

mysql_connect($host, $username, $password);
@mysql_select_db($database) or die("Unable to select database
<b>$database</b> on <b>$host</b>.");
mysql_close();

And I keep getting the message "Unable to select database weather on
localhost."

Is there something wrong with the above, or is there something wrong with my
MySQL server configuration? My server is up and running, so I was wondering
if anybody can help with this problem?

If this information helps: I am running MySQL 5.0.15 server on a PowerMac G4
laptop. And yes, I did check to see if the server was running before I
checked the code.

View Replies !
Cannot Connect To Remote MySQL Server
Ok, I have done this MANY times before without a problem - so I don't know WHY this isn't working!

I am in the process of moving to a new server - so I am updating my mysql_connect statement to use our NEW server instead of the current one (@ localhost).

I went into MySQL on the NEW server an added two new users - same username - one for the domain name of our current/old server and one for the IP address of our current/old server ... and gave the users the appropriate rights. I then updated my "mysql_connect" statement to point to the NEW server... but I get the following error:

View Replies !
Connect To Mysql Through Proxy Server
How exactly would I set up a connecton to mysql in php, but through a proxy server and a port #.   

proxy.shr.secureserver.net   on port 3128

I have no idea where to start, so Here's my code:

View Replies !
Connecting To MySQL With Alternate Sock
I have taken a look around and haven't found an answer suitable for me. I need to connect to a MySQL db through an alternate sock file. I can not edit any php config files like php.ini. I tried the following just hoping it would work...but it didn't. Code:

View Replies !
How To Automatically Upload Data From Mysql Database Local Server To Web
Please any one help me to provide php code to automatically upload data from mysql database local server to web mysql database.

View Replies !
Myphpadmin - Can't Connect To MySQL Server On 'localhost'
MySQL said:

#2003 - Can't connect to MySQL server on 'localhost' (10061)

I try to config it on my server because I don't wanna use phpdev
so can any help?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved