Re: Php with MySQL replication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* "David Brinks" <brinks@xxxxxxxxxxxxx>:
> I seem to be having a problem when using php with a replicated database and
> the replicated database not being updated correctly.  I have verified that
> replication in general works.  When transactions are entered through either
> a perl script or through console, the replicated client receives the updates
> almost instantly.  When a transaction goes through php, on the other hand,
> the master database will be updated but the master does not seem to send the
> update to the replicated client.
>
> Mysql version are both 4.0.18.
> Mod_php4-4.3.7 is the php code.
>
> Sample from php script...
>
> $conn = mysql_connect($Server, $User, $Pass);
> $sql = "INSERT INTO test.database VALUE ('','hello')";
> $result = mysql_query($sql,$conn);
> $closed = Mysql_close($conn);
>
> If anyone has any suggestions, I would appreciate it.

PHP is writing to the database just as any other mysql client, so there
should be no difference. The only thing I can think of that would cause
the behaviour you're seeing is if PHP were writing to a different
server, or if the slave server had stopped or did not have permissions
to read from the master server. Are you absolutely certain that PHP is
connecting to the master db server when performing the write operation?

-- 
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux