Re: replication blues

2003-08-18 Thread Primaria Falticeni SDU
I meant that the solution is to put master_connect_retry=2.

When I met this problem, to solve it, I did  :
1.stop the slave thread;
2.save the table from the master;
3.drop the table on master;
4.drop the table on slave;
5.reset the master and slave;
6.set master_connect_retry=2;
7.start the slave thread;
8. create the table on master from the saved one.

In this way the master and the slave will communicate in better way, so the
changes from the master will be instantly replicated.


- Original Message -
From: Victoria Reznichenko [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:04 PM
Subject: Re: replication blues


 Primaria Falticeni SDU [EMAIL PROTECTED] wrote:
  I met the same problem

 Problem with auto_increment column?
 If so I wasn't able to repeat it with master_connect_retry=2.

 and I noticed that you need, on the slave, set
  connect_retry to 2 (connect_retry is the time after which the slave
retries
  to connect to master).
  It's a replication problem met by me on MySQL 4.0.14 on Linux Red Hat 9.
 
  I manually managed the replication conflicts until then. I mean
conflicts
  from the late of the update slave - master.
 
  Iulian
  - Original Message -
  From: Victoria Reznichenko [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, August 12, 2003 9:49 PM
  Subject: Re: replication blues
 
 
  Bogdan TARU [EMAIL PROTECTED] wrote:
   And data is inserted into it with simple inserts, w/o specifing the
id
   (it's autoincrementing).
  
   With a little debugging, I have located the problem. If I run 'alter
   table xxx auto_increment=1' on both the master and the slave (this
table
   is empty at the time on both machines), and then I insert datas into
the
   master, they look like:
  
   On master:
  
  
 
+++--+++--+---+-
  ---+
   |  1 |  3 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  2 |  4 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  3 |  5 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  4 |  6 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  5 | 13 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  6 | 14 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  7 | 18 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  8 | 19 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   |  9 | 20 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 10 | 21 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
  
+++--+++--+--++
  
   But on slave it looks like:
  
  
+++--+++--+--++
   | id | dialer | uid  | action | acc_no | template | name | status
|
  
+++--+++--+--++
   | 10 |  3 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 11 |  4 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 12 |  5 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 13 |  6 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 14 | 13 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 15 | 14 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 16 | 18 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 17 | 19 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 18 | 20 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
   | 19 | 21 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY
|
  
+++--+++--+--++
  
  
   Why does it start on the id=10 on the slave? Of course, this is the
   cause for the replication failures later on, because datas are
deleted
  on
   the master with 'delete from xxx where id=3', for example, action
which
   doesn't delete anything on the slave (because there is no id=3
entry),
   thus inconsistency.
  
   I'm using 4.0.13 on both machines.


 --
 For technical support contracts, goto https://order.mysql.com/?ref=ensita
 This email is sponsored by Ensita.net http://www.ensita.net/
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
 /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
___/   www.mysql.com





 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Server to Server Connection

2003-08-18 Thread Primaria Falticeni SDU
You have selected my_database as database. What about the table? Put some of
your code to clarify the problem. It's a PHP matter.

Iulian
- Original Message -
From: Thomas Deliduka [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 18, 2003 5:14 PM
Subject: Server to Server Connection


 I have written this to the PHP-DB list and couldn't get any answers.  I
have
 gone through all the documentation I could find. I have been everywhere
and
 cannot find an answer to this problem!  Perhaps someone on this list can
 lend me some insight?!

 I think, at heart, the problem is with MySQL permissions or some way 4.0
 handles connections across a network, however I just cannot figure it out.

 I'm using PHP 4.3.2+MySQL 4.0.14 on server 1
 Server 1, however, is connecting to Server 2 which has MySQL 4.0.12

 I have permissions on the 4.0.12 server setup like:
 user:
 localhostuser1 all main privs are 'N' except for File_priv
 192.168.1.% user1 all main privs are 'N' except for File_priv
 (internal SAN).

 db:
 %user11 my_database all main privs set to Y (select,
 insert,update, delete, create, drop, references, index, alter)

 If I use the command-line interface from server 1 to server 2 it works
 perfectly fine.

 I'm using PHP connection to do code like:

 $conn = mysql_connect(192.168.1.2,user1,pass);
 mysql_select_db(my_database,$conn);

 mysql_select_db returns true.

 My queries are like:
 mysql_query($sql,$conn);
 So I'm using the proper connection.

 The webpage mysql_error outputs select command denied to user:
 '[EMAIL PROTECTED]' for table 'table_name'

 For every table. And I wonder what the heck is this for because the select
 priv is on for that table in the 'db' table.

 So, what I did was change the 'user' table with select_priv to Y which
 basically make this user a super-user for every table. After doing this I
 get these errors:

 Table 'another_database.table_name' doesn't exist.

 I didn't select another_database as my table! I selected my_database as my
 table!  Why the heck is it selecting the wrong table?!

 So, I added a ton of bebugging code.  I confirmed that just before calling
 mysql_select_db() I had the right table in the variable.  I confirmed I'm
 only making one database connection, not two.  I confirmed that this user
 has no permissions for another_database with that user/pass.  I confirmed
 the same Reference ID for $conn. Is being used in every case.

 I know the reason I'm getting the initial select command denied error is
 because it's still selecting another_database for the table and I don't
have
 permissions for that unless I add it for super-user like I did.

 A work around (which will not work once I get this site in production) is
to
 do a search/replace on the SQL strings and add my_database. to every
 database table. Once the SQL command becomes select xxx from
 my_database.table_name it works fine but this is not what I can do in the
 end.  What the heck could be the problem?!  Why doesn't PHP select the
right
 table?!

 This problem happens with persistant or non-persistant connections.

 Oh, and another site using the same code and the same PHP install (same
 server1) but connecting to a 3.23.xx database works perfectly fine. Just
to
 throw a wrench in the works.

 I've been through all of the mysql docs can't find a thing.  Do you guys
 know where I'm going wrong?

 --

 Thomas Deliduka
 IT Manager
  -
 Xenocast
 Street Smart Media Solutions
 http://www.xenocast.com/



 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Server to Server Connection

2003-08-18 Thread Primaria Falticeni SDU

Your PHP code for the server 1 is not the same with the code for the server
2 or the names of the tables from MySQL server 1 are not the same with the
value of your PHP queries.

Put the first PHP not-working query in the command-line for server 1 and see
if it works.

Put here the PHP code for the first not-working query.
Add, also, the real names of the MySQL tables used in your lines.

Iulian
- Original Message -
From: Thomas Deliduka [EMAIL PROTECTED]
To: m a b [EMAIL PROTECTED]
Sent: Monday, August 18, 2003 5:47 PM
Subject: Re: Server to Server Connection


 The table is in the SQL statement. Select * from table_name   If you
 really want my code it's very long. I will paste in the stuff that's
 relevant. It's at the bottom.

 If it's a PHP matter why does the same code connecting to a 3.23 server
work
 perfectly fine.  This same EXACT code works perfectly with the site that
is
 on server 2 (i.e. connecting via localhost NOT server to server).

 My code:
 --
 /* This is the code to connect to the database.  $dh: host, $du: user,
$dp:
 password, $db: database.   Adding debug code showed all information that I
 wanted to pass was correctly passed.  */
 if ($config['pconn'] == 1) {
 $conn = @mysql_pconnect($dh,$du,$dp);
 } else {
 $conn = @mysql_connect($dh,$du,$dp);
 }
 if (!$conn) {
 echo FATAL ERROR: No connection to database.BR;
 $error = FATAL ERROR: No connection to database.BR\nError:  .
 mysql_error() . \nUsed:\n  host:  . $dh . \n  user:  . $dp . \n
pass:
  . $dp;
 emailadmin($error);
 exit;
 } else {
 $dbs = @mysql_select_db($db, $conn);
 if (!$dbs) {
 echo FATAL ERROR: Could not select database.BR;
 $error = FATAL ERROR: Could not select database.BR\nError:

 . mysql_error() . \nUsed:\n  host:  . $dh . \n  user:  . $du . \n
 pass:  . $dp;
 emailadmin($error);
 exit;
 } else {
 return $conn;
 }
 }
 }

 /*function for performing the mysql_query() You will notice the commented
 out line there, that is the work-around that I employed to force the
 database name for all the tables (my application uses the xno_ prefix for
 all tables)  I should not have to do that. */

 function db_query($query, $dconn = false) {
 global $conn, $config;
 if (!$conn) { // if connection isn't there, connect to db
 $conn = db_connect($config);
 }
 if (!$dconn) $dconn = $conn;  file://if $dconn is false (not using a
   file://different connection) then set
it.

 file://$query = str_replace(xno_,$config[dbname]..xno_,$query);
 $ret = @mysql_query($query, $dconn);
 echo db_error(0).br;  file://my debug code.
 return $ret;
 }




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Server to Server Connection

2003-08-18 Thread Primaria Falticeni SDU
Oh, I see now!

When you gave the command mysql ... my_database, at the moment of the MySQL
shell, you have the database my_database already selected. So all of your
queries works fine because you are in the right database.
In the PHP or other environment, you need to select the database after
connecting and before query.So follow the order:
1. connection with $conn = @mysql_connect($dh,$du,$dp);
2. selecting the database with mysql_select_db(my_database,$conn);
3. performing query $result=db_query($sql);

If you get an error in this step, it's not a PHP/Web matter.

If all works fine, you can use :

mysql_select_db($db,$conn);

in place of

mysql_select_db(my_database,$conn);



If you get an error in the last step, the value of $db is wrong, so check
the webpage which sends the value to $db.



Iulian




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqld_multi don't starts groups on Linux RedHat 9

2003-08-14 Thread Primaria Falticeni SDU
 Hello,

 mysqld_multi doesn't start the two groups if I gave this command imediately
 after stopping them. It will start only one group.
I'm working on Linux RedHat 9 MySQL 4.0.14.
How can I solve this problem, please?

 Thanks Anticipated,
 Iulian



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqld_multi don't starts groups on Linux RedHat 9

2003-08-14 Thread Primaria Falticeni SDU
  Hello,

  mysqld_multi doesn't start the two groups from my.cnf if I give the start
command immediately   after stopping them.

 How can I safely start the groups with mysqld_multi anytime (including
immediately after stopping them)?


  Thanks Anticipated,
  Iulian




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqld_multi don't starts groups on Linux RedHat 9

2003-08-14 Thread Primaria Falticeni SDU

 Hello,

 mysqld_multi doesn't start the two groups if I gave this command imediately
 after stopping them.


 Thanks Anticipated,
 Iulian



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: replication blues

2003-08-14 Thread Primaria Falticeni SDU
I met the same problem and I noticed that you need, on the slave, set
connect_retry to 2 (connect_retry is the time after which the slave retries
to connect to master).
It's a replication problem met by me on MySQL 4.0.14 on Linux Red Hat 9.

I manually managed the replication conflicts until then. I mean conflicts
from the late of the update slave - master.

Iulian
- Original Message -
From: Victoria Reznichenko [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 9:49 PM
Subject: Re: replication blues


 Bogdan TARU [EMAIL PROTECTED] wrote:
  And data is inserted into it with simple inserts, w/o specifing the id
  (it's autoincrementing).
 
  With a little debugging, I have located the problem. If I run 'alter
  table xxx auto_increment=1' on both the master and the slave (this table
  is empty at the time on both machines), and then I insert datas into the
  master, they look like:
 
  On master:
 
 
+++--+++--+---+-
---+
  |  1 |  3 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  2 |  4 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  3 |  5 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  4 |  6 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  5 | 13 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  6 | 14 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  7 | 18 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  8 | 19 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  |  9 | 20 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 10 | 21 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  +++--+++--+--++
 
  But on slave it looks like:
 
  +++--+++--+--++
  | id | dialer | uid  | action | acc_no | template | name | status |
  +++--+++--+--++
  | 10 |  3 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 11 |  4 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 12 |  5 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 13 |  6 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 14 | 13 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 15 | 14 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 16 | 18 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 17 | 19 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 18 | 20 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  | 19 | 21 | 1007 | REGENERATE |   NULL | NULL | NULL | OKAY   |
  +++--+++--+--++
 
 
  Why does it start on the id=10 on the slave? Of course, this is the
  cause for the replication failures later on, because datas are deleted
on
  the master with 'delete from xxx where id=3', for example, action which
  doesn't delete anything on the slave (because there is no id=3 entry),
  thus inconsistency.
 
  I'm using 4.0.13 on both machines.

 I wasn't able to repeat it on 4.0.14. Could you provide a test case? What
replication options do you use?


 --
 For technical support contracts, goto https://order.mysql.com/?ref=ensita
 This email is sponsored by Ensita.net http://www.ensita.net/
__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
 /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
___/   www.mysql.com





 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysqld_multi on Linux RedHat 9

2003-08-11 Thread Primaria Falticeni SDU
Hello,

mysqld_multi doesn't start the two groups if I gave this command imediately
after stopping them.


Thanks Anticipated,
Iulian
.




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]