Problems with slave_skip_errors on replication
Hi friends, Last weekend I made an environment that use a MySQL Server version 4.1 that was defined to be the MASTER and other one version 5.1 defined as SLAVE. Because the application that was concept working over exception, often the SLAVE server got new error and replication stops. Well, I configured the my.cnf file of the SLAVE to slave_skip_errors as you may see specified after this massage, but, the replication continue stops, even after this configurations. mysql show variables like 'slave_skip_errors'; +---+---+ | Variable_name | Value | +---+---+ | slave_skip_errors | 1 | +---+---+ 1 row in set (0.00 sec) mysql show slave status\G *** 1. row *** Slave_IO_State: Queueing master event to the relay log Master_Host: 172.28.8.70 Master_User: slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: bmg58-bin.000265 Read_Master_Log_Pos: 251871 Relay_Log_File: pid-file-relay-bin.07 Relay_Log_Pos: 961348 Relay_Master_Log_File: bmg58-bin.03 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1062 Last_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x.', 'x.sp', null)' Skip_Counter: 0 Exec_Master_Log_Pos: 952913 Relay_Log_Space: 264590369 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1062 Last_SQL_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x', 'x.sp', null)' 1 row in set (0.00 sec) Have other thing to do, or this problem is made by the mix of versions? Best regards! -- Wagner Bianchi - Web System Developer and Database Administrator Phone: (31) 8654-9510 / 3272-0226 E-mail: wagnerbianch...@gmail.com Lattes: http://lattes.cnpq.br/2041067758113940 Twitter: http://twitter.com/wagnerbianchi Skype: infodbacet
Re: Problems with slave_skip_errors on replication
Hi Wagner, You have to start the server with the option as below for skipping the error. --slave-skip-errorr= 1062 or all 1062 - will skip the your error as the error number is 1062 and all will skip all the errors. You have to mention specific error numbers to skip the same. -- Thanks Suresh Kuna MySQL DBA On Mon, Jan 25, 2010 at 6:06 PM, Wagner Bianchi wagnerbianch...@gmail.comwrote: Hi friends, Last weekend I made an environment that use a MySQL Server version 4.1 that was defined to be the MASTER and other one version 5.1 defined as SLAVE. Because the application that was concept working over exception, often the SLAVE server got new error and replication stops. Well, I configured the my.cnf file of the SLAVE to slave_skip_errors as you may see specified after this massage, but, the replication continue stops, even after this configurations. mysql show variables like 'slave_skip_errors'; +---+---+ | Variable_name | Value | +---+---+ | slave_skip_errors | 1 | +---+---+ 1 row in set (0.00 sec) mysql show slave status\G *** 1. row *** Slave_IO_State: Queueing master event to the relay log Master_Host: 172.28.8.70 Master_User: slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: bmg58-bin.000265 Read_Master_Log_Pos: 251871 Relay_Log_File: pid-file-relay-bin.07 Relay_Log_Pos: 961348 Relay_Master_Log_File: bmg58-bin.03 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1062 Last_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x.', 'x.sp', null)' Skip_Counter: 0 Exec_Master_Log_Pos: 952913 Relay_Log_Space: 264590369 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1062 Last_SQL_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x', 'x.sp', null)' 1 row in set (0.00 sec) Have other thing to do, or this problem is made by the mix of versions? Best regards! -- Wagner Bianchi - Web System Developer and Database Administrator Phone: (31) 8654-9510 / 3272-0226 E-mail: wagnerbianch...@gmail.com Lattes: http://lattes.cnpq.br/2041067758113940 Twitter: http://twitter.com/wagnerbianchi Skype: infodbacet
Re: Problems with slave_skip_errors on replication
Ok, Suresh. . .I started MySQL with slave_skip_errors = all and It solve the problem! Thanks. WB 2010/1/25 Suresh Kuna sureshkumar...@gmail.com Hi Wagner, You have to start the server with the option as below for skipping the error. --slave-skip-errorr= 1062 or all 1062 - will skip the your error as the error number is 1062 and all will skip all the errors. You have to mention specific error numbers to skip the same. -- Thanks Suresh Kuna MySQL DBA On Mon, Jan 25, 2010 at 6:06 PM, Wagner Bianchi wagnerbianch...@gmail.com wrote: Hi friends, Last weekend I made an environment that use a MySQL Server version 4.1 that was defined to be the MASTER and other one version 5.1 defined as SLAVE. Because the application that was concept working over exception, often the SLAVE server got new error and replication stops. Well, I configured the my.cnf file of the SLAVE to slave_skip_errors as you may see specified after this massage, but, the replication continue stops, even after this configurations. mysql show variables like 'slave_skip_errors'; +---+---+ | Variable_name | Value | +---+---+ | slave_skip_errors | 1 | +---+---+ 1 row in set (0.00 sec) mysql show slave status\G *** 1. row *** Slave_IO_State: Queueing master event to the relay log Master_Host: 172.28.8.70 Master_User: slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: X58-bin.000265 Read_Master_Log_Pos: 251871 Relay_Log_File: pid-file-relay-bin.07 Relay_Log_Pos: 961348 Relay_Master_Log_File: X58-bin.03 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1062 Last_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x.', 'x.sp', null)' Skip_Counter: 0 Exec_Master_Log_Pos: 952913 Relay_Log_Space: 264590369 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1062 Last_SQL_Error: Error 'Duplicate entry '731493' for key 'PRIMARY'' on query. Default database: 'database'. Query: 'INSERT INTO tb_usuario (ocu_codigo, ocu_tipo, usu_codigo, ocu_data, ocu_obs, login_responsavel, ocu_ip) VALUES( null, 67, 'C986CC89AC1C071835E341D18011D25Z', now(), 'x', 'x.sp', null)' 1 row in set (0.00 sec) Have other thing to do, or this problem is made by the mix of versions? Best regards!
auto_increment without primary key in innodb?
In innodb, is it possible to have an auto_increment field without making it a (part of a) primary key? Why is this a requirement? I'm getting the following error. Thanks in advance. ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
RE: auto_increment without primary key in innodb ?
it's not an innodb thing: http://dev.mysql.com/doc/refman/5.0/en/create-table.html Note There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a negative number is regarded as inserting a very large positive number. This is done to avoid precision problems when numbers “wrap” over from positive to negative and also to ensure that you do not accidentally get an AUTO_INCREMENT column that contains 0. -Original Message- From: Yang Zhang yanghates...@gmail.com Sent: Monday, January 25, 2010 10:21am To: mysql@lists.mysql.com Subject: auto_increment without primary key in innodb? In innodb, is it possible to have an auto_increment field without making it a (part of a) primary key? Why is this a requirement? I'm getting the following error. Thanks in advance. ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=...@thefsb.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: auto_increment without primary key in innodb?
Right, I saw the docs. I'm fine with creating an index on it, but the only way I've successfully created a table with auto_increment is by making it a primary key. And I still don't understand why this requirement is there in the first place. On Mon, Jan 25, 2010 at 10:32 AM, Tom Worster f...@thefsb.org wrote: it's not an innodb thing: http://dev.mysql.com/doc/refman/5.0/en/create-table.html Note There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a negative number is regarded as inserting a very large positive number. This is done to avoid precision problems when numbers “wrap” over from positive to negative and also to ensure that you do not accidentally get an AUTO_INCREMENT column that contains 0. -Original Message- From: Yang Zhang yanghates...@gmail.com Sent: Monday, January 25, 2010 10:21am To: mysql@lists.mysql.com Subject: auto_increment without primary key in innodb? In innodb, is it possible to have an auto_increment field without making it a (part of a) primary key? Why is this a requirement? I'm getting the following error. Thanks in advance. ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=...@thefsb.org -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: auto_increment without primary key in innodb?
2010/1/25 Yang Zhang yanghates...@gmail.com: Right, I saw the docs. I'm fine with creating an index on it, but the only way I've successfully created a table with auto_increment is by making it a primary key. And I still don't understand why this requirement is there in the first place. Non-primary key works for me, as documented: --8 mysql create table test_ai (i int PRIMARY KEY, c int auto_increment, index(c)); Query OK, 0 rows affected (0,07 sec) mysql desc test_ai; +---+-+--+-+-++ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-++ | i | int(11) | NO | PRI | NULL|| | c | int(11) | NO | MUL | NULL| auto_increment | +---+-+--+-+-++ 2 rows in set (0,00 sec) mysql insert into test_ai (i) values (100), (200); Query OK, 2 rows affected (0,00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql select * from test_ai; +-+---+ | i | c | +-+---+ | 100 | 1 | | 200 | 2 | +-+---+ 2 rows in set (0,00 sec) --8 Regards, -- Jaime Crespo MySQL Java Instructor Warp Networks http://warp.es -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: auto_increment without primary key in innodb?
The requirement is that it be indexed. The index need not be a primary key. mysql create table t (i int not null auto_increment, index(i)) engine innodb; Query OK, 0 rows affected (0.45 sec) On Jan 25, 2010, at 9:39 AM, Yang Zhang wrote: Right, I saw the docs. I'm fine with creating an index on it, but the only way I've successfully created a table with auto_increment is by making it a primary key. And I still don't understand why this requirement is there in the first place. On Mon, Jan 25, 2010 at 10:32 AM, Tom Worster f...@thefsb.org wrote: it's not an innodb thing: http://dev.mysql.com/doc/refman/5.0/en/create-table.html Note There can be only one AUTO_INCREMENT column per table, it must be indexed, and it cannot have a DEFAULT value. An AUTO_INCREMENT column works properly only if it contains only positive values. Inserting a negative number is regarded as inserting a very large positive number. This is done to avoid precision problems when numbers “wrap” over from positive to negative and also to ensure that you do not accidentally get an AUTO_INCREMENT column that contains 0. -Original Message- From: Yang Zhang yanghates...@gmail.com Sent: Monday, January 25, 2010 10:21am To: mysql@lists.mysql.com Subject: auto_increment without primary key in innodb? In innodb, is it possible to have an auto_increment field without making it a (part of a) primary key? Why is this a requirement? I'm getting the following error. Thanks in advance. ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=...@thefsb.org -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=paul.dub...@sun.com -- Paul DuBois Sun Microsystems / MySQL Documentation Team Madison, Wisconsin, USA www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
optimization
I have a server with 16Gb of RAM and a dual-core 2Ghz processor. It is running the latest mysql-server from debian lenny (5.0.1). I have databases for drupal, moodle, spamassassin, horde3, and a small database for departmental stuff. The problem is that inserts/updates are sometimes very slow, on the order of a minute. I am hoping somebody can sspot something wrong in my config. Here's the optimization settings section (for your convenience). The whole my.cnf is reproduced below that: key_buffer = 256M max_allowed_packet = 16M max_connections=2000 myisam_sort_buffer_size = 64M open_files_limit = 8192 query_cache_min_res_unit= 2K query_cache_size= 36M read_buffer_size = 1M read_rnd_buffer_size = 4M sort_buffer_size = 1M table_cache = 512 thread_cache = 32 thread_cache_size = 8 thread_concurrency = 8 --- # Example MySQL config file for large systems. # # This is for a large system with memory = 512M where the system runs mainly # MySQL. # # You can copy this file to # /etc/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options (in this # installation this directory is /var/lib/mysql) or # ~/.my.cnf to set user-specific options. # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the --help option. # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /var/run/mysqld/mysqld.sock # Here follows entries for some specific programs # The MySQL server [mysqld] log_slow_queries = /var/log/mysql/mysql-slow.log long_query_time = 2 #log-queries-not-using-indexes port = 3306 socket = /var/run/mysqld/mysqld.sock skip-locking #wait_timeout=14400 key_buffer = 256M max_allowed_packet = 16M max_connections=2000 myisam_sort_buffer_size = 64M open_files_limit = 8192 query_cache_min_res_unit= 2K query_cache_size= 36M read_buffer_size = 1M read_rnd_buffer_size = 4M sort_buffer_size = 1M table_cache = 512 thread_cache = 32 thread_cache_size = 8 thread_concurrency = 8 # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the enable-named-pipe option) will render mysqld useless! # #skip-networking # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin expire_logs_days= 10 max_binlog_size = 100M # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1 # Replication Slave (comment out master section to use this) # # To configure this host as a replication slave, you can choose between # two methods : # # 1) Use the CHANGE MASTER TO command (fully described in our manual) - #the syntax is: # #CHANGE MASTER TO MASTER_HOST=host, MASTER_PORT=port, #MASTER_USER=user, MASTER_PASSWORD=password ; # #where you replace host, user, password by quoted strings and #port by the master's port number (3306 by default). # #Example: # #CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, #MASTER_USER='joe', MASTER_PASSWORD='secret'; # # OR # # 2) Set the variables below. However, in case you choose this method, then #start replication for the first time (even unsuccessfully, for example #if you mistyped the password in master-password and the slave fails to #connect), the slave will create a master.info file, and any later #change in this file to the variables' values below will be ignored and #overridden by the content of the master.info file, unless you shutdown #the slave server, delete master.info and restart the slaver server. #For that reason, you may want to leave the lines below untouched #(commented) and instead use CHANGE MASTER TO (see above) # # required unique id between 2 and 2^32 - 1 # (and different from the master) # defaults to 2 if master-host is set # but will not function as a slave if omitted #server-id = 2 # # The replication master for this slave - required #master-host = hostname # # The username the slave will use for authentication when connecting # to the master - required #master-user = username # # The password the slave will authenticate with when connecting to # the master - required #master-password = password # # The port the master is listening on. # optional - defaults to 3306 #master-port = port # # binary logging - not required for slaves, but recommended #log-bin=mysql-bin # Point the following paths to different dedicated disks #tmpdir = /tmp/ #log-update = /path-to-dedicated-directory/hostname # Uncomment the following if you are using BDB tables #bdb_cache_size = 64M #bdb_max_lock = 10 # Uncomment the
RE: Event feature already working in Server 5.1.37
I don't get it... I mean, I get the concept -- it's a crontab; but why would someone opt to put these events here instead of in the God-given CRONTAB as everything else in the system uses? This just seems like one more place to forget about a query/code and have unexpected things happen. We already have a plethora of 'cron-like' tools: * at * /etc/crontab * /var/spool/crontabs/root * /var/spool/crontabs/joeblow * /etc/cron.d/ * /etc/cron.daily/ * /etc/cron.hourly/ * /etc/cron.monthly/ Unless I'm missing some killer functionality this provides (and from that URL, I'm not seeing any), then I wish the Sun/mySQL team would have spent their precious time on more pressing features and or bug-fixes such as this one that is now FOUR YEARS old... (that is erroneously marked as 'feature request'!) http://bugs.mysql.com/bug.php?id=21641 http://bugs.mysql.com/bug.php?id=21641 -Original Message- From: Philipp Maske [Location Bretagne] [mailto:philipp.ma...@location-bretagne.de] Sent: Saturday, January 23, 2010 7:43 PM To: mysql@lists.mysql.com Subject: Event feature already working in Server 5.1.37 Hi, I just wanted to remark, that the Event feature is already working in server version 5.1.37 (installed on Debian). In tech resources is mentioned that this feature would be available since version 5.1.6 (see http://dev.mysql.com/tech-resources/articles/event-feature.html). So I wanted to give up using it- but fortunately I tried it on my 5.1.37 server and it works fine.. So I you have a MySQL server version prior 5.1.6 an need the Event feature - I suggest just give it a try . Friendly Philipp Maske Software Developer Dipl.-Oec. Philipp Maske Location Bretagne Maske Maske GbR Ferienhausvermittlung Am Wasserturm 13 31303 Burgdorf b. Hannover Deutschland / Allemagne Email: mailto:i...@location-bretagne.de i...@location-bretagne.de WWW: http://www.location-bretagne.de www.location-bretagne.de Mobile: +49 (0)172 4523977 OpenBC: http://www.openbc.com/hp/Philipp_Maske http://www.openbc.com/hp/Philipp_Maske -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: optimization
2010/1/25 John G. Heim jh...@math.wisc.edu: I have a server with 16Gb of RAM and a dual-core 2Ghz processor. It is running the latest mysql-server from debian lenny (5.0.1). I have databases for drupal, moodle, spamassassin, horde3, and a small database for departmental stuff. The problem is that inserts/updates are sometimes very slow, on the order of a minute. I am hoping somebody can sspot something wrong in my config. Here's the optimization settings section (for your convenience). The whole my.cnf is reproduced below that: Are your databases using MyISAM or InnoDB? * If MyISAM, you could be suffering contention problems on writes because of full table locks. No easy solution but engine change or database sharding. Also key_buffer, (and the other buffers) coud be too small for 16GB of RAM. Are you really using more thant 10% of it? You could also disable other engines if unused. * If InnoDB, you have not set innodb_buffer_pool_size nor log size. You could increase the pool to 50% of ram available. Those are very general suggestions. It depends a lot on your hardware (slow storage?), other apps installed on the same machine or the load of the server, among others. There also exists a tool to get introduced into MySQL server variables tuning: Tuning primer - https://launchpad.net/mysql-tuning-primer It is also a very general tool, but it could be helpful for a starting point. Regards, -- Jaime Crespo MySQL Java Instructor Warp Networks http://warp.es -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: auto_increment without primary key in innodb?
yah, mysql only allows one auto increment field n that's used as the primary key in tables. I don't think it has to be the primary key as long as it is a unique key i think that's okay. so u should be able to do : create table (myid int unsigned not null auto_increment., unique key (myid)); but this is effectively a primary key if u want some auto incrementing behavior but have it do so only on certain scenarios and possibly hold null values, you can write an insert trigger that would update the field on every insert. Yong. On Mon, 2010-01-25 at 10:21 -0500, Yang Zhang wrote: In innodb, is it possible to have an auto_increment field without making it a (part of a) primary key? Why is this a requirement? I'm getting the following error. Thanks in advance. ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key -- Yang Zhang http://www.mit.edu/~y_z/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: Event feature already working in Server 5.1.37
In the last episode (Jan 25), Daevid Vincent said: I don't get it... I mean, I get the concept -- it's a crontab; but why would someone opt to put these events here instead of in the God-given CRONTAB as everything else in the system uses? This just seems like one more place to forget about a query/code and have unexpected things happen. For a hosted environment (or a restricted corporate environment), it means you don't have to give your users shell accounts; they can schedule table cleanup operations, summary table refreshes, and other operations completely within MySQL. The events will also fire the same whether the server is running Unix or Windows. -- Dan Nelson dnel...@allantgroup.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org