Re: Removing Data Duplicacy

2012-02-22 Thread Adarsh Sharma
Thanks Johan, but i mentioned before that adding auto increment column doesn't solve the issue & it causes errors in the multi threaded application. Multiple clients calls this insert procedure simultaneously, so it fails the transactions if two or more clients reads the same ID value. I need t

restore from replication

2012-02-22 Thread Doug
Hello, Currently my master db has about 50G data. There is a replication slave db, it's running with read-only mode. When the master is down for some reasons, I will have to remove the read-only flag in slave mysql and let the applications access to slave with both read and write. When the master

Re: logrotate script doesn't create a new log file

2012-02-22 Thread Johan De Meersman
- Original Message - > From: "Honza Horak" > > particular reason why the line is not used by default? Can't be bothered to go look at the script, but it should be doing a "flush logs" somewhere. The line is commented by default because MySQL will recreate it's logfiles automatically, a

Re: MySQL Session Variables with PHP

2012-02-22 Thread Johan De Meersman
- Original Message - > From: "Steven Staples" You're asking the wrong question, though. WHY do you want to do that? You should never, ever ever rely on auto_increment for stuff like record insert order. Did I mention NEVER? Autoincrements can get reset for a variety of reasons. The onl

Re: Removing Data Duplicacy

2012-02-22 Thread Johan De Meersman
- Original Message - > From: "Johnny Withers" > > I'm not sure, It seems to me the proper way to do would be to insert > into table1, get the insert ID, then insert into table2 using that ID, > this is pretty standard stuff. > > Not sure why, in this case, he cannot do that. last_insert

logrotate script doesn't create a new log file

2012-02-22 Thread Honza Horak
Hi all, I'm thinking of logrotate script, that is shipped in mysql tar ball (e.g. mysql-5.5.20/support-files/mysql-log-rotate.sh). There is a commented line "# create 600 mysql mysql", that should originally ensure logrotate utility creates a new log file after rotating. Is there any particul

RE: MySQL Session Variables with PHP

2012-02-22 Thread Steven Staples
> -Original Message- > From: Peter Brawley [mailto:peter.braw...@earthlink.net] > Sent: February 22, 2012 11:07 AM > To: Steven Staples; mysql@lists.mysql.com > Subject: Re: MySQL Session Variables with PHP > > On 2/22/2012 9:47 AM, Steven Staples wrote: > > Good [insert time of day here]

Re: MySQL Session Variables with PHP

2012-02-22 Thread Peter Brawley
On 2/22/2012 9:47 AM, Steven Staples wrote: Good [insert time of day here] all! I am trying to reorder my auto-inc field in my database, and I have successfully done it with my "front end" that I use (SQLYog) with the following code: SET @var_name = 0; UPDATE `my_database`.`my_table` SET `id` =

MySQL Session Variables with PHP

2012-02-22 Thread Steven Staples
Good [insert time of day here] all! I am trying to reorder my auto-inc field in my database, and I have successfully done it with my "front end" that I use (SQLYog) with the following code: SET @var_name = 0; UPDATE `my_database`.`my_table` SET `id` = (@var_name := @var_name +1); Now, when I t

Re: Removing Data Duplicacy

2012-02-22 Thread Johnny Withers
I'm not sure, It seems to me the proper way to do would be to insert into table1, get the insert ID, then insert into table2 using that ID, this is pretty standard stuff. Not sure why, in this case, he cannot do that. -JW On Wed, Feb 22, 2012 at 8:54 AM, Rhino wrote: > I miised the first mess

Re: Removing Data Duplicacy

2012-02-22 Thread Johnny Withers
You can also handle this with transactions: CREATE TABLE `seq` ( `seq_num` int(10) unsigned NOT NULL DEFAULT '1000' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 #Initialize sequence numbers INSERT INTO seq(seq_num) VALUES(1000); #Get next sequence number START TRANSACTION; UPDATE seq SET seq_num=L

Re: Removing Data Duplicacy

2012-02-22 Thread Arthur Fuller
I agree with the testicular remedy, but in the case of the iron codpiece, I can think of another approach which may work for you. It still uses Select, but reads a one-row table, so it shouldn't hurt performance much. The table serves no other purpose than storing the next available PK; call the ta

Re: Strange "row counter" issues

2012-02-22 Thread Shawn Green (MySQL)
Hello Lay, On 2/22/2012 07:05, Lay András wrote: Hi! I have a table: CREATE TABLE IF NOT EXISTS `test` ( `id` int(11) NOT NULL auto_increment, `cucc` varchar(255) character set utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `test` (`id`, `cucc

Strange "row counter" issues

2012-02-22 Thread Lay András
Hi! I have a table: CREATE TABLE IF NOT EXISTS `test` ( `id` int(11) NOT NULL auto_increment, `cucc` varchar(255) character set utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `test` (`id`, `cucc`) VALUES (1, 'egyszer'), (2, 'ketszer'), (3, 'ketszer'

Re: Removing Data Duplicacy

2012-02-22 Thread Johan De Meersman
- Original Message - > From: "Adarsh Sharma" > > Today I noticed some duplicacy in my c_id column which is not Yes, that's what you get if you don't use auto_increments. > I need multiple client select cid from 2 tables & insert data with > adding 1 to previous C_id in isolated manner.