Replication

2008-12-05 Thread Marcel Grandemange
Good Day. Im wondering if someone can assist me. Ive been using replication for a while now and it tends to fail very easily. One of my sites lost connectivity for a while and when it came back obviously replication broke again. How can I get it to populate all data from master again? Load

Re: Replication

2008-12-05 Thread ewen fortune
Hi Marcel, On Fri, Dec 5, 2008 at 2:02 PM, Marcel Grandemange [EMAIL PROTECTED] wrote: Good Day. Im wondering if someone can assist me. Ive been using replication for a while now and it tends to fail very easily. Do you have the error messages?. One of my sites lost connectivity for a

SELECT with replacement chars

2008-12-05 Thread spacemarc
Hi how can i replace, in a SELECT query, the last 3 numbers with asterisks? from 0123456789 to 0123456*** -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: SELECT with replacement chars

2008-12-05 Thread Weston, Craig (OFT)
Hi how can i replace, in a SELECT query, the last 3 numbers with asterisks? from 0123456789 to 0123456*** My psudocode for this would be something like: Select CONCAT(left$(`field`,(LENGTH(a)-3),'***') From `table` But there might be more efficient ideas out there.

Re: Replication

2008-12-05 Thread Jim Lyons
Loss of connection should not break replication. It will stop it, but once you're connected again it should pick right back up where it left off. To restore you can either dump the entire database from the master and load into the slave, then use CHANGE MASTER TO to set up the slave. We

RE: SELECT with replacement chars

2008-12-05 Thread Jerry Schwartz
-Original Message- From: spacemarc [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2008 8:50 AM To: MySQL Subject: SELECT with replacement chars Hi how can i replace, in a SELECT query, the last 3 numbers with asterisks? from 0123456789 to 0123456*** [JS] SELECT

Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
I'm trying to create a trigger (5.0.45) and I've read the documentation at mysql.com. I keep getting a syntax error, but can't figure out what the error is. Here's the trigger I'm trying to create: delimiter // create trigger jobposts_control before delete on jobposts for each row begin

Re: Trying to Create a Trigger

2008-12-05 Thread David Giragosian
On 12/5/08, Lola J. Lee Beno [EMAIL PROTECTED] wrote: I'm trying to create a trigger (5.0.45) and I've read the documentation at mysql.com. I keep getting a syntax error, but can't figure out what the error is. Here's the trigger I'm trying to create: delimiter // create trigger

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
David Giragosian wrote: I'm no expert, but 'old' is a table, I'm guessing, and it isn't referenced in the 'from' clause of the query. could it be that simple...? David No . . . 'old' is a virtual table that is the same as the table I'm doing work on. See

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
I'm trying to create a trigger (5.0.45) and I've read the documentation at mysql.com. I keep getting a syntax error, but can't figure out what the error is. Here's the trigger I'm trying to create: delimiter // create trigger jobposts_control before delete on jobposts for each row begin

Re: Trying to Create a Trigger

2008-12-05 Thread Jim Lyons
can you not use referential integrity for this - assuming the tables are or can be made to be innodb? Does the jobposts table have a jobpost_id field, or is it just id? Maybe it's a typo? On Fri, Dec 5, 2008 at 11:28 AM, Lola J. Lee Beno [EMAIL PROTECTED] wrote: David Giragosian wrote:

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Jim Lyons wrote: can you not use referential integrity for this - assuming the tables are or can be made to be innodb? The tables are myISAM. These could be changed to innodb but I want to see if i can get this trigger work. Does the jobposts table have a jobpost_id field, or is it just

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Martijn Tonies wrote: What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp where

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Martijn Tonies wrote: Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad,

Re: Trying to Create a Trigger

2008-12-05 Thread Andy Shellam
delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp where ad.adsource_id = jp.adsource_id and OLD.jobpost_id =

Re: Trying to Create a Trigger

2008-12-05 Thread Lola J. Lee Beno
Andy Shellam wrote: I'm guessing it's the first semi-colon in your IF statement. Does this work...? if @counted = 1 then SET dummy = 'Cannot delete this record' end if; Just a guess! Andy. That's not it, unfortunately. ERROR: You have an error in your SQL syntax; check the manual

Re: Trying to Create a Trigger

2008-12-05 Thread Peter Brawley
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if @counted = 1 then SET dummy = 'Cannot delete this record' end if' at line 1 This works on 5.1.30 and 6.0.7: create table jobposts(adsource_id

Re: How to create a unicode capable table??

2008-12-05 Thread Michael Monaghan
I'm not at all familiar with SQL Server, but you need to make sure that the encoding/charset you use in MySQL is the same as used in SQL S. If not the same, then you might need to transcode the data before migrating. Collation is less important than encoding. - if you get the charset wrong, then

Flexible way to convert?

2008-12-05 Thread Yimin Rong
Greetings, Please see following sample code and result. Note that x is cast properly but y isn't. (FYI 0x913386aa3cbbab5a == 10462854425033288538) Is there a way in MySQL to convert strings to numbers such that it recognizes decimal, hex, and optionally other bases? I'm thinking of something

Re: Trying to Create a Trigger

2008-12-05 Thread Martijn Tonies
Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select count(ad.adsource_id) from adsource ad, jobposts jp where

Re: SELECT with replacement chars

2008-12-05 Thread spacemarc
thanks, it works fine (on mysql 4 and 5) SELECT CONCAT(LEFT(myfield,LENGTH(myfield) - 3), '***') FROM table; -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Vexing permissions issue with partitioned CREATE TABLE

2008-12-05 Thread Brad Heintz
All - Thanks in advance for help with a sticky problem. I'm attempting to create a partitioned table thus: CREATE TABLE `my_precious_table` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `startTimeStamp` datetime NOT NULL DEFAULT '-00-00 00:00:00', PRIMARY KEY (`id`,`startTimeStamp`) )

Re: Vexing permissions issue with partitioned CREATE TABLE

2008-12-05 Thread ceo
I've never created a partitioned table, but... $ perror 13 OS error code 13: Permission denied So I suspect some kind of file-system permissions issue... Are you sure that the path you are giving isn't relative to the mysql data dir? In which case it's trying to use something more

Re: Vexing permissions issue with partitioned CREATE TABLE

2008-12-05 Thread Brad Heintz
Thanks for responding. The CREATE TABLE docs for 5.1 say that DATA DIRECTORY and INDEX DIRECTORY take absolute paths (not relative), and will in fact reject paths containing the MySQL data dir. Because I'm out of other ideas, I did try creating the directories under the MySQL data dir and it

Re: Vexing permissions issue with partitioned CREATE TABLE

2008-12-05 Thread Brad Heintz
Thanks, Martin, but that's not it. As I mentioned in my email, I'm running as MySQL root user with all priv bits set. I tried your suggestion anyway, but no change. Cheers, - Brad On Fri, Dec 5, 2008 at 4:34 PM, Martin Gainty [EMAIL PROTECTED] wrote: Brad- log into mysql as admin GRANT

Re: Trying to Create a Trigger

2008-12-05 Thread Wm Mussatto
On Fri, December 5, 2008 12:14, Martijn Tonies wrote: Hi, What is the exact error message? Here's the latest query: delimiter // create trigger jobposts_control before delete on jobposts for each row begin declare dummy varchar(255); set @counted = ( select

Re: Trying to Create a Trigger

2008-12-05 Thread Andy Shellam
I think you are missing the point. Where is 'OLD' or 'old' defined? Before you try to imbed it in a trigger, try the basic query. That seems to be what its complaining about. OLD is a virtual table which is only present in a trigger - it's like a table with the same layout as the table

--safe-updates and DELETEs

2008-12-05 Thread Waynn Lue
If I have a table like this: CREATE TABLE `Test` ( `TestId` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Does using --safe-updates mean that it's impossible for me to ever delete from it, since it doesn't have a key? For example: INSERT INTO Test VALUES (1), (2); mysql

Re: Vexing permissions issue with partitioned CREATE TABLE

2008-12-05 Thread Florin Andrei
Brad Heintz wrote: I've googled extensively, searched the list archives, and exhausted every other avenue I could think of before posting to the list, but am no closer to an answer. Does anyone have any ideas? Have I missed something in the docs? SELinux? -- Florin Andrei