MySQL and Unicode
Hi, I have a question. I have read that since MySQL 4.1, VARCHAR type can hold unicode characters. But, it seems that the API of the C library use to send queries to the server still use 'const char*' for the type of the query. So, praticaly, if I have a unicode string stored in C, how can I use it with the C API? Thanks. -- Prof. Pascal Francq Université Libre de Bruxelles CAD/CAM Department Avenue F.D. Roosevelt, 50 CP 165/14 B-1050 Brussels BELGIUM Tel. +32-2-650 47 65 Fax +32-2-650 47 24 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Killing overactive mysql selects
Every now and then I am not thking and I am working on the mysql shell and I send it a select name from table; Just so happens there are a few hundred K of records. What I meant to do is LIMIT 10; Anyway, how do I get mysql to stop, the best I can do is control-C, but that leaves mysql altogether and I have to log back in again. Also, sometimes I am able to use the tab key to auto-complete field and table names, this is really handy, sometimes it works and sometimes not, how do I get this all the time? -- - Scott HanedaTel: 415.898.2602 http://www.newgeo.com Fax: 313.557.5052 [EMAIL PROTECTED]Novato, CA U.S.A. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Killing overactive mysql selects
Start another Mysql shell session; then do show processlist; identify the thread ID of the offending process, then do kill ID. Not sure how graceful this method is, though. I use it to kill overlooked hanging connections from time to time. Cheers, Vadim. Scott Haneda wrote: Every now and then I am not thking and I am working on the mysql shell and I send it a select name from table; Just so happens there are a few hundred K of records. What I meant to do is LIMIT 10; Anyway, how do I get mysql to stop, the best I can do is control-C, but that leaves mysql altogether and I have to log back in again. Also, sometimes I am able to use the tab key to auto-complete field and table names, this is really handy, sometimes it works and sometimes not, how do I get this all the time? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL and Unicode
Hi, I have a question. I have read that since MySQL 4.1, VARCHAR type can hold unicode characters. But, it seems that the API of the C library use to send queries to the server still use 'const char*' for the type of the query. So, praticaly, if I have a unicode string stored in C, how can I use it with the C API? Thanks. I use unicode(UTF-8) strings as following. mysql_query( mysql, SELECT inlude Japanese characters(KANJI) ); I think that this might answer your question. Hirofumi Fujiwara (Tokyo JAPAN) enjoy JAVA and Puzzle World [EMAIL PROTECTED]http://www.pro.or.jp/~fuji/index-eng.html [EMAIL PROTECTED] Puzzle Japanhttp://www.puzzle.jp/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Inserting blob
Env: Win2003 Server, MySql 4.17 I've the following table CREATE TABLE TabellaTipi ( id int unsigned NOT NULL AUTO_INCREMENT, intero int, lungo bigint, decimale decimal(20,10), data datetime, stringa varchar(100), booleano tinyint unsigned, blobDati longblob, primary key (id) )TYPE=InnoDB; With a .Net application I'm developing I'm not able to insert a blob bigger than 500Kb in the table. I connected to MySql both natively and through ODBC but the result is always the same. I think the problem should be in the configuration of MySql service. Any suggestion? TIA Marco Paci Marco Paci Divisione Gestionale Tecnologia PASSEPARTOUT s.a. Via Monaldo da Falciano, 3 - 47891 Falciano (Rep. San Marino) Tel. 0549.877910 From Abroad. +378 877910 [EMAIL PROTECTED]www.passepartout.sm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: problem wil insert statement merging values
* dan orlic INSERT INTO cp.Items SELECT distinct g.RecordID as id,'' as category_id, '' as pattern_id,'' as manufacturer_id, g.Item + g.Desc1 + g.Desc2 + g.Desc3 as description, g.Desc4 as price,0 as quantity, '' as comments,'Active' as status,'n' AS is_bridal, 'Gallery' AS type, now() as created, now() as last_modified FROM copperlamp.Items g order by g.RecordID asc; and it does not error out, but there are problems with this... for example: ... g.Desc4 as price ... g.Desc4 ($500.00) is a varchar and price is a BigDecimal(10.2). but when it gets inserted the value is 0.00 for every field The string $500.00 is easily identified as a price for a human, but mysql don't know that $ means money. In general mysql will try to convert a string to a number if the string is used in a numeric context, but a string starting with $ is not identified as a number: mysql select $500.00+0,500.00+0,mid($500.00,2)+0; +-+++ | $500.00+0 | 500.00+0 | mid($500.00,2)+0 | +-+++ | 0 |500 |500 | +-+++ 1 row in set (0.00 sec) You could use MID(g.Desc4,2) in your statement to make mysql ignore the $ character. that's one the other is: ...g.Item + g.Desc1 + g.Desc2 + g.Desc3 as description ... but though they are all varchars i can't seem to incorporate all the values into that one field. any thoughts would be great. See the CONCAT() function: URL: http://dev.mysql.com/doc/mysql/en/String_functions.html#IDX1246 CONCAT(g.Item,g.Desc1,g.Desc2,g.Desc3) as description Often one would like a space between the columns that are concatenated, in that case CONCAT_WS() is what you want: CONCAT_WS(' ',g.Item,g.Desc1,g.Desc2,g.Desc3) as description -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Dual-master setup
Hi, When configurating a dual master setup do I need to set parameter log-slave-updates ? /J _ Hitta rätt på nätet med MSN Sök http://search.msn.se/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL and Unicode
OK, you use a C char* using an UTF-8 encoding. On Friday 09 April 2004 11:45, Hirofumi Fujiwara wrote: Hi, I have a question. I have read that since MySQL 4.1, VARCHAR type can hold unicode characters. But, it seems that the API of the C library use to send queries to the server still use 'const char*' for the type of the query. So, praticaly, if I have a unicode string stored in C, how can I use it with the C API? Thanks. I use unicode(UTF-8) strings as following. mysql_query( mysql, SELECT inlude Japanese characters(KANJI) ); I think that this might answer your question. Hirofumi Fujiwara (Tokyo JAPAN) enjoy JAVA and Puzzle World [EMAIL PROTECTED]http://www.pro.or.jp/~fuji/index-eng.html [EMAIL PROTECTED] Puzzle Japanhttp://www.puzzle.jp/ -- Prof. Pascal Francq Université Libre de Bruxelles CAD/CAM Department Avenue F.D. Roosevelt, 50 CP 165/14 B-1050 Brussels BELGIUM Tel. +32-2-650 47 65 Fax +32-2-650 47 24 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL and Unicode
Pascal Francq wrote: OK, you use a C char* using an UTF-8 encoding. That's very commmon in the Unix world. 2-byte encodings are very rare on Unix-like systems, for compatibility reasons. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Best practice on table design
Hi Ciprian, OK, I'm by no means a DB guru, so a) take this with a grain of salt and b) feel free to tear it apart if I'm completely wrong! ;] If in fact your people and city tables aren't going to change very often, then why don't you just go all the way and keep that information somewhere else in your application and write it straight to your travel_expenditures table, e.g.: travel_expenditures --- | id | date | people| city| per_diem | --- | 1 | 05.08 | John | Glasgow |1.600 | | 2 | 05.09 | Mary | Madrid |2.000 | | 3 | 06.12 | John | Madrid |1.000 | --- This way you completely avoid any JOINs. Of course, this only makes sense if your people and cities information is not likely to change much at all... Thursday, April 8, 2004, 3:29:22 AM, you wrote: CT Hello, CT I have the following structure: CT people CT - CT | id | name | CT - CT | 1 | John | CT | 2 | Mary | CT - CT cities CT CT | id | city| CT CT | 1 | Glasgow | CT | 2 | Madrid | CT | 3 | Berlin | CT CT travel_expenditures CT --- CT | id | date | id_people | id_city | per_diem | CT --- CT | 1 | 05.08 | 1 | 1 |1.600 | CT | 2 | 05.09 | 2 | 3 |2.000 | CT | 3 | 06.12 | 1 | 2 |1.000 | CT --- CT The `people` and `cities` tables aren't going to be very populated, so a CT thought to merge them into something like this: CT central_data CT --- CT | id | name| type | CT --- CT | 1 | John| P| CT | 2 | Glasgow | C| CT | 3 | Mary| P| CT | 4 | Madrid | C| CT | 5 | Berlin | C| CT --- CT where central_data.type is P for people and C for cities. CT Do you think it is a good ideea ? CT -- CT Best regards, CT Ciprian Trofin -- Best regards, Carsten R. Dreesbach mailto:[EMAIL PROTECTED] Senior Consultant Systar, Inc. 8000 Westpark Dr Suite 450 McLean, VA 22102 USA Tel: (703) 556-8436 Fax: (703) 556-8430 Cel: (571) 213-7904 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL on Linux
%% Dan Nelson [EMAIL PROTECTED] writes: dn That is because although Linux binaries can access files over 2gb, dn they do not do so by default. Apache was probably not compiled dn with the required defines (-D_LARGEFILE_SOURCE dn -D_FILE_OFFSET_BITS=64), so that's why it stops at 2gb even though dn both the kernel and filesystem most likely do support larger dn files. Just to point out this (needing extra compile flags to get large file support) is not unique to Linux. Most OSs require these kinds of flags; Solaris for example also requires special flags to get LFS. -- --- Paul D. Smith [EMAIL PROTECTED] HASMAT--HA Software Mthds Tools Please remain calm...I may be mad, but I am a professional. --Mad Scientist --- These are my opinions---Nortel Networks takes no responsibility for them. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Configuring SuSE Pro 9.0, MySQL 4.0.18 with ssl
[EMAIL PROTECTED] wrote: We have been looking and looking for some guidance for installing MySQL with SSL on a SuSE 9.0 box. By searching the archives, the net using Google, etc., we keep finding pieces of the puzzle, but no single piece that covers all of the ground. The problem is that we seem to complete the install, but cannot seem to have the ssl-enabled show 'yes'. Any help that you can offer would be appreciated very much. Did you install MySQL as described at the following section of manual? http://dev.mysql.com/doc/mysql/en/Secure_requirements.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How can I make index block size all the same?
Hi! On Apr 08, Haitao Jiang wrote: Why Mysql load index ... into cache require the same size index block when it creates indexes in different block sizes (1k or 2k)? I don't understand. It's limitation of the current implementation :( It reads MYI file successively by fixed chunks (multiple of block size) and inserts blocks into the keycache. It's much faster than traversing index tree. Buf if different indexes have different block sizes, this method does not work, as a block has no header and there is no way to find what its size and where the next block begins. In the future LOAD INDEX ... will be extended to allow preloading only some indexes, and not all the file. Then it will be possible to load indexes of different block lengths. Regards, Sergei -- __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Sergei Golubchik [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer /_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Select inside a subquery
I ahve a problem with updating a row using a field from another row in the same table. The mySQL manual says: Error 1093 (ER_UPDATE_TABLE_USED) SQLSTATE = HY000 Message = You can't specify target table 'x' for update in FROM clause This error will occur in cases like this: UPDATE t1 SET column2 = (SELECT MAX(column1) FROM t1); It's okay to use a subquery for assignment within an UPDATE statement, since subqueries are legal in UPDATE and DELETE statements as well as in SELECT statements. However, you cannot use the same table, in this case table t1, for both the subquery's FROM clause and the update target. So what is the best way to do something like UPDATE accounts SET balance = balance + (SELECT balance FROM accounts WHERE userID = 100) WHERE userID = 101 Russell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Better Solution than Multiple Queries?
I have an application where I want to look for records that match certain criteria and then for each item found do a second lookup for additional information. Normally I would do a join. In this case however I want to display each of the results from the first of the two criteria whether or not the second part is found or not. The solution I presently have does a query for the first criteria. Then, I loop through the results of that query and do another query for each returned row. This produces the desired results but requires a lot of queries, i.e.-- if the first query returns 1000 customers then I make 1000 additional queries to get the remaining info if it exists. result1 = first query for each row in result1 { result2 = second query display result1 if result2 isn't empty then { display result2 } } Is there a more efficient way to query the database and always display the information I presently get from the first query even if there are no matches found on the second? Thanks for any suggestions. Tim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Better Solution than Multiple Queries?
Can you create a 'fact' table containing the infomration that you are querying? This goes against normalization but if the table will only be used for querying purposes then this will eliminate your need to perform joins. -Original Message- From: Tim McDonough To: [EMAIL PROTECTED] Sent: 4/9/04 8:20 AM Subject: Better Solution than Multiple Queries? I have an application where I want to look for records that match certain criteria and then for each item found do a second lookup for additional information. Normally I would do a join. In this case however I want to display each of the results from the first of the two criteria whether or not the second part is found or not. The solution I presently have does a query for the first criteria. Then, I loop through the results of that query and do another query for each returned row. This produces the desired results but requires a lot of queries, i.e.-- if the first query returns 1000 customers then I make 1000 additional queries to get the remaining info if it exists. result1 = first query for each row in result1 { result2 = second query display result1 if result2 isn't empty then { display result2 } } Is there a more efficient way to query the database and always display the information I presently get from the first query even if there are no matches found on the second? Thanks for any suggestions. Tim -- 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: MySQL on Linux
Perhaps stated a bit more correctly: Apache is NOT unique to Linux, so any system using Apache would need this configuration, that would include windows, MAC OS, Solaris, Irix, etc. Can't blame the OS on a softwares requirements... Dan. At 08:07 AM 4/9/2004, Paul Smith wrote: %% Dan Nelson [EMAIL PROTECTED] writes: dn That is because although Linux binaries can access files over 2gb, dn they do not do so by default. Apache was probably not compiled dn with the required defines (-D_LARGEFILE_SOURCE dn -D_FILE_OFFSET_BITS=64), so that's why it stops at 2gb even though dn both the kernel and filesystem most likely do support larger dn files. Just to point out this (needing extra compile flags to get large file support) is not unique to Linux. Most OSs require these kinds of flags; Solaris for example also requires special flags to get LFS. -- --- Paul D. Smith [EMAIL PROTECTED] HASMAT--HA Software Mthds Tools Please remain calm...I may be mad, but I am a professional. --Mad Scientist --- These are my opinions---Nortel Networks takes no responsibility for them. -- 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: Better Solution than Multiple Queries?
* Tim McDonough I have an application where I want to look for records that match certain criteria and then for each item found do a second lookup for additional information. Normally I would do a join. In this case however I want to display each of the results from the first of the two criteria whether or not the second part is found or not. Sounds like a job for a LEFT JOIN... if not, why? -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Better Solution than Multiple Queries?
I have an application where I want to look for records that match certain criteria and then for each item found do a second lookup for additional information. Normally I would do a join. In this case however I want to display each of the results from the first of the two criteria whether or not the second part is found or not. A LEFT JOIN will also include the records in the left table even if there is no corresponding in the 'right' table and fill the empty fields with NULL values. Maybe this is what you're looking for? Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Dumping mass inserts?
I'm trying only to update one table from a backup. I have the sql file stripped down to just the INSERT commands. I have emptied the table from phpMyadmin to start. How do I load this sql file so it runs all of the inserts in this file through ssh (70MB)? Mark Súsol --- u l t i m a t e CreativeMedia Web | Print | CD Media | eCommerce www.ultimatecreativemedia.com Ph: 301-668-0588 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: disabling backslash as an escape character in strings
Yes, I use JDBC (with the MySQL Connector/J driver). I did not find a way in the JDBC API to escape a string before inserting it in a SQL string. The JDBC PreparedStatement class is able to escape parameters (in a database specific way) with the setString(parameterIndex, string) method, but it's designed for hard-coded insert/update queries. I use a custom function to generate queries that updates only fields that need to be updated, so I can't use PreparedStatement (unless I make my code hard to read/modify). The setString() method must be calling a MySQL specific escape function internally, but I don't know if there's something in JDBC to call that function directly or of it is private. Any ideas? Joshua J. Kugler wrote: Are you using a high level library such as Perl::DBI? If so, you should run all your strings the quote method. That will quote it properly for each database you connect to. If you are connecting to all the databases yourself using custom code, I would recommend you find some database neutral libraries and go from there. j- k- On Thursday 08 April 2004 01:37 pm, Christos Karras said something like: Is there a way to disable the use of the backslash as an escape character in strings? I need to use an application that's designed to work on any database server supporting ANSI SQL. When it generates SQL insert/update queries, it doesn't escape backslashes in strings, because the ANSI SQL standard doesn't require backslashes to be escaped. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dumping mass inserts?
On Friday 09 April 2004 09:52 am, Mark Susol | Ultimate Creative Media wrote: I'm trying only to update one table from a backup. I have the sql file stripped down to just the INSERT commands. I have emptied the table from phpMyadmin to start. How do I load this sql file so it runs all of the inserts in this file through ssh (70MB)? FTP the sql file to the machine/account that you are ssh'ing into. Then do mysql -u username -p databasename sql_file_to_load James -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Inserting blob
I found a place that say MYSQL has a limit for the size off the packet in relation with blob field. They say that you need to put this in the my.cnf set-variable = max_allowed_packet=15M. With that you increase the size to 15 mb You can go and check the code in http://www.mysql-hispano.org/page.php?id=20pag=2 Osvaldo Sommer -Original Message- From: Marco Paci [mailto:[EMAIL PROTECTED] Sent: Friday, April 09, 2004 3:41 AM To: [EMAIL PROTECTED] Subject: Inserting blob Env: Win2003 Server, MySql 4.17 I've the following table CREATE TABLE TabellaTipi ( id int unsigned NOT NULL AUTO_INCREMENT, intero int, lungo bigint, decimale decimal(20,10), data datetime, stringa varchar(100), booleano tinyint unsigned, blobDati longblob, primary key (id) )TYPE=InnoDB; With a .Net application I'm developing I'm not able to insert a blob bigger than 500Kb in the table. I connected to MySql both natively and through ODBC but the result is always the same. I think the problem should be in the configuration of MySql service. Any suggestion? TIA Marco Paci Marco Paci Divisione Gestionale Tecnologia PASSEPARTOUT s.a. Via Monaldo da Falciano, 3 - 47891 Falciano (Rep. San Marino) Tel. 0549.877910 From Abroad. +378 877910 [EMAIL PROTECTED]www.passepartout.sm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.648 / Virus Database: 415 - Release Date: 3/31/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.648 / Virus Database: 415 - Release Date: 3/31/2004 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dumping mass inserts?
Mark Susol|Ultimate Creative Media [EMAIL PROTECTED] wrote: I'm trying only to update one table from a backup. I have the sql file stripped down to just the INSERT commands. I have emptied the table from phpMyadmin to start. How do I load this sql file so it runs all of the inserts in this file through ssh (70MB)? mysql -h host_name -u user_name -p database_name file.sql -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
auto next field
We have a DB of customer comments that we want to display one at a time on our web site. We want the web pages (wrote in php) to use a user name/password on the DB that has SELECT ability and that's it. What's the best way to cycle through the comments so that each page requested gets the next comment to be displayed without writing the current display number back to the database? Of course I could store it in a file or something, but I was hoping for a clean mysql solution. Like a LAST_INSERT_ID( ), only I'm looking for a LAST_SELECTED_ID( ) and then I'd select the next ID available. Thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
auto next row (was: auto next field)
Just realized my subject wasn't correct, we don't want the next field, we want the next row... Thanks! We have a DB of customer comments that we want to display one at a time on our web site. We want the web pages (wrote in php) to use a user name/password on the DB that has SELECT ability and that's it. What's the best way to cycle through the comments so that each page requested gets the next comment to be displayed without writing the current display number back to the database? Of course I could store it in a file or something, but I was hoping for a clean mysql solution. Like a LAST_INSERT_ID( ), only I'm looking for a LAST_SELECTED_ID( ) and then I'd select the next ID available. Thanks! -- 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]
Replication slaves quitting with binlog error
Hi all-- We have one master and 12 slaves replicating from it. Server is 4.0.16 (havn't wanted to take it down to upgrade), the slaves are 4.0.17, all running on RedHat AS. Lately, every few hours one of the machines caughs up this error, and quits replicating: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. It's complaining about a corrupted relay-log, but it's always only one machine at a time. When I run 'mysqlbinlog offending relay-log-file' it gives me the following error: ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 396, event_type: 2 ERROR: Could not read entry at offset 60096864 : Error in log format or read error The offending log in the current case is _not_ the last one, so the IO thread is appearently still functional. The only fix I know is to blow away the data on the slaves and start again with a fresh snapshot (including master.info). As far as I know there's no disk problems (all servers less than a year old, and lots of space available). Any thoughts? -Matt- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: auto next row (was: auto next field)
We have a DB of customer comments that we want to display one at a time on our web site. We want the web pages (wrote in php) to use a user name/password on the DB that has SELECT ability and that's it. What's the best way to cycle through the comments so that each page requested gets the next comment to be displayed without writing the current display number back to the database? Of course I could store it in a file or something, but I was hoping for a clean mysql solution. Like a LAST_INSERT_ID( ), only I'm looking for a LAST_SELECTED_ID( ) and then I'd select the next ID available. You could do something like this: $start = 0; if (isset($_GET['start'])) { $start = 1 * $_GET['start']; //make sure it's numerical } then query: SELECT .. FROM .. ORDER BY date LIMIT $tart, 1 display the comment $start++; provide a link to thispage.php?start=$start Regards, Jigal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Better Solution than Multiple Queries?
Tim McDonough writes: The solution I presently have does a query for the first criteria. Then, I loop through the results of that query and do another query for each returned row. This produces the desired results but requires a lot of queries, i.e.-- if the first query returns 1000 customers then I make 1000 additional queries to get the remaining info if it exists. Another possible solution would be to create the secondary queries utilizing the IN (...) criteria? You would run the first query, then build one or more queries using the returned values as references for the IN portion of the second query. This would allow you to have a much smaller number of secondary queries. Brad Eacker ([EMAIL PROTECTED]) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dumping mass inserts?
On Friday 09 April 2004 09:52 am, Mark Susol | Ultimate Creative Media wrote: I'm trying only to update one table from a backup. I have the sql file stripped down to just the INSERT commands. I have emptied the table from phpMyadmin to start. How do I load this sql file so it runs all of the inserts in this file through ssh (70MB)? FTP the sql file to the machine/account that you are ssh'ing into. Then do mysql -u username -p databasename sql_file_to_load James I'm doing that, but its echoing inserts that are not in that sql file. I don't have any other sql file by the name I'm trying to load. Mark -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Hey what, no pity for a new user?
That didn't work but it led to something that did. It turned out that the owning group didn't have full authorization in the data folder. So, I did a brute force approach. I made mysql the owner of everything, instead of root, made mysql the group of everything (which it already was), then made the group privileges equal to the owner privileges (of everything). It worked. Do you foresee it leading to problems or security risks? Thanks again for your response! On Apr 8, 2004, at 9:01 AM, Paul DuBois wrote: At 8:29 -0600 4/8/04, Kevin Jaques wrote: Thanks for the reply. I feel it is getting me somewhere, but I'm not there yet. The log said, regarding the most recent attempt: 040407 09:55:24 mysqld started 040407 9:55:25 InnoDB: Operating system error number 13 in a file operation. InnoDB: See http://www.innodb.com/ibman.html for installation help. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: File operation call: 'create'. InnoDB: Cannot continue operation. 040407 09:55:25 mysqld ended What directory is it referring to? What user/group does mysqld need? I The data directory, as you indicate that you already know below. The user account that is relevant here is whatever account you use for running the server. I will suppose that this is mysql on your system? referred to the web site it mentioned, and the page was enormous without an apparent section on installation or authorization issues. A search revealed that it thought the mysql server should have access to 'datadir'. Well, duh. My data directory shows: [iMac-dv:local/mysql/data] kj% ls -al total 8 drwxr-x--- 5 root wheel 170 5 Apr 08:03 ./ drwxr-xr-x 20 root wheel 680 10 Feb 13:05 ../ -rw-rw 1 mysql wheel 2234 7 Apr 09:55 iMac-dv.local.err drwxr-x--- 20 root wheel 680 10 Feb 13:05 mysql/ drwxr-x--- 2 root wheel68 10 Feb 13:05 test/ So, what now? This shows that it's owned by root/wheel. You want it to be owned by mysql/some-group. I don't know what group that will be for you. mysql? Anyway, in that directory, run this command as root: chown -R mysql . That changes the ownership of the directory and everything under it to mysql. Then restart the server, either from the mysql account, or as root with the --user=mysql option. -- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com MySQL Users Conference: April 14-16, 2004 http://www.mysql.com/uc2004/ -- Sincerely, Kevin Jaques (at home) Use [EMAIL PROTECTED] for work related messages Send lawyers, guns and money! Dad get me out of this! - Warren Zevon -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: auto next row (was: auto next field)
You could do something like this: $start = 0; if (isset($_GET['start'])) { $start = 1 * $_GET['start']; //make sure it's numerical } then query: SELECT .. FROM .. ORDER BY date LIMIT $tart, 1 display the comment $start++; provide a link to thispage.php?start=$start Regards, Jigal. they comment count has to be persistent across all sessions, not just the current one. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dumping mass inserts?
On Friday 09 April 2004 11:40 am, Mark Susol | Ultimate Creative Media wrote: On Friday 09 April 2004 11:29 am, you wrote: I'm not getting an error..I'm getting inserts that are NOT in the file I'm directing it to dump. Maybe I don't understand the dump function and how it works with a sql file that is only partially acting on the entire table? Fedora OK, dump usually refers to the act of creating SQL statements from a table into a file. You are trying to process a file that has SQL statements in it. I would call this importing. This is what you are trying to do isn't it? Please give an example of the command you are running. James Ah..I see now. I was still using mysqldump..instead of mysql. Yes I'm trying to import the data from backup, into an empty table since the data was corrupt. Looks like you are on the right track now! :) James -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dual-master setup
sdf sdf [EMAIL PROTECTED] wrote: When configurating a dual master setup do I need to set parameter log-slave-updates ? MySQL supports only one master for slave. What do you mean dual master setup? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Dumping mass inserts?
Ah..I see now. I was still using mysqldump..instead of mysql. Yes I'm trying to import the data from backup, into an empty table since the data was corrupt. Looks like you are on the right track now! :) James Ok now I want to dump tables with names starting with phpads so I can move them to another db. How is the mysqldump command run then? And when I go to move them to the new db, I do use the mysqldump command since I am dumping to the new db? Mark -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Perl Modelues
Michael: Thanks. It did the trick. Kirti -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 6:32 PM To: Kirti S. Bajwa Cc: [EMAIL PROTECTED] Subject: Re: Perl Modelues Kirti S. Bajwa wrote: Ken: Thank you for your response. I tried the 'mysql_config' command and got an error message. I will add 'mysql_config' to the path (if I figure out how!!!). You need to add the directory which contains mysql_config to your path. Adding to your PATH isn't difficult, but the method depends on your shell. You can find your shell with echo $SHELL I noticed that on my installation the 'mysql_config' is in '/usr/local/mysql/bin' directory whereas you have indicated that it should be in '/usr/local/bin' directory! Please clarify!! /usr/local/mysql/bin is fine. With tcsh, you can add this to your path with set path=($PATH /usr/local/mysql/bin) With sh or bash, you should be able to add this to your path with export PATH=$PATH:/usr/local/mysql/bin Either way, you should probably also add this to the appropriate shell startup file, so mysql is always in your path. You can check your path with echo $PATH Two more questions: (1) Since I have done partial installation, would it hurt if I re-do the entire Perl instalation or start from the command where the errors were encountered? You didn't break anything, you just didn't succeed in adding the module. Just go back into CPAN and try again. I'd suggest perl -MCPAN -e shell install Bundle::DBI install Bundle::DBD::mysql Installing the bundles will make sure you have everything you need. As you've already installed DBI, you'll already have most of what the bundles contain, and CPAN is smart enough not to reinstall what you already have. (2) I also have two Client MySQL servers (which connect to master MySQL server for data). Do I also need to install Perl on these Client MySQL Servers? I'm not sure what you mean by Client MySQL servers. Do you mean machines which need the mysql client to connect to the machine running the mysql server, or do you mean machines which will run the mysql server as slaves to the master server? In any case, you can run the mysql server and client without perl. On the other hand, a number of the helper apps in /usr/local/mysql/bin are perl scripts. Of course, you will need to install perl on any machine where you want to use perl to connect/manipulate your mysql data, and perl is handy to have around in general. Please remember, I am an IBM mainframe guy my knowledge of LINUX related soft is pretty low on scale. Thanks. Kirti Michael -- 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]
Am I doing things right? (selecting groups of objects problems)
Hello, I've recently came across a problem I couldn't seem to solve right by myself. I have a db with objects table, each of those objects may belong to groups of objects. The number of groups can be about 256 and an object belongs from one to many different groups at once. I cannot find a good way to store/select information about groups for objects that belong to several groups. My first idea was to put a 'groups' column and keep there the id_numbers of groups to which particular object belongs to (with separators). So the groups column would have values like '100,203,204,208' etc. Of course this is not the right way to do it as those values are not atom and the lenght of the field may easily grow out of tinytext length type I was using... It worked ok though for small number of groups and objects though I know this was a perfect example of how *not* do do it in a RDB... If I wanted an object that belonged to 2 groups (100 and 203 for example) I would do SELECT [...] LIKE '%100%203%'. My next attempt was to create separate table with object_id and group_id column, this way an object that belongs to many groups would have several rows in the table. If I wanted to know what are the groups that my object belongs to - a piece of cake. But things get really rough if I want to get objects that (for example) belong to two particular (1 2) groups. I would go with something like that: SELECT DISTINCT(g1.object_id) FROM connecting_table as g1, connecting_table as g2 WHERE g1.group_id = 1 AND g2.group_id = 2 AND g1.object_id = g2.object_id; But this is getting more and more complex if I want to select objects that belong to 3, 4 and N groups at once :/ The first solution although very ugly seems to be much more clearer (and maybe even more efficient for groupn number of 2+?). My working solution for now is to have a separate table with object_id and groups_id1 column of INT type, I have assigned the first 31 existing groups to corresponding bits of the INT field. That is if I want to select objects that belong to the groups that have ids of 1,3,5 and 26 i would set the bits nr 1,2,4 and 26 of a variable $MY_INT and then query: SELECT object_id,groups_id1 FROM connecting_table WHERE BIT_COUNT(groups_id1 $MY_INT) = 4; this seems to give me what I want but now if I want to add next 31 groups I need to create another groups_id2 column and things again get a bit complicated - I need now to check in which column the current group flag I need to find out may be stored and act accordingly (so groups with id 1-31 in column groups_id1, groups 32-63 in groups_id2 etc). Not a big problem and this solutions seems to be quite cheap (is it?) but somehow I am feeling there is a better way to do all this... Sorry for this long letter I hope I have managed to put the problem straight, I may miss something obvious here but as I said I have limited knowledge about sql. I would be much grateful for any tips. Lecho -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Issue compiling mysql with ssl on solaris
Ok i worked out a possible bug with mysql 4.1 compiling openssl on solaris i keep getting this error gcc -DDEFAULT_CHARSET_HOME=\/usr/local/mysql\ -DDATADIR=\/usr/local/mysql /var \ -DSHAREDIR=\/usr/local/mysql/share/mysql\ -DDONT_USE_RAID -I. -I. -I.. -I.. /include /opt/csw/include/openssl -O3 -DDBUG_OFF -D_FILE_OFFSET_BITS=64 -DHAVE_R WLOCK_T -c libmysql.c -MT libmysql.lo -MD -MP -MF .deps/libmysql.TPlo -fPIC -DP IC -o .libs/libmysql.lo sparc-sn-solaris2.8-gcc: cannot specif -o with -c or -S and multiple compilation s *** Error code 1 make: Fatal error: Command failed for target `libmysql.lo' Current working directory /usr/share/src/mysql-4.1.1-alpha/libmysql_r *** Error code 1 make: Fatal error: Command failed for target `all-recursive' Current working directory /usr/share/src/mysql-4.1.1-alpha *** Error code 1 make: Fatal error: Command failed for target `all' my configure is ./configure --prefix=/usr/local/mysql --with-openssl-includes=/opt/cs w/include/openssl --with-openssl-libs=/opt/csw --without-docs --with-libwrap =/us r --with-mysqld-user=mysql -with-pstack --enable-thread-safe-client what seems to be the problem ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Using BYTEFX to connect to MySql , closing connection do not release the connection.
Looks like it could be a bug. I'll check it out. -Original Message- From: tweewan.wong [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 8:13 PM To: [EMAIL PROTECTED] Subject: RE: Using BYTEFX to connect to MySql , closing connection do not release the connection. Thanks reggie, implement that and tested the scenario as per my first email, it work the desired way as per you have expected and suggested. My feeling about the second scenario is that it is a bug. Try this link and search for the exception text: http://cvs.sourceforge.net/viewcvs.py/mysqlnet/mysqlclient/MySqlPoolManage r. cs?rev=1.4 it has been great help! :-)TweeWan -Original Message- From: Reggie Burnett [mailto:[EMAIL PROTECTED] Sent: 08 April 2004 22:23 To: 'tweewan.wong'; [EMAIL PROTECTED] Subject: RE: Using BYTEFX to connect to MySql , closing connection do not release the connection. I'm not sure why this is happening, but the behavior you described in the first email is correct pooling behavior. By default, connection pooling is enabled which means connections are not killed when they are closed but remain open and able to serve new connections if necessary. Only when the app quits is the pool manager collected and the connections killed. If this is not desired, you can add pooling=false to your connection string. -reggie -Original Message- From: tweewan.wong [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 6:44 AM To: [EMAIL PROTECTED] Subject: RE: Using BYTEFX to connect to MySql , closing connection do not release the connection. More information to add : Am using Bytefx 0.76 : I simplify the testing by using frmA call frmB. In frmB, I do the following : Private Sub frmB_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try xx = New MySqlConnection xx.ConnectionString = Data Source=127.0.01; _ Database=good; _ User ID=root; _ Password=; xx.Open() xx.Close() xx.ConnectionString = xx.Dispose() MsgBox(Closed) Catch ex As Exception MsgBox(Err.Number ex.Message) End Try End Sub In frmA, I have this tied to a button Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As frm_single frm = New frm_single frm.Show() End Sub I press button1 in frmA, when frmB shows up, I close frmB, I press button1 again in frmA and I get the following error: Pooling exception: Unable to find original pool for connection Regards TweeWan -Original Message- From: tweewan.wong [mailto:[EMAIL PROTECTED] Sent: 07 April 2004 15:02 To: [EMAIL PROTECTED] Subject: Using BYTEFX to connect to MySql , closing connection do not release the connection. Hi, Encounter an interesting here using VB.NET with ByteFx.mysql.mysqlclient to connect to Mysql Database. I have a sub-form (called from another main form) with 4 mysqlconnections declared and new. X1= new mysqlconnection X1.connectionstring = a valid connection string X1.open() X2= new mysqlconnection X2.connectionstring = a valid connection string X2.open() X3= new mysqlconnection X3.connectionstring = a valid connection string X3.open() X4= new mysqlconnection X4.connectionstring = a valid connection string X4.open() Msgbox(Phase 1) X1.close() X2.close() X3.close() X4.close() Msgbox (Phase 2) I am using MySQL Administrator to monitor the connection , at the Phase 1 break point I can see that 4 connection is allocated. And at Phase 2 , I expect the connection will be closed, but to my surprise, it did not. Not until I quit entire application. Then I see the connections are release. Anyone has encounter this before and any pointers for me to investigate further? Regards TweeWan -- 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] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Problem while starting mysql daemon
hello, I have installed mysql-3.23.58-pc-linux-i686 on Red Hat 9.0, while starting daemon i got the following message: ./bin/safe_mysqld --user=mysql [1] 5240 [EMAIL PROTECTED] mysql-3.23.58-pc-linux-i686]# Starting mysqld daemon with databases from /usr/local/mysql-3.23.58-pc-linux-i686/data 040409 21:56:46 mysqld ended [1]+ Done./bin/safe_mysqld --user=mysql When i saw the hostname.err file then it said mysql.host doesn't exist So how can i start the daemon please tell me Regards Rohan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Am I doing things right? (selecting groups of objects problems)
On Fri, 2004-04-09 at 09:48, [EMAIL PROTECTED] wrote: Hello, I've recently came across a problem I couldn't seem to solve right by myself. I have a db with objects table, each of those objects may belong to groups of objects. The number of groups can be about 256 and an object belongs from one to many different groups at once. I cannot find a good way to store/select information about groups for objects that belong to several groups. My first idea was to put a 'groups' column and keep there the id_numbers of groups to which particular object belongs to (with separators). So the groups column would have values like '100,203,204,208' etc. Of course this is not the right way to do it as those values are not atom and the lenght of the field may easily grow out of tinytext length type I was using... It worked ok though for small number of groups and objects though I know this was a perfect example of how *not* do do it in a RDB... If I wanted an object that belonged to 2 groups (100 and 203 for example) I would do SELECT [...] LIKE '%100%203%'. You definitely do not want to do it this way. You'd have to keep the 'groups' column items sorted to make sure you never have a situation where you query for '%100%203%' when it contains (203,204,100). This makes it complicated/non-trivial to add or remove objects from a group. Additionally, you'd be doing a full text search for each query which is vastly slower than querying on an indexed field. My next attempt was to create separate table with object_id and group_id column, this way an object that belongs to many groups would have several rows in the table. If I wanted to know what are the groups that my object belongs to - a piece of cake. But things get really rough if I want to get objects that (for example) belong to two particular (1 2) groups. I would go with something like that: SELECT DISTINCT(g1.object_id) FROM connecting_table as g1, connecting_table as g2 WHERE g1.group_id = 1 AND g2.group_id = 2 AND g1.object_id = g2.object_id; But this is getting more and more complex if I want to select objects that belong to 3, 4 and N groups at once :/ The first solution although very ugly seems to be much more clearer (and maybe even more efficient for groupn number of 2+?). This is the right way and more efficient, but why are you making it so difficult on yourself? ;) SELECT DISTINCT object_id FROM connecting_table WHERE group_id = 1 AND group_id = 2; There's no need to select the same table twice. You can make this even simpler by using 'IN': SELECT DISTINCT object_id FROM connecting_table WHERE group_id IN (1, 2) My working solution for now is to have a separate table with object_id and groups_id1 column of INT type, I have assigned the first 31 existing groups to corresponding bits of the INT field. That is if I want to select objects that belong to the groups that have ids of 1,3,5 and 26 i would set the bits nr 1,2,4 and 26 of a variable $MY_INT and then query: SELECT object_id,groups_id1 FROM connecting_table WHERE BIT_COUNT(groups_id1 $MY_INT) = 4; this seems to give me what I want but now if I want to add next 31 groups I need to create another groups_id2 column and things again get a bit complicated - I need now to check in which column the current group flag I need to find out may be stored and act accordingly (so groups with id 1-31 in column groups_id1, groups 32-63 in groups_id2 etc). Not a big problem and this solutions seems to be quite cheap (is it?) but somehow I am feeling there is a better way to do all this... This has the same problems as the LIKE '%100%203%' approach, but a full text search is replaced by math on each row. In both cases you lose the ability to use any kind of index. Sorry for this long letter I hope I have managed to put the problem straight, I may miss something obvious here but as I said I have limited knowledge about sql. I would be much grateful for any tips. Lecho -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part
Re: Dumping mass inserts?
On Friday 09 April 2004 12:26 pm, Mark Susol | Ultimate Creative Media wrote: Ok now I want to dump tables with names starting with phpads so I can move them to another db. How is the mysqldump command run then? And when I go to move them to the new db, I do use the mysqldump command since I am dumping to the new db? Mark /var/lib/mysql/ holds all of your DB's. Inside each directory(DB) there are 3 files for each table in that DB (assuming myisam here). You can copy these files to the from one server to the next. It's probably a good idea to stop the servers during this process so that no one can alter the table or try to read from it while you are replacing the old with the new. I don't know that mysqldump takes wildcards so to use that you will probably have to do an individual mysqldump for each table in the DB that you want to dump. Type in man mysqldump to see all the options for mysqldump. James -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Problem with mysql_install_db
Hello, I am trying to install Mysql (mysql-standard-4.0.18-pc-linux-i686.tar.gz) on my 'SCO_SV 3.2 5.0.5 i386' unix machine. When unzipping and untarring the file when I try to run the scripts/mysql_install_dn program I get a bunch of error messages. Here is what I get :- WARNING: The host '' could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Preparing db table Preparing host table Preparing user table Preparing func table Preparing tables_priv table Preparing columns_priv table Installing all prepared tables Installation of grant tables failed! Examine the logs in ./data for more information. You can also try to start the mysqld daemon with: ./bin/mysqld --skip-grant You can use the command line tool ./bin/mysql to connect to the mysql database and look at the grant tables: shell ./bin/mysql -u root mysql mysql show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in ./data that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source is the MySQL email archive. Please check all of the above before mailing us! And if you do mail us, you MUST use the ./bin/mysqlbug script! I also tried using the mysql_install_db with the username option,ie, scripts/mysql_install_db --user=username . Here the username I was using is an already existing user on the Unix system (since I dont have the permissions to create users). But I get the same error message. Can someone give any suggestions. Thanks in advance. Mickey.
mysql scripting
Hello again, Is there a way to do regex search are replace on all entries in a mysql field? Or, a way to uppercase or lowercase all characters for all entries in a filed? Some of the fields are varchars with numbers and letters. In my particular case, I have a field of serial numbers some of which are all caps some of which are not. Also the vendor name may be DELL for one entry and dell on another. We're standardizing the input to avoid this mess in the future, but I'd like to clean up what's current present. All tips are appreciated. Thanks, Brad -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem with mysql_install_db
On Fri, 9 Apr 2004, Mickey wrote: I am trying to install Mysql (mysql-standard-4.0.18-pc-linux-i686.tar.gz) on my 'SCO_SV 3.2 5.0.5 i386' unix machine. This is for linux. Do you have the lxrun installed? If you have lxrun installed and updated to the lastest libraries then it will work. If you are trying to run it on OpenServer in native mode you will need to get a OpenServer vesions. When unzipping and untarring the file when I try to run the scripts/mysql_install_dn program I get a bunch of error messages. Here is what I get :- WARNING: The host '' could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Preparing db table Preparing host table Preparing user table Preparing func table Preparing tables_priv table Preparing columns_priv table Installing all prepared tables Installation of grant tables failed! This indicates that you do not have the latest libraries for lxrun or you are using the wrong libray. If you need a native binary for MySQL check out ftp://ftp.zenez.com/pub/zenez/prgms/ Good Luck, -- Boyd Gerber [EMAIL PROTECTED] ZENEZ 1042 East Fort Union #135, Midvale Utah 84047 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem while starting mysql daemon
Rohan Shrivastava [EMAIL PROTECTED] wrote: hello, I have installed mysql-3.23.58-pc-linux-i686 on Red Hat 9.0, while starting daemon i got the following message: ./bin/safe_mysqld --user=mysql [1] 5240 [EMAIL PROTECTED] mysql-3.23.58-pc-linux-i686]# Starting mysqld daemon with databases from /usr/local/mysql-3.23.58-pc-linux-i686/data 040409 21:56:46 mysqld ended [1]+ Done./bin/safe_mysqld --user=mysql When i saw the hostname.err file then it said mysql.host doesn't exist So how can i start the daemon Check if privilege tables exist in the 'mysql' database. (/usr/local/mysql-3.23.58-pc-linux-i686/data/mysql). If no, run mysql_install_db script to install these tables. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Am I doing things right? (selecting groups of objects problems)
Lecho [EMAIL PROTECTED] writes: I have a db with objects table, each of those objects may belong to groups of objects. The number of groups can be about 256 and an object belongs from one to many different groups at once. Lecho, I threw together the following tables/data/queries that I believe handle your setup: create table objs ( obj_id int, obj_namevarchar(20) ); create table grps ( grp_id int, grp_descvarchar(20) ); create table grp_map ( obj_id int, grp_id int ); insert into objs (obj_id, obj_name) values (1, 'Obj1'); insert into objs (obj_id, obj_name) values (2, 'Obj2'); insert into objs (obj_id, obj_name) values (3, 'Obj3'); insert into objs (obj_id, obj_name) values (4, 'Obj4'); insert into grps (grp_id, grp_desc) values (10, 'Grp10'); insert into grps (grp_id, grp_desc) values (20, 'Grp20'); insert into grps (grp_id, grp_desc) values (30, 'Grp30'); insert into grp_map (obj_id, grp_id) values (1, 10); insert into grp_map (obj_id, grp_id) values (1, 30); insert into grp_map (obj_id, grp_id) values (2, 20); insert into grp_map (obj_id, grp_id) values (2, 30); insert into grp_map (obj_id, grp_id) values (3, 10); insert into grp_map (obj_id, grp_id) values (3, 20); insert into grp_map (obj_id, grp_id) values (3, 30); insert into grp_map (obj_id, grp_id) values (4, 30); select distinct(obj_id) from grp_map where grp_id in (10, 20); mysql select distinct(obj_id) from grp_map - where grp_id in (10, 20) - ; ++ | obj_id | ++ | 1 | | 2 | | 3 | ++ 3 rows in set (0.00 sec) This will tell you all the objects that belong to groups 10 or 20 Brad Eacker ([EMAIL PROTECTED]) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql scripting
Brad Tilley [EMAIL PROTECTED] wrote: Is there a way to do regex search are replace on all entries in a mysql field? Or, a way to uppercase or lowercase all characters for all entries in a filed? Some of the fields are varchars with numbers and letters. In my particular case, I have a field of serial numbers some of which are all caps some of which are not. Also the vendor name may be DELL for one entry and dell on another. We're standardizing the input to avoid this mess in the future, but I'd like to clean up what's current present. All tips are appreciated. Take a look at UPPER(), LOWER(), REPLACE() functions in MySQL. They may help you: http://dev.mysql.com/doc/mysql/en/String_functions.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Corruption and my.cnf
Mark, - Original Message - From: Mark Susol|Ultimate Creative Media [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Thursday, April 08, 2004 11:25 PM Subject: Re: Corruption and my.cnf I've experienced more corruption lately on my main site since I moved to = my own server running 4.0.17max. The site is very busy (60GB a month) and th= e tables are large. I didn't have this level of problems on the rental serv= er. =20 What are the variables to look into regarding why my tables are getting corrupt? Is this a my.cnf issue? Is this a memory issue? Is this a hard drive issue? Is this a too many connections issue? Looking at my dmesg output.. end_request: I/O error, dev 03:42 (hdb), sector 52228450 hdb: read_intr: status=3D0x59 { DriveReady SeekComplete DataRequest Error } hdb: read_intr: error=3D0x40 { UncorrectableError }, LBAsect=3D56276830, high=3D3= , low=3D5945182, sector=3D52228450 Is it possible this is related to my MySQL table corruption issues? There are more of these in the file. it might be. Corruption has a cause, and usually it is the OS/drivers or the hardware. Mark S=FAsol Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Register now for the 2004 MySQL Users Conference! http://www.mysql.com/events/uc2004/index.html --- u l t i m a t e =AD CreativeMedia Web | Print | CD Media | eCommerce www.ultimatecreativemedia.com Ph: 301-668-0588 -- 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: read_key: Got error 146 when reading table
Philippe, - Original Message - From: Philippe Lewicki [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, April 07, 2004 12:51 AM Subject: Re: read_key: Got error 146 when reading table Heikki, Its: mysql-standard-4.0.17-pc-linux-i686 thank you for the bug report. I have now removed that harmless warning from 4.0.19. Then I got an other question related, we get those errors after intensive insert select type of queries. From MySQL documentation: To ensure that the binary log can be used to re-create the original tables, MySQL will not allow concurrent inserts during INSERT ... SELECT. From InnoDB documentation: INSERT INTO T SELECT ... FROM S WHERE ... sets an exclusive (non-next-key) lock on each row inserted into T. Normally does the search on S as a consistent read, but sets shared locks on S if the MySQL binlogging is on. InnoDB has to set locks in the latter case because in roll-forward recovery from a backup every SQL statement has to be executed in exactly the same way as it was done originally. Just to confirm on innoDB only the inserted rows are exclusive lock on T. T can accept concurrent inserts. Yes. A newly inserted index record carries a 'lock only the record, not the gap before it' -type exclusive lock. Thanks, Philippe Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Register now for the 2004 MySQL Users Conference! http://www.mysql.com/events/uc2004/index.html Heikki Tuuri wrote: Philippe, - Original Message - From: Philippe Lewicki [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Tuesday, April 06, 2004 5:56 AM Subject: read_key: Got error 146 when reading table Hi, Found that error in .err log file: read_key: Got error 146 when reading table './databasename/tablename' Its an InnoDB table that gets a lot of reads/write with multiple millions records. Does someone as more informations on that error ? [EMAIL PROTECTED]:~/mysql-standard-4.0.17-pc-linux-i686/bin perror 146 Error code 146: Unknown error 146 146 = Lock timed out; Retry transaction the warning is harmless. What MySQL version you are running? I think that about a year ago I removed most of those harmless warnings from the .err log. Philippe Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables http://www.innodb.com/order.php Register now for the 2004 MySQL Users Conference! http://www.mysql.com/events/uc2004/index.html -- 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: Problem while starting mysql daemon
Friday, April 09, 2004, 8:59:48 PM, Rohan Shrivastava wrote: RS there are some tables named RS columns_priv and tables_priv RS are you talking about these Yes. In this case check permissions on the MySQL data dir and files. MySQL should be owner of the data dir. RS Regards RS Rohan Rohan Shrivastava [EMAIL PROTECTED] wrote: hello, I have installed mysql-3.23.58-pc-linux-i686 on Red Hat 9.0, while starting daemon i got the following message: ./bin/safe_mysqld --user=mysql [1] 5240 [EMAIL PROTECTED] mysql-3.23.58-pc-linux-i686]# Starting mysqld daemon with databases from /usr/local/mysql-3.23.58-pc-linux-i686/data 040409 21:56:46 mysqld ended [1]+ Done./bin/safe_mysqld --user=mysql When i saw the hostname.err file then it said mysql.host doesn't exist So how can i start the daemon Check if privilege tables exist in the 'mysql' database. (/usr/local/mysql-3.23.58-pc-linux-i686/data/mysql). If no, run mysql_install_db script to install these tables. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: disabling backslash as an escape character in strings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Christos Karras wrote: Yes, I use JDBC (with the MySQL Connector/J driver). I did not find a way in the JDBC API to escape a string before inserting it in a SQL string. The JDBC PreparedStatement class is able to escape parameters (in a database specific way) with the setString(parameterIndex, string) method, but it's designed for hard-coded insert/update queries. I use a custom function to generate queries that updates only fields that need to be updated, so I can't use PreparedStatement (unless I make my code hard to read/modify). The setString() method must be calling a MySQL specific escape function internally, but I don't know if there's something in JDBC to call that function directly or of it is private. Any ideas? Christos, There is nothing public in the API that allows you to do this (although you could just go look at how it is done in PreparedStatement.setString() since the driver ships with the source). The JDBC API in general expects that you will build 'ad-hoc' queries with prepared statements, both for performance and security reasons (SQL injection). There are many 'clean' ways of using prepared statements for this, ranging from rolling your own and keeping track of when you need to append a string to your query, and replace it with a '?' instead, and go back and re-substitute all of your strings with .setString() from the list of subsitutions you've made, to using an ORM that has a query-builder API, like Hibernate's Criteria API that lets you build SQL in an object-oriented way, and takes care of all of this behind the scenes. -Mark - -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 332 0507 www.mysql.com Meet the MySQL Team! April 14-16, 2004 http://www.mysql.com/uc2004/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAdxBEtvXNTca6JD8RAijhAKCwS6gcIHrzHwGPEdzMMe30KfSmRgCfY0uK 5AyNbcLE/jKetZloIUg6vC0= =XfTH -END PGP SIGNATURE- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Fulltext index is not being built with large database
I'm trying to build a fulltext index on a table with about 4 million entries with 2 varchar and one text field. The indexing starts and runs for about 1/2 to 1 hour, then the process stops without any error message. And leaves me with no index. I checked for the size in tmp and redirected it to a partition with 50GB space (about 15 times as much as the database tables). Mysql runs on gentoo-linux 2.4 with 800MB RAM with server version 4.0.17. Any clues, hints or tips? Thank you. sascha mantscheff hahnenbach 51570 windeck [EMAIL PROTECTED] telefon +49-2292-922 492 telefax +49-2292-922 493 mobil +49-171-620 0380 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
unique field problem
Hello again, I have a form that users fill out and submit into a mysql database using php. The problem I have is that there is only one unique field in the main table... it's an int that's auto-incremented with each new entry. This works fine unless the user accidentally submits the data twice. When this happens, two entries are made that are identical except for the auto-incrementing int field. To make a long story short, I've been trying to figure out a way to stop double entries both on the frontend and the backend. The only thing that would work on the backend is to have a unique field that couldn't possible be used in more than one record. I can add a field for this, but we have no unique data that can be entered into it. So, I was wondering if mysql had a function that could calculate a md5sum on the fields that are being entered? The results of the md5 calculation could be inserted into the field that's acting as the unique index. Is this possible? Is it a good idea? Any tips on a better approach to handle this? Thanks, Brad -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: unique field problem
BT Hello again, BT I have a form that users fill out and submit into a mysql database using php. BT The problem I have is that there is only one unique field in the main BT table... it's an int that's auto-incremented with each new entry. This works BT fine unless the user accidentally submits the data twice. When this happens, BT two entries are made that are identical except for the auto-incrementing int BT field. it will be easier if you just make sure the form cannot be sent twice... input type=submit [...] onclick=this.disabled=true; this.form.submit(); you may need to add hidden field with the same name as submit button and some value... or get last unique id from DB, store it into forms hidden field and fetch the id again when the form has been submitted, it the id is different the data has been stored already... Pozdrawiam, Lecho Buszczynski SWAPZILLA - wymieniaj gry ZA DARMO! http://www.exerion.pl/swapzilla.php -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Trying to understand the license
Hi all, I am still a bit confused as to the license for using MySQL. If I create an application in PHP, that uses a MySQL database (for example a shopping cart application) and I want to sell this application (not open source), am I required to pay a license fee? I found this quote: 2. Free use for those who never copy, modify or distribute As long as you never distribute (internally or externally) the MySQL Software in any way, you are free to use it for powering your application, irrespective of whether your application is under GPL or other OSI approved license or not. Which I understand to mean, that as long as I am not distributing MySQL with my application, that I don't need to worry about it. Thanks for any help. - Charles -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trying to understand the license
Exactly. The license only becomes an issue when you distribute mysql itself. Essentially, the gist is you can't charge people for mysql; only mysql can do that. You could, OTOH, let folks get your php app, and provide a link so they can download mysql themselves. - Original Message - From: charles kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 09, 2004 4:54 PM Subject: Trying to understand the license Hi all, I am still a bit confused as to the license for using MySQL. If I create an application in PHP, that uses a MySQL database (for example a shopping cart application) and I want to sell this application (not open source), am I required to pay a license fee? I found this quote: 2. Free use for those who never copy, modify or distribute As long as you never distribute (internally or externally) the MySQL Software in any way, you are free to use it for powering your application, irrespective of whether your application is under GPL or other OSI approved license or not. Which I understand to mean, that as long as I am not distributing MySQL with my application, that I don't need to worry about it. Thanks for any help. - Charles -- 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: Why can't I use an AS value in the WHERE clause.
MIchael, Point well taken. Cheers, Adam On Apr 8, 2004, at 2:47 PM, Michael Stassen wrote: Good point. I was focused on the question of using the alias to restrict results, so I left the function in the SELECT part. As you say, in this query, that would just give a useless column of '1's, so you might as well leave it out. In that case, though, the alias question is moot. That is, it doesn't really make any difference whether you put the condition in the WHERE or HAVING clause. On the other hand, we can imagine a query where we want to see a calculated result and use it to screen which rows are returned. Then using the alias in the HAVING clause is the way to go. For example, something like SELECT *, unix_timestamp()-unix_timestamp(last_seen) AS Last_Active FROM wifi_table HAVING Last_Active 600; Michael Adam wrote: Mike, I see what you're saying `active` was the alias name not an actual column. Ironically I was using a HAVING clause because I agree with that last post. Mike, why keep the `IF` statement? You're really saying give me all the records where this expression is true. Why not just move the expression in the `IF` to the HAVING clause? So take my old statement and ditch the where clause. You'll get: SELECT * FROM wifi_table HAVING unix_timestamp()-unix_timestamp(last_seen) 600; A little easier on the eyes no? Cheers, Adam On Apr 6, 2004, at 9:42 PM, Michael Stassen wrote: Adam, That won't work. Daevid doesn't have a column named active. Nor does he have to do the math twice. As was pointed out earlier, he can do what he wants using HAVING instead of WHERE, like this: SELECT *, IF(((unix_timestamp()-unix_timestamp(last_seen)) 600),1,0) active FROM wifi_table HAVING active = 1; Michael Adam wrote: Daevid, SELECT * FROM wifi_table WHERE active = 1 HAVING unix_timestamp()-unix_timestamp(last_seen) 600; Regards, Adam On Apr 5, 2004, at 8:29 PM, Daevid Vincent wrote: I'm curious when will I be able to do something like this: SELECT *, IF(( (unix_timestamp()-unix_timestamp(last_seen)) 600),1,0) as active FROM wifi_table WHERE active = 1; It's so obnoxious, especially since I can do this: SELECT *, IF(( (unix_timestamp()-unix_timestamp(last_seen)) 600),1,0) as active FROM wifi_table WHERE unix_timestamp()-unix_timestamp(last_seen) 600; Why do I have to do the math TWICE?! *sigh* -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Question regarding defaults
Hello: I have need to declare a column as type integer then default is at '0' (that is a string with a zero in it). An example may be: Create table foo ( foo_id int not null default '0' ) My question centers on the notion of implicit type conversion. Is the server converting the type at the time the ddl (not really too big a deal) or is it doing the conversion at run time (i.e. each time a row is inserted in the DB). Thanks for your time and expertise! Best Regards, Boyd E. Hemphill [EMAIL PROTECTED] Triand, Inc. www.triand.com O: (512) 248-2287 M: (713) 252-4688 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trying to understand the license
I thought I read that if your app is not GPL and interacts with MySQL in any way, you must license MySQL. on 4/9/04 5:16 PM, Dan Bowkley at [EMAIL PROTECTED] wrote: Exactly. The license only becomes an issue when you distribute mysql itself. Essentially, the gist is you can't charge people for mysql; only mysql can do that. You could, OTOH, let folks get your php app, and provide a link so they can download mysql themselves. - Original Message - From: charles kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 09, 2004 4:54 PM Subject: Trying to understand the license Hi all, I am still a bit confused as to the license for using MySQL. If I create an application in PHP, that uses a MySQL database (for example a shopping cart application) and I want to sell this application (not open source), am I required to pay a license fee? I found this quote: 2. Free use for those who never copy, modify or distribute As long as you never distribute (internally or externally) the MySQL Software in any way, you are free to use it for powering your application, irrespective of whether your application is under GPL or other OSI approved license or not. Which I understand to mean, that as long as I am not distributing MySQL with my application, that I don't need to worry about it. Thanks for any help. - Charles -- 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: Trying to understand the license
Only if you incorporate mysql into your app--for example, if your app is a database system based on the mysql engine. An app that merely talks to mysql doesn't require you to license it. - Original Message - From: John Mistler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 09, 2004 8:58 PM Subject: Re: Trying to understand the license I thought I read that if your app is not GPL and interacts with MySQL in any way, you must license MySQL. on 4/9/04 5:16 PM, Dan Bowkley at [EMAIL PROTECTED] wrote: Exactly. The license only becomes an issue when you distribute mysql itself. Essentially, the gist is you can't charge people for mysql; only mysql can do that. You could, OTOH, let folks get your php app, and provide a link so they can download mysql themselves. - Original Message - From: charles kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 09, 2004 4:54 PM Subject: Trying to understand the license Hi all, I am still a bit confused as to the license for using MySQL. If I create an application in PHP, that uses a MySQL database (for example a shopping cart application) and I want to sell this application (not open source), am I required to pay a license fee? I found this quote: 2. Free use for those who never copy, modify or distribute As long as you never distribute (internally or externally) the MySQL Software in any way, you are free to use it for powering your application, irrespective of whether your application is under GPL or other OSI approved license or not. Which I understand to mean, that as long as I am not distributing MySQL with my application, that I don't need to worry about it. Thanks for any help. - Charles -- 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]
Change the date format.
Hi, I'm new to the list. By these days I'm facing a system DB migration to MySQL (the last production version) and I have the followin problem. All the SELECTs sentences are all over the application, and for date/datetime filters are using the dd/mm/ format in the WHERE clause. Is the same in the INSERT/UPDATE statementes. I've studied with MySQL documentation, that use the -mm-dd format for the internal storage and for the data interchange with the clients. So the questions are: Is there any way to set the date/datetime format to MySQL engine, so the client can see it as dd/mm/? Is there any solution with no change to the client application code? Thanks in advance. David. == David Carlos Brunstein System Analyst / Software Developer Buenos Aires, Argentina Mail to: David _ Brunstein @ Yahoo . Com . ar IM: DavidBrunstein @ Hotmail . Com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]