Re: Update Problem when ORing w/ Long.MIN_VALUE

2008-11-25 Thread Daniel Doubleday

Hi Gautam

nope yours is not a bug. That's all fine. Hex numbers are 64 bit  
unsigned.

So for -1 you have to insert cast(0x as signed).

Cheers,
Daniel


Hi Daniel,

I can see the problem without using "update". However, I am a newbie  
at

mysql,
so can't say for certain if it's a bug:

mysql> drop table if exists foo;
mysql> create table foo (id int signed, val bigint signed);
mysql> insert into foo values (0x, 0x), (-1,  
-1);

mysql> select hex(id), hex(val) from foo;

+--+--+
| hex(id)  | hex(val) |
+--+--+
| 7FFF | 7FFF |
|  |  |
+--+--+
2 rows in set (0.00 sec)


Regards
Gautam

Daniel Doubleday wrote:
> Hi everybody -
>
> I'm experiencing some really weird update behaviour (mysql 5.0) when
> or'ing results from subselects using Long.MIN_VALUE.
> But before I post a bug report I wanted to ask if I'm missing  
something.

>
>
> drop table if exists foo;
> drop table if exists bar;
>
> create table foo (fooid int, fooval bigint);
> create table bar (barid int, barval bigint);
>
> insert into foo values (1, null), (2, null);
> insert into bar values (1, 123), (2, 345);
>
> update foo set fooval = (select barval from bar where barid =  
fooid) |

> 0x8000;
>
> select * from foo;
>
> # +---+-+
> # | fooid | fooval  |
> # +---+-+
> # | 1 | 9223372036854775807 |
> # | 2 | 9223372036854775807 |
> # +---+-+
> # 2 rows in set (0.00 sec)
>
> # Oops result is Long.MAX_VALUE (as if subselect result was 0 - bit
> logic result is always unsigned bigint)
> # Same thing when you replace subselect by multi table update syntax
>
> update foo, bar set fooval = barval | 0x8000 where  
fooid =

> barid;
>
> select * from foo;
>
> # +---+-+
> # | fooid | fooval  |
> # +---+-+
> # | 1 | 9223372036854775807 |
> # | 2 | 9223372036854775807 |
> # +---+-+
> # 2 rows in set (0.00 sec)
>
> # and it seems that its all about MSB sign bit, cause thats fine:
>
> update foo, bar set fooval = barval | 0x7000 where  
fooid =

> barid;
>
> select * from foo;
>
> # +---+-+
> # | fooid | fooval  |
> # +---+-+
> # | 1 | 8070450532247928955 |
> # | 2 | 8070450532247929177 |
> # +---+-+
> # 2 rows in set (0.00 sec)
>
>
> # and casting the or result! does the trick too though I dont
> understand why ...
>
> update foo set fooval = cast((select barval from bar where barid =
> fooid) | 0x8000 as signed);
>
> select * from foo;
>
> # +---+--+
> # | fooid | fooval   |
> # +---+--+
> # | 1 | -9223372036854775685 |
> # | 2 | -9223372036854775463 |
> # +---+--+
> # 2 rows in set (0.00 sec)
>
>
>




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



Incorrect Link Destination URL

2008-11-25 Thread Nick.Page
Hello, 

 

My name is Nick and I am contacting you on behalf of one of our clients,
Novell (www.novell.com  ). 

 

I am writing to you regarding the content of your webpage
(http://sunsite.univie.ac.at/textbooks/mysql/manual.html). I noticed
that you have included a link to Novell's (SUSE's) Linux webpage. This
link is pointing to www.suse.com
  which is an expired domain. 

 

I would like to request that you change the destination URL from
www.suse.com    to the correct and updated URL
www.novell.com/linux. 

 

Your support would be greatly appreciated. 

 

Kind Regards, 

 

Nick Page

 

 



Stopping using a server as a slave

2008-11-25 Thread Jesse
I have a server that I've been using as a MySQL Slave for a while now.  I 
want to change it over to a regular server now.  I could simply stop the 
slave (STOP SLAVE), however, I'm concerned that if I re-boot the server, 
then it'll re-start the slave.  What else do I need to do to stop using a 
server as a slave?


Thanks,
Jesse 



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



Re: Stopping using a server as a slave

2008-11-25 Thread Amit Sharma
Hi Jesse,
Just add 'skip-slave-start' to your configuration file, restart & there you
go.
Best regards,
Amit Sharma

On Tue, Nov 25, 2008 at 7:12 PM, Jesse <[EMAIL PROTECTED]> wrote:

> I have a server that I've been using as a MySQL Slave for a while now.  I
> want to change it over to a regular server now.  I could simply stop the
> slave (STOP SLAVE), however, I'm concerned that if I re-boot the server,
> then it'll re-start the slave.  What else do I need to do to stop using a
> server as a slave?
>
> Thanks,
> Jesse
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>


replacing a timestamped row

2008-11-25 Thread David Halik


Hi everyone,

I'm fairly new to MySQL and I have a procedure that writes some status 
info to a table. The problem is, I just want the values and row to be 
replaced, rather than constantly adding a new row. I tried using REPLACE 
as well as different timestamp methods, but I always get a new row. How 
can I ensure the old row is overwritten? Here's what I'm trying to do:


create table check_master_log (ts timestamp, server_id int, 
master_status varchar(30));


mysql> describe check_master_log;
+---+-+--+-+---+-+
| Field | Type| Null | Key | Default   | 
Extra   |

+---+-+--+-+---+-+
| ts| timestamp   | NO   | | CURRENT_TIMESTAMP | on 
update CURRENT_TIMESTAMP |
| server_id | int(11) | YES  | | NULL  
| |
| master_status | varchar(30) | YES  | | NULL  
| |

+---+-+--+-+---+-+

Then I have a script that runs every 15 seconds and does one of the 
following:


insert into check_master_log values (now(), @@server_id, "master OK");

insert into check_master_log values (now(), @@server_id, "master is dead");

Everything works great, but I end up with a growing table that adds a 
new row every 15 seconds:


| 2008-11-25 11:42:12 | 1 | master OK |
| 2008-11-25 11:42:27 | 1 | master OK |
| 2008-11-25 11:42:42 | 1 | master OK |
| 2008-11-25 11:42:57 | 1 | master OK |
+-+---+---+

What I'd like to do is just have it replace the existing one so I just 
have one status row that I can select and check. I'm sure it's just a 
matter of the proper "replace" and table syntax, but I haven't been able 
to get it to work without constantly appending rows.


Any suggestions?
Thanks in advance,
-Dave

--

David Halik
System Administrator
OIT-CSS Rutgers University
[EMAIL PROTECTED]



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



why is information schema so slow?

2008-11-25 Thread Jim Lyons
We have a pretty large database (several terabytes and hundreds of tables).
When I do a simple query from the information schema, e.g. select table_name
from tables, it can minutes to come back with the answer.  Yet, if I do a
show tables, describe or "show create table" the response is instant.

Then other day I wanted to see if a trigger existed on a table so I tried to
access the appropriate table in infromation schema.  It took so long that I
just ran mysqldump on the table with the --no-date and --triggers options
and I got the answer immediately.

Does anyone else have this problem?  Is there something I can do to speed up
queries to IS?  I know these are views, are they so complicated that it
takes forever to query them.  This reduces their usefulness if true.

Thanks

-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com


Mysql and Flashback

2008-11-25 Thread Shain Miley

Hello,
We are planning on trying to do an Oracle to MySQL migration in the near 
future.  The issue of a Mysql equivalent to Oracle's flashback was being 
discussed.  After some digging  it appears that there is no such feature 
in Mysql. One thought that I had was to do some intentional replication 
lag (say 12 to 24 hours)...that way if we needed to revert back we would 
have the option of doing so.


Does anyone:

a: know how to setup a replication to intentionally lag?

b: know of a better way of engineering a flashback equivalent for Mysql?

Thanks in advance,

Shain

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



Re: replacing a timestamped row

2008-11-25 Thread Andy Shellam

Hi Dave,

You have no primary key on your table, thus MySQL has no way of knowing 
when the row is unique and needs to be updated rather than inserted.  
REPLACE INTO effectively does the following:


- insert into table
- did a primary key violation occur?
--- yes - delete existing row from table where primary key matches the 
record to be inserted

- insert into table
--- no - row was inserted OK

Judging by your table layout, I'm guessing the server_id column would be 
a good candidate for a primary key - providing of course that you only 
need one status row per server.  Delete all existing records, make 
server_id your primary key (and not null-able) and retry your script.


Regards,

Andy

David Halik wrote:


Hi everyone,

I'm fairly new to MySQL and I have a procedure that writes some status 
info to a table. The problem is, I just want the values and row to be 
replaced, rather than constantly adding a new row. I tried using 
REPLACE as well as different timestamp methods, but I always get a new 
row. How can I ensure the old row is overwritten? Here's what I'm 
trying to do:


create table check_master_log (ts timestamp, server_id int, 
master_status varchar(30));


mysql> describe check_master_log;
+---+-+--+-+---+-+ 

| Field | Type| Null | Key | Default   | 
Extra   |
+---+-+--+-+---+-+ 

| ts| timestamp   | NO   | | CURRENT_TIMESTAMP | on 
update CURRENT_TIMESTAMP |
| server_id | int(11) | YES  | | NULL  
| |
| master_status | varchar(30) | YES  | | NULL  
| |
+---+-+--+-+---+-+ 



Then I have a script that runs every 15 seconds and does one of the 
following:


insert into check_master_log values (now(), @@server_id, "master OK");

insert into check_master_log values (now(), @@server_id, "master is 
dead");


Everything works great, but I end up with a growing table that adds a 
new row every 15 seconds:


| 2008-11-25 11:42:12 | 1 | master OK |
| 2008-11-25 11:42:27 | 1 | master OK |
| 2008-11-25 11:42:42 | 1 | master OK |
| 2008-11-25 11:42:57 | 1 | master OK |
+-+---+---+

What I'd like to do is just have it replace the existing one so I just 
have one status row that I can select and check. I'm sure it's just a 
matter of the proper "replace" and table syntax, but I haven't been 
able to get it to work without constantly appending rows.


Any suggestions?
Thanks in advance,
-Dave




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



Re: replacing a timestamped row

2008-11-25 Thread David Halik


Ack! Such a simple but important step. No wonder it wasn't replacing the 
existing row.


That worked great, thank you very much.

Also, thanks to Brent who replied first. I ended up going with the 
primary key over the unique index, but I'm sure that would have worked 
as well.


-Dave

Andy Shellam wrote:

Hi Dave,

You have no primary key on your table, thus MySQL has no way of 
knowing when the row is unique and needs to be updated rather than 
inserted.  REPLACE INTO effectively does the following:


- insert into table
- did a primary key violation occur?
--- yes - delete existing row from table where primary key matches the 
record to be inserted

- insert into table
--- no - row was inserted OK

Judging by your table layout, I'm guessing the server_id column would 
be a good candidate for a primary key - providing of course that you 
only need one status row per server.  Delete all existing records, 
make server_id your primary key (and not null-able) and retry your 
script.


Regards,

Andy

David Halik wrote:


Hi everyone,

I'm fairly new to MySQL and I have a procedure that writes some 
status info to a table. The problem is, I just want the values and 
row to be replaced, rather than constantly adding a new row. I tried 
using REPLACE as well as different timestamp methods, but I always 
get a new row. How can I ensure the old row is overwritten? Here's 
what I'm trying to do:


create table check_master_log (ts timestamp, server_id int, 
master_status varchar(30));


mysql> describe check_master_log;
+---+-+--+-+---+-+ 

| Field | Type| Null | Key | Default   | 
Extra   |
+---+-+--+-+---+-+ 

| ts| timestamp   | NO   | | CURRENT_TIMESTAMP | on 
update CURRENT_TIMESTAMP |
| server_id | int(11) | YES  | | NULL  
| |
| master_status | varchar(30) | YES  | | NULL  
| |
+---+-+--+-+---+-+ 



Then I have a script that runs every 15 seconds and does one of the 
following:


insert into check_master_log values (now(), @@server_id, "master OK");

insert into check_master_log values (now(), @@server_id, "master is 
dead");


Everything works great, but I end up with a growing table that adds a 
new row every 15 seconds:


| 2008-11-25 11:42:12 | 1 | master OK |
| 2008-11-25 11:42:27 | 1 | master OK |
| 2008-11-25 11:42:42 | 1 | master OK |
| 2008-11-25 11:42:57 | 1 | master OK |
+-+---+---+

What I'd like to do is just have it replace the existing one so I 
just have one status row that I can select and check. I'm sure it's 
just a matter of the proper "replace" and table syntax, but I haven't 
been able to get it to work without constantly appending rows.


Any suggestions?
Thanks in advance,
-Dave







--

David Halik
System Administrator
OIT-CSS Rutgers University
[EMAIL PROTECTED]



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



Make Innodb give memory back?

2008-11-25 Thread Todd Lyons
Hello all!

We have a master-master replication system.  Both nodes run 5.0.54,
the version compiled by centos, running on CentOS 5.1 x86_64.  The
boxen have 8 GB RAM, 1 GB swap, and the cpu is Xeon(R) CPU X3220 @
2.40GHz (shows as 4 cpus to the system).  db1 is serving the live
site, db2 is used only for nightly dumps.

There are 2245 databases, the majority of those (2240 or so) have 195
tables, of which about 190 are InnoDB (with "innodb_file_per_table"
set).  That means that there is the default ibdata1 that is 1Gig, and
2 ib_logfile files, 128 Megs each, and then the ibd files for each
table in those databases (current count is 415307).  The
/var/lib/mysql directory is on a 300GB Raid 1 mirror with SAS drives.

Replication broke on db2, so I decided to start from scratch* and just
mysqldump everything from db1 to db2.  The way that I do the dump is
get a list of databases, then call mysqldump for each database.  The
problem is that while I am running the script, the amount of memory
that mysql on db1 uses gradually grows until it uses all RAM and swap and the
kernel kills mysqld (it's not mysqldump, it's mysql itself).  I have
my settings very conservatively set, and by my estimate, there should
be no more than about 4 GB being used by mysql in its entirety (less
than 2 Gigs for mysql itself, and 2 Gigs for InnoDB).  I have included
my my.cnf at the bottom of this message.

The problem is that InnoDB (I think) is using memory and not giving it
back (memory fragmentation? It's a guess).  I have flushed everything
that can be flushed.

Is there any way I can tell mysql to force innodb to flush some of
that memory and give it back to the system?

The only thing left for me to do otherwise is shut mysql down and
start it back up.  It's a live system, and a restart takes a few
minutes, which results in downtime that we don't want.  I'm trying to
get my data back onto the second master, at which point I will have a
much better feeling about the state of things.  My trip-point is that
the process of copying the data from db1 to db2 is causing db1 to run
out of memory.

I've seen posts where Kevin Burton mentions innodb_file_per_table and
performance (and somewhere I read a comment on error recovery, but I
can't find it now).  We might be pushing our system a bit beyond any
of his test cases with the large number of databases, and I think we
might be RAM starved compared to his tests.

Here is my current memory consumption according to SHOW INNODB STATUS:
--
BUFFER POOL AND MEMORY
--
Total memory allocated 6681154330; in additional pool allocated 1048576
Buffer pool size   131072
Free buffers   17
Database pages 128431
Modified db pages  14
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 1175284, created 489085, written 4557296
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000

This is from SHOW STATUS:
| Qcache_free_blocks| 203  |
| Qcache_free_memory| 8300808  |
| Qcache_hits   | 272676719|
| Qcache_inserts| 61184474 |
| Qcache_lowmem_prunes  | 32835896 |
| Qcache_not_cached | 19674714 |
| Qcache_queries_in_cache   | 17689|
| Qcache_total_blocks   | 38769|

* Initially I did try rsyncing all data/tables from db1, but the sheer
amount of errors in the mysqld.log complaining about mismatched id's
when trying to start up was disconcerting.  The first attempt to
insert data caused an error 11, mysqld restarted, it repeated the
entire process of reading in all the tables and complaining about
mismatched id's, then it spit out an Assertion, along with this:
  key_buffer_size + (read_buffer_size +
  sort_buffer_size)*max_connections = 203998 K bytes of memory
so I am positive that my (MyISAM) settings are very conservative and
shouldn't be using too much memory.


USER   PID %CPU %MEMVSZ   RSS TTY  STAT START   TIME COMMAND
root 27482  0.0  0.0  63812  1204 ?SNov01   0:00
/bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql
--socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log
--pid-file=/var/run/mysqld/mysqld.pid
mysql27541  3.0 85.5 7270500 6998988 ? Sl   Nov01 1041:08
/usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql
--user=mysql --pid-file=/var/run/mysqld/mysqld.pid
--skip-external-locking --socket=/var/lib/mysql/mysql.sock


/etc/my.cnf:
[mysql]
prompt=db1 (\\d)>\\_

[client]
default-character-set=utf8

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
default-character-set=utf8
default-table-type=innodb
default-time-zone=UTC

skip-external-locking
set-variable = key_buffer=4M
set-variable = max_allowed_packet=16M
set-variable = max_connections=200
set-variable = read_buffer_size=512K
set-variable = sort_buffer_size=1M
set-variable = query_cache_size=32M
set-variable = ta

Re: Mysql and Flashback

2008-11-25 Thread ewen fortune
Hi Shain,

If you are using InnoDB its possible to patch to allow this functionality.

Percona are in the early stages of developing a patch specifically to
allow flashback type access to previous table states.

https://bugs.launchpad.net/percona-patches/+bug/301925

If you wanted to go down the slave lag road, Maatkit has a tool for doing that.

http://www.maatkit.org/doc/mk-slave-delay.html

Cheers,

Ewen

On Tue, Nov 25, 2008 at 6:57 PM, Shain Miley <[EMAIL PROTECTED]> wrote:
> Hello,
> We are planning on trying to do an Oracle to MySQL migration in the near
> future.  The issue of a Mysql equivalent to Oracle's flashback was being
> discussed.  After some digging  it appears that there is no such feature in
> Mysql. One thought that I had was to do some intentional replication lag
> (say 12 to 24 hours)...that way if we needed to revert back we would have
> the option of doing so.
>
> Does anyone:
>
> a: know how to setup a replication to intentionally lag?
>
> b: know of a better way of engineering a flashback equivalent for Mysql?
>
> Thanks in advance,
>
> Shain
>
> --
> 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]



Optimizing query question, EXPLAIN SELECT ...

2008-11-25 Thread Thomas Thomas
Hi,

I am pretty new in optimizing tables with index and may need some help.
This is my query:

EXPLAIN SELECT timestamp
FROM Meting_INT_COPY
WHERE blockid = '200811252000'
ORDER BY timestamp DESC
LIMIT 1

If I have an index(blockid),
EXPLAIN will return the following information:

type possible_keys key  rows Extra
ref index_blockid index_blockid 2638 Using where; Using filesort

If I add an index(blockid,timestamp)
EXPLAIN will display the following:

type possible_keys   key
   rows Extra
ref index_blockid,index_blockid_timestampindex_blockid_timestamp8248
Using where; Using index


The index(blockid,timestamp) avoid the filesort + returns the result from
index ! (Using where; Using index)
But why for the index(blockid) 2638 rows are returned and for a more
specific index(blockid,timestamp) 8248 rows are returned ?

Thank you for any answer !


Re: Mysql and Flashback

2008-11-25 Thread Howard Hart

slave lag should be easy to do with a simple bash script. i.e. -

desired_delay=3600  # one hour lag

while sleep 60
do
 behind=`mysql -u root --password=foobar -e "show slave status\G" | 
grep 'Seconds_Behind_Master:' | awk '{ printf "%s\n", $2 }'`

 if [ $behind < $desired_delay ]; then
 mysql -u root --password=foobar -e "slave stop"
 holdtime=`expr $desired_delay  -  $behind`
 if [ $holdtime -gt 0]; then
 mysql -u root --password=foobar -e "slave stop"
 fi
 else
 mysql -u root --password=foobar -e "slave start"
 fi
done


Not pretty, but should do the job with more sanity checks, with the 
caveat that sometimes Seconds_Behind_Master can return some interesting 
values


Howard Hart
Ooma, Inc.

ewen fortune wrote:

Hi Shain,

If you are using InnoDB its possible to patch to allow this functionality.

Percona are in the early stages of developing a patch specifically to
allow flashback type access to previous table states.

https://bugs.launchpad.net/percona-patches/+bug/301925

If you wanted to go down the slave lag road, Maatkit has a tool for doing that.

http://www.maatkit.org/doc/mk-slave-delay.html

Cheers,

Ewen

On Tue, Nov 25, 2008 at 6:57 PM, Shain Miley <[EMAIL PROTECTED]> wrote:
  

Hello,
We are planning on trying to do an Oracle to MySQL migration in the near
future.  The issue of a Mysql equivalent to Oracle's flashback was being
discussed.  After some digging  it appears that there is no such feature in
Mysql. One thought that I had was to do some intentional replication lag
(say 12 to 24 hours)...that way if we needed to revert back we would have
the option of doing so.

Does anyone:

a: know how to setup a replication to intentionally lag?

b: know of a better way of engineering a flashback equivalent for Mysql?

Thanks in advance,

Shain

--
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]



How to create a unicode capable table??

2008-11-25 Thread Ali, Saqib
What Charset and Collation should I use while creating a mysql table
such that it can take data from unicode SQL Server DB table?

Thanks
saqib
http://doctrina.wordpress.com/

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



Re: Stopping using a server as a slave

2008-11-25 Thread Krishna Chandra Prajapati
stop slave;
reset slave;
restart mysql server

On Tue, Nov 25, 2008 at 7:12 PM, Jesse <[EMAIL PROTECTED]> wrote:

> I have a server that I've been using as a MySQL Slave for a while now.  I
> want to change it over to a regular server now.  I could simply stop the
> slave (STOP SLAVE), however, I'm concerned that if I re-boot the server,
> then it'll re-start the slave.  What else do I need to do to stop using a
> server as a slave?
>
> Thanks,
> Jesse
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
Krishna Chandra Prajapati
MySQL DBA,
Ed Ventures e-Learning Pvt.Ltd.
1-8-303/48/15, Sindhi Colony
P.G.Road, Secunderabad.
Mob: 9912924044
Email-id: [EMAIL PROTECTED]


Re: Stopping using a server as a slave

2008-11-25 Thread Claudio Nanni

stop slave;
reset slave;


Krishna Chandra Prajapati wrote:

stop slave;
reset slave;
restart mysql server

On Tue, Nov 25, 2008 at 7:12 PM, Jesse <[EMAIL PROTECTED]> wrote:

  

I have a server that I've been using as a MySQL Slave for a while now.  I
want to change it over to a regular server now.  I could simply stop the
slave (STOP SLAVE), however, I'm concerned that if I re-boot the server,
then it'll re-start the slave.  What else do I need to do to stop using a
server as a slave?

Thanks,
Jesse

--
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: Stopping using a server as a slave

2008-11-25 Thread Rolando Edwards
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='';

RESET SLAVE only clears away relay logs.

CHANGE MASTER TO MASTER_HOST='' will delete the master.info

Replication is eliminated from that point going forward

-Original Message-
From: Claudio Nanni [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 26, 2008 12:58 AM
To: Krishna Chandra Prajapati
Cc: Jesse; mysql@lists.mysql.com
Subject: Re: Stopping using a server as a slave

stop slave;
reset slave;


Krishna Chandra Prajapati wrote:
> stop slave;
> reset slave;
> restart mysql server
>
> On Tue, Nov 25, 2008 at 7:12 PM, Jesse <[EMAIL PROTECTED]> wrote:
>
>   
>> I have a server that I've been using as a MySQL Slave for a while now.  I
>> want to change it over to a regular server now.  I could simply stop the
>> slave (STOP SLAVE), however, I'm concerned that if I re-boot the server,
>> then it'll re-start the slave.  What else do I need to do to stop using a
>> server as a slave?
>>
>> Thanks,
>> Jesse
>>
>> --
>> 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]


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



linq with mysql

2008-11-25 Thread Sharique uddin Ahmed Farooqui
Hi,

 I'm using VS Express 2008, and trying to use linq with Mysql.What I have done

   1. Created a db with a single table name account(fields : acct_num
int, amount int)
   2. created a Linqto sql file with same model as db table.
   3. A page with gridview and code behind is (on page load event):



MySqlConnection con = new
MySqlConnection(ConfigurationManager.ConnectionStrings["mysqltest"].ConnectionString);

MyLinqDataContext db = new MyLinqDataContext(con);

var q = from p in db.Accounts  p;

GridView1.DataSource = q;
GridView1.DataBind();

 I'm getting this 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 '[t0].[amount], [t0].[acct_num]
FROM [Account] AS [t0]' at line 1

I run  this query  in a mysql tool (HeidiSql), it gives same error. Is
it due to brackets '['  ?

 select [t0].[amount], [t0].[acct_num] FROM [Account] AS [t0]

-- 
Sharique uddin Ahmed Farooqui
(C++/C# Developer, IT Consultant)
http://safknw.blogspot.com/
"Peace" is the Ultimate thing we want.

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



Re: linq with mysql

2008-11-25 Thread Johan Höök

Hi,
you're using Sqlserver syntax for handling reserved words.
In MySQL you use backtick` for the same, i.e.

select `t0`.`amount` etc.


/Johan



Sharique uddin Ahmed Farooqui skrev:

Hi,

 I'm using VS Express 2008, and trying to use linq with Mysql.What I have done

   1. Created a db with a single table name account(fields : acct_num
int, amount int)
   2. created a Linqto sql file with same model as db table.
   3. A page with gridview and code behind is (on page load event):



MySqlConnection con = new
MySqlConnection(ConfigurationManager.ConnectionStrings["mysqltest"].ConnectionString);

MyLinqDataContext db = new MyLinqDataContext(con);

var q = from p in db.Accounts  p;

GridView1.DataSource = q;
GridView1.DataBind();

 I'm getting this 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 '[t0].[amount], [t0].[acct_num]
FROM [Account] AS [t0]' at line 1

I run  this query  in a mysql tool (HeidiSql), it gives same error. Is
it due to brackets '['  ?

 select [t0].[amount], [t0].[acct_num] FROM [Account] AS [t0]

  


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