make a slave db a master db
Hi All, We have one master and two slave dbs. Now we want one of the slaves to work as a stand alone master db, so what are the steps that i need to take to make one of the slaves as a stand alone master db. regards anandkl
LOAD DATA INTO doesn't work correctly with utf8
Hello, I would like to import data from a utf8-coded comma seperated file. I created my database with DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci and I started my mysql-client with the --default-character-set=utf8 option. Nevertheless, when I input primary key fields, which differ only in one umlaut character (e.g. achten and ächten) I get the following error message: ERROR 1062 (23000): Duplicate entry 'ächten' for key 1 (Same thing happens when I try to manually INSERT the row.) When I display my variable settings with SHOW variables LIKE 'c%'; I receive the following result: +--++ | Variable_name| Value | +--++ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results| utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci| | collation_database | utf8_general_ci| | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert| 1 | | connect_timeout | 5 | +--++ 14 rows in set (0.02 sec) From this I conclude it is the server setting, which causes the trouble here. When I manipulate the settings manually from the client (with SET character_set_server=utf8; SET collation_server=utf8_general_ci;) the values do change, but not the behaviour. But this can be expected, since the server is already up and running with the wrong settings. Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Before you import at the mysql prompt set below variables and then try again to load set session max_error_count=50; set session collation_database=latin1_swedish_ci; set session character_set_database=latin1; regards anandkl On 8/30/07, Harald Vajkonny [EMAIL PROTECTED] wrote: Hello, I would like to import data from a utf8-coded comma seperated file. I created my database with DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci and I started my mysql-client with the --default-character-set=utf8 option. Nevertheless, when I input primary key fields, which differ only in one umlaut character (e.g. achten and ächten) I get the following error message: ERROR 1062 (23000): Duplicate entry 'ächten' for key 1 (Same thing happens when I try to manually INSERT the row.) When I display my variable settings with SHOW variables LIKE 'c%'; I receive the following result: +--++ | Variable_name| Value | +--++ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results| utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci| | collation_database | utf8_general_ci| | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert| 1 | | connect_timeout | 5 | +--++ 14 rows in set (0.02 sec) From this I conclude it is the server setting, which causes the trouble here. When I manipulate the settings manually from the client (with SET character_set_server=utf8; SET collation_server=utf8_general_ci;) the values do change, but not the behaviour. But this can be expected, since the server is already up and running with the wrong settings. Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Ananda Kumar schrieb: Before you import at the mysql prompt set below variables and then try again to load set session max_error_count=50; set session collation_database=latin1_swedish_ci; set session character_set_database=latin1; This is not what I need, because I use utf8 as well as in the database as in the input file and I do not have any latin1 at all. When I choose latin1 here, indeed, I don't receive an error message, but my data becomes corrupted. When, however, I choose utf8 and utf8_general_ci as session character_set_database and session collation_database, I still get the same error message. :( Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: LOAD DATA INTO doesn't work correctly with utf8
I would like to import data from a utf8-coded comma seperated file. I created my database with DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci and I started my mysql-client with the --default-character-set=utf8 option. Nevertheless, when I input primary key fields, which differ only in one umlaut character (e.g. achten and ächten) I get the following error message: ERROR 1062 (23000): Duplicate entry 'ächten' for key 1 (Same thing happens when I try to manually INSERT the row.) When I display my variable settings with SHOW variables LIKE 'c%'; I receive the following result: +--++ | Variable_name| Value | +--++ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results| utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci| | collation_database | utf8_general_ci| | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert| 1 | | connect_timeout | 5 | +--++ 14 rows in set (0.02 sec) From this I conclude it is the server setting, which causes the trouble here. When I manipulate the settings manually from the client (with SET character_set_server=utf8; SET collation_server=utf8_general_ci;) the values do change, but not the behaviour. But this can be expected, since the server is already up and running with the wrong settings. Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Best regards, H. Try using the SET NAMES 'utf8' statement [1] to tell MySQL that your client is sending data in UTF-8. I believe that as your server is latin1, it will assume this is the character set used by the command line client. [1] http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html Edward -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Edward Kay schrieb: Try using the SET NAMES 'utf8' statement [1] to tell MySQL that your client is sending data in UTF-8. I believe that as your server is latin1, it will assume this is the character set used by the command line client. [1] http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html Edward I tried, but the behaviour remains the same. I guess my first option should be to force the server to use utf8 as default. I would have no problems in doing so, because I hardly use any latin1 anymore. But how would I do so? The mysqld has some options for this, but I didn't manage yet to simply restart it with new options, because it is started somewhere in the init.d-procedure of my Linux system and even as root I cannot simply invoke it from the command line. Best regards, Harald -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Edward Kay napsal(a): I would like to import data from a utf8-coded comma seperated file. I created my database with DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci and I started my mysql-client with the --default-character-set=utf8 option. Nevertheless, when I input primary key fields, which differ only in one umlaut character (e.g. achten and ächten) I get the following error message: ERROR 1062 (23000): Duplicate entry 'ächten' for key 1 (Same thing happens when I try to manually INSERT the row.) When I display my variable settings with SHOW variables LIKE 'c%'; I receive the following result: +--++ | Variable_name| Value | +--++ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results| utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci| | collation_database | utf8_general_ci| | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert| 1 | | connect_timeout | 5 | +--++ 14 rows in set (0.02 sec) From this I conclude it is the server setting, which causes the trouble here. When I manipulate the settings manually from the client (with SET character_set_server=utf8; SET collation_server=utf8_general_ci;) the values do change, but not the behaviour. But this can be expected, since the server is already up and running with the wrong settings. Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Best regards, H. Try using the SET NAMES 'utf8' statement [1] to tell MySQL that your client is sending data in UTF-8. I believe that as your server is latin1, it will assume this is the character set used by the command line client. [1] http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html Edward From my experience SET NAMES doesn't work, but character set of the database must be same as file's character set and this condition is OK. For sure I used script: USE database_with_correct_charset; LOAD DATA ...; And this worked fine for files with cp1250 and also with keybcs2 (I had two databases, of course) HTH, Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
converting some rows from utf-8 to iso-8859-1
if a table column is supposed to contain text in iso-8859-1, but utf-8 encoding have snuck in on a few rows by mistake, how are these rows converted into iso-8859-1? what i am looking for is something like this: update mytable set mycolumn = utf8toiso88591(mycolumn) where id between 500 and 600; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
I used the latin collation and latin db character set, to load data similar to you, and we got this done correctly. If your inserting multi byte data, then u need to set the above parameters. This was one of the solutions give by mysql, i am not able to get the url. I will search my notes and get back to you all. regards anandkl On 8/30/07, Dušan Pavlica [EMAIL PROTECTED] wrote: Edward Kay napsal(a): I would like to import data from a utf8-coded comma seperated file. I created my database with DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci and I started my mysql-client with the --default-character-set=utf8 option. Nevertheless, when I input primary key fields, which differ only in one umlaut character (e.g. achten and ächten) I get the following error message: ERROR 1062 (23000): Duplicate entry 'ächten' for key 1 (Same thing happens when I try to manually INSERT the row.) When I display my variable settings with SHOW variables LIKE 'c%'; I receive the following result: +--++ | Variable_name| Value | +--++ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results| utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | | collation_connection | utf8_general_ci| | collation_database | utf8_general_ci| | collation_server | latin1_swedish_ci | | completion_type | 0 | | concurrent_insert| 1 | | connect_timeout | 5 | +--++ 14 rows in set (0.02 sec) From this I conclude it is the server setting, which causes the trouble here. When I manipulate the settings manually from the client (with SET character_set_server=utf8; SET collation_server=utf8_general_ci;) the values do change, but not the behaviour. But this can be expected, since the server is already up and running with the wrong settings. Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Best regards, H. Try using the SET NAMES 'utf8' statement [1] to tell MySQL that your client is sending data in UTF-8. I believe that as your server is latin1, it will assume this is the character set used by the command line client. [1] http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html Edward From my experience SET NAMES doesn't work, but character set of the database must be same as file's character set and this condition is OK. For sure I used script: USE database_with_correct_charset; LOAD DATA ...; And this worked fine for files with cp1250 and also with keybcs2 (I had two databases, of course) HTH, Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Ananda Kumar schrieb: I used the latin collation and latin db character set, to load data similar to you, and we got this done correctly. If your inserting multi byte data, then u need to set the above parameters. This was one of the solutions give by mysql, i am not able to get the url. I will search my notes and get back to you all. When I load my multibyte data using latin character set and collation, I get the data loaded correctly into the database without error msg, but when I want to display it with SELECT * from table I don't get it displayed correctly, even after I change the settings back to utf8 after the import. Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Does anybody know how I restart my mysql-server with the correct character and collation settings, if this is the cause for my problem, or if there might be any other reason for it. My mysql version is 5.0.26-12, running on a Suse Linux 10.2. Meanwhile I managed to change the server settings by adding the following lines in the [mysqld] section of my /etc/my.cnf: collation_server=utf8_unicode_ci character_set_server=utf8 skip-character-set-client-handshake Now the server also runs with utf8, but when loading the file, I still get the same error message... Regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
strange. did u exit and reconnect and did the select? On 8/30/07, Harald Vajkonny [EMAIL PROTECTED] wrote: Ananda Kumar schrieb: I used the latin collation and latin db character set, to load data similar to you, and we got this done correctly. If your inserting multi byte data, then u need to set the above parameters. This was one of the solutions give by mysql, i am not able to get the url. I will search my notes and get back to you all. When I load my multibyte data using latin character set and collation, I get the data loaded correctly into the database without error msg, but when I want to display it with SELECT * from table I don't get it displayed correctly, even after I change the settings back to utf8 after the import. Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips?
Re: LOAD DATA INTO doesn't work correctly with utf8
Ananda Kumar schrieb: strange. did u exit and reconnect and did the select? Yes, I tried it once more. I have to put the USE command before I change session settings to latin to make it work without error (otherwise I still get the duplicate message). But even after exiting I get the national characters displayed as two (or more) bytes. Regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Harald Vajkonny napsal(a): Ananda Kumar schrieb: strange. did u exit and reconnect and did the select? Yes, I tried it once more. I have to put the USE command before I change session settings to latin to make it work without error (otherwise I still get the duplicate message). But even after exiting I get the national characters displayed as two (or more) bytes. Try to convert file to latin1, if it's possible, create database with latin1 charset, create table with required structure (you can set utf8 charset to string fields ) and then load data. What client do you use to check whether data are OK? I can recommend MySQL Query Browser where I don't have to care about setting charset and collation parameters. HTH, Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Ananda Kumar schrieb: strange. did u exit and reconnect and did the select? Yes, I tried it once more. I have to put the USE command before I change session settings to latin to make it work without error (otherwise I still get the duplicate message). But even after exiting I get the national characters displayed as two (or more) bytes. Regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Dušan Pavlica schrieb: Try to convert file to latin1, if it's possible, create database with latin1 charset, create table with required structure (you can set utf8 charset to string fields ) and then load data. I can not convert the file into latin1, because it is multilingual (i.e. European, Japanese, Korean etc.). What client do you use to check whether data are OK? I can recommend MySQL Query Browser where I don't have to care about setting charset and collation parameters. I checked the file in MySQL Query Browser too, but even there I get it wrong, when I imported it with a latin session. I get it displayed right, when I import it with utf8, but then I have the message with duplicate keys and get only half of the data. Regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Harald Vajkonny napsal(a): Dušan Pavlica schrieb: Try to convert file to latin1, if it's possible, create database with latin1 charset, create table with required structure (you can set utf8 charset to string fields ) and then load data. I can not convert the file into latin1, because it is multilingual (i.e. European, Japanese, Korean etc.). What client do you use to check whether data are OK? I can recommend MySQL Query Browser where I don't have to care about setting charset and collation parameters. I checked the file in MySQL Query Browser too, but even there I get it wrong, when I imported it with a latin session. I get it displayed right, when I import it with utf8, but then I have the message with duplicate keys and get only half of the data. What's the charset and collation of your primary field in the table? Dusan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: InnoDB and RAW Device and autoextend question
Mariella, Mariella Petrini wrote: Hi All, I have been using MySQL 5.1.x with InnoDB and Raw Devices. [mysqld] innodb_data_home_dir= innodb_data_file_path=/dev/hdd1:3Gnewraw;/dev/hdd2:2Gnewraw ... [mysqld] innodb_data_home_dir= innodb_data_file_path=/dev/hdd1:5Graw;/dev/hdd2:2Graw Is there any way to specifiy the autoextend option (...::autoextend) when using Innodb with raw devices for the Shared Tablespace ? sorry, no. We think of the partition as a chunk of storage. It does not extend. Thanks in advance for your help, Mariella Regards, Heikki -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INTO doesn't work correctly with utf8
Dušan Pavlica schrieb: What's the charset and collation of your primary field in the table? With which command do I get the charset and collation information of a single field in a table? SHOW CREATE TABLE returns: ... ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | But I believe it is utf8, because when I enter Japanese or Russian text in this field by INSERT it is displayed right. It just can't distinguish between a, ä or á, but treats it as if they were a. In doing this I got another idea: Does anybody know the difference between the collations utf8_general_ci, utf8_unicode_ci and utf8_bin? I'll try these first and then get back to you about the results. Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: [solved]LOAD DATA INTO doesn't work correctly with utf8
Harald Vajkonny schrieb: In doing this I got another idea: Does anybody know the difference between the collations utf8_general_ci, utf8_unicode_ci and utf8_bin? I'll try these first and then get back to you about the results. That was it. If I choose utf8_bin as collation everything works fine! :) Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: make a slave db a master db
Ananda, The answer to your question is very simple actually, but there is some subtleties that you need to think of. To stop the slave from getting replication data from the master just issue a stop slave command. I would also recommend that you run a reset master command in addition. This will reset the master server information to empty (not pointing anywhere). The reason why it is subtle is that you need to know what state you want your data in. When you issue the stop slave command it breaks the replication with the master with your data on the old slave basically the same as the master. Is that what you really want? If not, you need to take other measures to get your data in the state you want before bringing it online as a standalone server. Hope that helps. Keith What data do you want on the new master? - Original Message - From: Ananda Kumar [EMAIL PROTECTED] To: MySql mysql@lists.mysql.com Sent: Thursday, August 30, 2007 3:37:48 AM (GMT-0500) America/New_York Subject: make a slave db a master db Hi All, We have one master and two slave dbs. Now we want one of the slaves to work as a stand alone master db, so what are the steps that i need to take to make one of the slaves as a stand alone master db. regards anandkl -- B. Keith Murphy Database Administrator iContact 2635 Meridian Parkway, 2nd Floor Durham, North Carolina 27713 blog: http://www.paragon-cs.com/wordpress (o) 919-433-0786 (c) 850-637-3877
Re: make a slave db a master db
Hi Keith, Thanks for the info, Actually, we are moving our db to a new database center, so during one point of time, we will not have access to the old data center (master db), so i want to set up a second slave, and at a specific point in time, make the second slave, a stand alone master db. regards anandkl On 8/30/07, B. Keith Murphy [EMAIL PROTECTED] wrote: Ananda, The answer to your question is very simple actually, but there is some subtleties that you need to think of. To stop the slave from getting replication data from the master just issue a stop slave command. I would also recommend that you run a reset master command in addition. This will reset the master server information to empty (not pointing anywhere). The reason why it is subtle is that you need to know what state you want your data in. When you issue the stop slave command it breaks the replication with the master with your data on the old slave basically the same as the master. Is that what you really want? If not, you need to take other measures to get your data in the state you want before bringing it online as a standalone server. Hope that helps. Keith What data do you want on the new master? - Original Message - From: Ananda Kumar [EMAIL PROTECTED] To: MySql mysql@lists.mysql.com Sent: Thursday, August 30, 2007 3:37:48 AM (GMT-0500) America/New_York Subject: make a slave db a master db Hi All, We have one master and two slave dbs. Now we want one of the slaves to work as a stand alone master db, so what are the steps that i need to take to make one of the slaves as a stand alone master db. regards anandkl -- B. Keith Murphy Database Administrator iContact 2635 Meridian Parkway, 2nd Floor Durham, North Carolina 27713 blog: http://www.paragon-cs.com/wordpress (o) 919-433-0786 (c) 850-637-3877
Calendar event query
Hi friends, I need to make a calendar with some events. I have created an events table with the parameters like: eventid event_from event_till recurring recurring_after_day event_type userid and so on. My problem is to prepare a query which can give me events on a particular day or rather all days(in case of calendar view is daily) ,months(if view is monthly) and so on for year week including for events which are repeated also, so that i can show that on my calendar.The query will run on a fairly large no of users also so it should be efficient. I think the catch is about the recurring events. As for them the entry will be in one row and they will have virtually many rows one for each recurring event. So i want somthing like this for a particular userid : event_on count(*) event_type 235 7 237 8 246 6 254 6 26 10 6 27 15 . Pl. help me Thanks, Abhishek jain
Re: converting some rows from utf-8 to iso-8859-1
On Thu, 30 Aug 2007 11:41:14 +0200, Olav Mørkrid [EMAIL PROTECTED] said: if a table column is supposed to contain text in iso-8859-1, but utf-8 encoding have snuck in on a few rows by mistake, how are these rows converted into iso-8859-1? what i am looking for is something like this: update mytable set mycolumn = utf8toiso88591(mycolumn) where id between 500 and 600; I don't know if mysql has this charset converting routine. But you can do it by application scripts,ie,in perl you can convert them by, use Encode; my $iso_str = encode('iso-8859-1',decode('utf8',$utf8_str)); first you select utf8 string from db one by one and store it to $utf8_str,then use the function above to be converted to iso-8859-1,then insert it again to mysql. -- Ken Peng [EMAIL PROTECTED] -- http://www.fastmail.fm - Accessible with your email software or over the web -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: [solved]LOAD DATA INTO doesn't work correctly with utf8
Hi Harald, So you set the collation_database=utf8_bin, what was your character_set_database values. regards anandkl On 8/30/07, Harald Vajkonny [EMAIL PROTECTED] wrote: Harald Vajkonny schrieb: In doing this I got another idea: Does anybody know the difference between the collations utf8_general_ci, utf8_unicode_ci and utf8_bin? I'll try these first and then get back to you about the results. That was it. If I choose utf8_bin as collation everything works fine! :) Best regards, H. -- Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]