Multiple Query Execution
Hello, Am I correct in thinking that if there are no dependencies between the multiple statements then the various statements are executed simultaneously by separate threads in the server? If so is there any way to turn this behaviour off and just use multiple query execution syntax to reduce the comms overhead between client and server? I am trying to do a comparatively large number of simple insertions into a particular table. [Currently about 500 per second.] MySQL 5.0.13 under Solaris. C API. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL Website
Lehman, Jason (Registrar's Office) wrote: I should have been clearer. I can't reach the website. I can get to lists.mysql.com with no problem except for the fact that images won't pull form www.mysql.com but I definitely come to a grinding halt when I try to reach www.mysql.com. I can't do a tracert because the university has shut that off here. But I guess it is working for everyone else. I'm experiencing similar problems - using both Mozilla and IE. 'wget' eventually got the HTML but it took nearly 2 minutes. The headers don't suggest anything strange. This is also a University site with 'traceroute' disabled and everything accessed through a cache. www.netcraft.com's site analysis also doesn't suggest anything untoward. -Original Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 6:31 PM To: Lehman, Jason (Registrar's Office) Subject: Re: MySQL Website - Original Message - From: Lehman, Jason (Registrar's Office) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 11:53 AM Subject: MySQL Website Does anyone know what is going on with the MySQL website? It appears to be undergoing a major redesign. The sections appear to be organized differently and the style sheets have also changed. Or did you have something else in mind? Rhino -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Date Problem
Richard Davey wrote: Hello Eric, Tuesday, March 9, 2004, 11:46:23 PM, you wrote: ES We have a table with a Date Time field and we need to update only the date ES portion of that field. ES We have table a with field Foo with value '2004-01-01 12:15:00' and a date ES '2004-03-01' and we need to change the date portion of Foo to the date and ES leave the time part alone. ES So Foo would change from: ES '2004-01-01 12:15:00' ES to: ES '2004-03-01 12:15:00' I would have thought that: UPDATE x SET y = DATE_ADD(y, INTERVAL 2 DAY) But that is adding two days, the original query was to add two months, so presumably it should be INTERVAL 2 MONTH - but beware that MySQL does some seriously bizarre things with dates - for example adding 2 months to 31st Dec takes you to 31st Feb which probably isn't what you want. would work and not alter the time, but only a test will tell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SQ puzzle
Jigal van Hemert wrote: Table: CREATE TABLE `age1` ( `age1` tinyint(2) NOT NULL auto_increment, PRIMARY KEY (`age1`) ) TYPE=MyISAM AUTO_INCREMENT=21 ; Data: INSERT INTO `age1` VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), (18), (19), (20); Query: SELECT * , a.age1 + b.age1 + c.age1 as sumage FROM `age1` a JOIN `age1` b JOIN `age1` c WHERE a.age1 * b.age1 * c.age1 =36 ORDER BY sumage We now have to search for combinations that - have more than one unique set of sorted ages for a certain sum (since Boris didn't know the ages while he knew the sum) - have only one highest age (since there is an eldest) Looking at the output this would only be true for ages 9, 2 and 2 Yes but 6,6,1 doesn't necessarily mean that the two children aged 6 are twins - one could have been born in January and one in December in the same year and hence have the same age (in years) on December 31st - but the one born in January would clearly be the eldest. Regards, Jigal. - Original Message - From: Tom Roos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 08, 2004 9:31 AM Subject: SQ puzzle SQL puzzle from the Informix mailing list: Two mathematicians (Boris and Vladimir) met accidently for the first time in 20 years. They greet each other and begin catching up on their respective lives. Boris asks Vladi Do you have any children? Yes replies Vladimir, I have three. How old are they?, asks Boris. The product of their ages is 36 and the sum of their ages is equal to the number of windows on that building across the street. Boris looks at the building, counts the windows then says Vladi, that still doesn't tell me the ages. Ah, says Vladi, then I must tell you that the eldest has red hair. Oh, says Boris, now I know their ages. What are the ages of Boris' children? Create a table, load it with data, and write a single SQL statement to produce the data set required to deduce the answer. Of course the problem cannot be solved with M$ SQLServer :-) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL optimisations for search engine
Jasper Bryant-Greene wrote: Hi I'm running a small search engine that indexes the web, but have been having trouble with optimising it to handle the load. There are two tables involved in searching - `pages`, which stores the ID, URL, title and crawl date, and `words` which has two rows - `word` and `page` where `word` is a word found on the page and `page` is the ID from the `pages` table. When we crawl an URL we rip all the words from the page and add them to the `words` table with the ID of the page. The query we use for searches is: SELECT COUNT(words.word) AS score, words.page AS id, pages.title, pages.url FROM words,pages WHERE pages.id=words.page AND words.word IN($words) GROUP BY words.page ORDER BY score DESC LIMIT 10 Not sure which columns are indexed, but the main problem is almost certainly words.word IN($words) - this will yield a set of rows from the 'words' table assuming that the string $words contains the query terms(s), this requires an expensive serial walk of the words table and an expensive string matching operation associated with each row - unless the IN() operator is a lot cleverer than I suspect. A better approach would, perhaps, be to parse the query into an array of words in the application and then construct suitable SQL along the lines of words.word = qword1 OR words.word = qword2 OR words.word = qword3 .. etc with as many or few terms as required. Index the words table on word for a further really big performance boost . I've put the LIMIT 10 in there because it's been going slow as hell. not only that but it's still going rather slow since we're getting rather high load on the search engine at the moment. If anyone could suggest ways to make it run faster that'd be great, bearing in mind that: a) I can't change MySQL server parameters since the host won't allow it b) I'd rather not start crawling again with a different method - the words table has over 1,700,000 rows. Thanks Jasper Bryant-Greene Cabbage Promotions mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] http://fatalnetwork.com/ http://fatalnetwork.com/ US: +1 (509) 691 3287 NZ: +64 (21) 232 3303 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Euro Symbol ()
Hassan Shaikh wrote: Hi, I've inserted the following currecy sumbols in my table (structure mentioned below). All symbols are displayed properly when I do select, expect for the Euro symbol, which just shows a question mark (?). Any idea why is it behaving like that? I am using MySQL 4.0.17 on Windows XP Pro. My production server is Linux based. The euro symbol displayed correctly in your e-mail and in the list of mail items in my inbox (I'm using Mozilla/W2K) so this must, almost certainly, be a problem with the locale of your XP Pro set up - most probably you're using a font that doesn't include this symbol, you may also have set up the system with unusual national settings - try telling it you're in the UK or Germany or Italy. Euro Yen Pound Sterling $Dollar +--++--+-+-+---+ | Field| Type | Null | Key | Default | Extra | +--++--+-+-+---+ | CYRANK | decimal(3,0) unsigned zerofill | | | 999 | | | CYSYMBOL | varchar(5) | YES | | | | | CYNAME | varchar(50)| | | | | | CYCODE | char(3)| | PRI | | | +--++--+-+-+---+ Thanks. Hassan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: C Programing: mysql_free_result
Rocar Peças wrote: Dear Friends, I´m programming in C, Linux envirnment. The SELECT´s results are being brought to the client by using mysql_store_result. And the result sets are being released by mysql_free_result. The problem is: as mysql_free_result is called, the system memory is NOT actually released. For example: I can monitor the program size in memory with top Linux utility (Conectiva 7.0 distribution). As the program is loaded into the memory, its size is, say, 1900Kb. Then, a select with a ruge result set is called and uploaded to the client. At this time, the program size in memory is 6000Kb. Then mysql_free_result is called. The program size in memory does not change. Isn´t it supposed to shrink back to 1900Kb? In general I wouldn't expect the memory to shrink, what actually happens depends on the behaviour of the underlying memory allocation routines. AFAIK the MySQL code wraps the standard alloc library routines on whatever platform you're using. MySQL doesn't do it's own memory management so whatever memory behaviour you see is that of the standard libraries on your system. Of course on a modern OS, the reported memory size of a process is usually the top address, this can be significantly larger than the actual memory used by the process. Thanks, folks!!! Leandro M Neves, Rocar Pcs Ltd, IT Manager Sete Lagoas/MG - BRAZIL -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Images in a table
Richard Bewley wrote: Yes, you can insert the binary into a table. Richard -Original Message- From: Zenzo [mailto:[EMAIL PROTECTED] Sent: Saturday, November 29, 2003 1:42 PM To: MySQL List Subject: Images in a table If your application is WWW based I've done some notes for students about how to do this (via PHP and a WWW interface). They're at http://www.scit.wlv.ac.uk/~jphb/sst/php/extra/image1.html I've seen several suggestions that putting images directly in MySQL tables is not a good idea and, instead, you should put server side image file names in the database, and let the scripting back-end read the files. I'm neutral on this. How can I insert images in a table if I can do it with MySQL? __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Threads and signals in MySQL client
Hello, I'm working on a multi-threaded application that includes MySQL client functionality in each thread. I'm using libmysqlclient_r and the appropriate init functions etc. The application also uses signals between threads for various purposes and thus manipulates signal masks on a per thread basis. Are any signals used internally in the MySQL client code? If so which? Does the library code manipulate thread signal handling facilities? -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: web data entry problem
[EMAIL PROTECTED] wrote: I hope someone might be willing to help out. I'm trying [still] to learn MySQL and php - to create some simply web based database. I have installed quite a few php/MySQL web database apps from books, however, none of them will get data entered into my database. When I create the database exactly as instructed, everything works great, but when I create the form to send/add a new record to my db then look at the db the new data is not there. This happens repeatedly with every example I build. I can add records using a terminal or phpMyAdmin. This sounds like an access rights problem. Is your MySQL server on the same machine as the WWW server? I assume that you have included your MySQL username/password in your PHP script, but do the access rights on the MySQL server allow access for your MySQL account from the WWW server? You might also want to check PHP error handling and reporting . In particular make sure your code goes something like $result = mysql_query(SELECT my_col FROM my_tbl) or exit (Invalid query); I'm running MySQL 4.0.14, Mac OS X 10.3, PHP 4.3.2. I installed 'tasks' - http://www.versiontracker.com/dyn/moreinfo/macosx/17996 and it works just fine! but it is too big for me to use to compare to my very simple scripts. Here is one I have recently installed whose data will not enter: http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html? tw=programming I believe my db connection is being made (I may be wrong), after all my phpMyAdmin app also works fine. I would be very grateful is there might be a kind soul who would work with me to help me to find out what is wrong? I have had dbs before that worked fine, I don't understand this problem at all. Thanks, Ted -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: single quotes in database
[EMAIL PROTECTED] wrote: You can use addslashes and stripslashes when inserting and selecting respectively. addslashes will turn your name into O\'connel. and stripslashes will bring it back to the displayable format. check out php.net/addslashes php.net/stripslashes An alternative is to use mysql_escape(). If your PHP server has magicquotes turned on you won't need to take any action. I did some notes for students on this topic once, they're at http://www.scit.wlv.ac.uk/~jphb/sst/basics/quoting.html You can somtimes get quite surprising results by typing a query such as O'Malley into a web based query facility. hth Jeff Steve Buehler [EMAIL PROTECTED]To: PHP [EMAIL PROTECTED], mysql [EMAIL PROTECTED] cc: 11/07/2003 11:30 Subject: single quotes in database AM I am using PHP/MySQL and am having a problem. We have some names and addresses in the database that have single quotes in them. For instance. There is a town around here called Lee's Summit. Also names like O'connel. When I pull from the database it skips these because of the quotes. I know there is something that I have seen before about this, but can't find it now. Can anybody help me? I really hope this makes since because I am sick today and am having a hard time thinking straight. Is it something that I will have to fix when putting things into the database? I am hoping on being able to fix this when going in and when coming out of the database so that I don't have to go back and redo all the ones that are already in the database. Thanks Steve -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How can I display images from a mySQL Database in a web page?
Dan Anderson wrote: I have created a BLOB field to store images. Is there any way to embed them within HTML with something like: I've done some notes on this at http://www.scit.wlv.ac.uk/~jphb/sst/php/extra/images1.html - assuming of course you're using PHP as a WWW backend to dig the stuff out of the database. image start: jpeg /image Thanks in advance, Dan -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: NEWBIE how can i store images in a database?
Mike Brum wrote: I've been preparing some notes for my students on how to do this (using PHP/MySQL), if you're interested have a look at http://www.scit.wlv.ac.uk/~jphb/sst/php/extra/images1.html - I've only just put these notes together so if you can see any errors please let me know before I mislead next year's students ;-) You'd want to use a BLOB (binary large object) if that's what your goal is. But if you're using this for a web application I'd highly suggest that you instead save images to a directory and make a reference to the path in the database. If you have many BLOB inserts or selects on a site, your database will be A LOT slower than pulling a string URL and then the browser simply retrieving the image from the directory specified. -M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:22 PM To: [EMAIL PROTECTED] Subject: NEWBIE how can i store images in a database? hello, i'm just changing from openbase SQL to MySQL, so i'm new here. in openbase i had images stored in a database. the 'type' was set to 'object'. i can't find something like that here and also not in the manual. what should i use? thanx for advance cheers christian -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: type casting help!!!
Prem Soman wrote: hi!! i wrote a simple function that returns a string in C the function fetches values from a table and stores all the value in a string variable and then returns it ...This is small part inside the function i wrote! while((row = mysql_fetch_row(res))) { unsigned long *lengths; lengths = mysql_fetch_lengths(res); for(i=0;i{ str = strcat(str,row[i]); } str = strcat(str,\n); } but i know that the content in red would rerturn an error!! how to convert the output of mysql_fetch_row() function to an equivalent string ? I think, perhaps, the C fragment above has got a bit mangled in transmission. Assuming that you want to concatenate the individual column and the code is based on manual section 22.4.18 (My 3.23.28 manual) then you need some space in which to construct the concatenated columns. unsigned long *lengths; unsigned long tlength,i; MYSQL_ROW row; char *str; row = mysql_fetch_row(res); lengths = mysql_fetch_lengths(res); /* gives array of column widths */ tlength = 0; for(i=0;incols;i++) tlength += lengths[i]; tlength += 1; /* need space for string terminator */ str = (char *)calloc(tlength,sizeof char); /* get some space */ for(i=0;incols;i++) strcat(str,row[i]);/* build the string */ /* don't forget to free the space !! */ - Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Bug with 4.1.0-alpha Solaris
Hello, After some moderately heavy usage, MySQL crashed on me. The problem seems to relate to the size of the innodb log file, alhtough I'm not currently using innodb files. [Still trying to debug client before exploring innodb vs myisam ] I've gathered up all the evidence in a tarball and attached it. This includes - (1) The .err file (2) The my.cnf file (3) Some directory listings that might be relevant I hope I've sent all this to the correct place - if not apologies. bug.tar.gz Description: GNU Zip compressed data -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: PHP, MySQL and Apache
Subscriptions wrote: The httpd.conf connects PHP to Apache. What connects PHP to MySQL? I've looked through google and I can't find anything that makes since to me. Can someone point me in a direction as to where I can find this out? The problem I'm having is I have PHP 4.3.2, MySQL 4.0.13 and Apache 2.0.46. I have a page that is trying to connect to MySQL via PHP. The error is:# When you install PHP you need to ensure that MySQL support is built in. This is fairly straightforward when building PHP from source, although you may have to tell the PHP build where your MySQL libraries are. Remember that PHP is implemented as an Apache module or 'plug-in', make sure that when Apache starts up, it also knows where the MySQL libraries are.[On Solaris this means setting LD_LIBRARY_PATH suitably.] Fatal error: Call to undefined function: mysql_connect() in /var/www/html/ww3.polkmechanical.com/test/mysql_test.php on line 8 The code on line 8 is: $link = mysql_connect( localhost, user, password ) or die(mysql_error()); I can log on through mysql at a telnet prompt with the database, user and password. Ty... When governments fear the people there is liberty. When the people fear the government there is tyranny. -Thomas Jefferson, third US president, architect and author (1743-1826) -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Newbie Question
Hello, I'm sure there's an answer somewhere but the 900+ page manual is a bit overwhelming. I have MySQL 4.1 running on one machine and I'd like to access using the client software I alerady have on another machine which was built against 3.23.33. Access is via command line client (mysql), PHP and C-API - all obviously built against the same client library. I gather from the manual (brief note at top of page 222) that 4.1 has a different way of handling passwords which is why a mysql connection failed with error 1249 about authentication protocols. Is there any way round this? I really don't want to have two separate sets of client stuff around and I'm not ready to switch a production system to 4.1 [Host environment is Solaris 2.7/2.8] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.1 and MyCC
Paul DuBois wrote: At 11:55 -0500 6/11/03, Christensen, Dave wrote: I upgraded my test MySQL server yesterday to 4.1 and I'm now receiving an error when I try to connect using MyCC. The error is ERROR 1249: Client does not support authentification protocol requested by server. Consider upgrading MySQL client. I've tried to find a solution on the website, but either it's not mentioned there or my search skills need some refinement (probably the latter :-) Anyone have any idea what I have to do to solve this one? Start the server with the --old-passwords option. Or put this in an option file: [mysqld] old-passwords Thanks - that also answers an earlier post of mine - although I think it should be old-password and if you've (as I did) set up 4.1 with new style passwords, you can't then just drop this into /etc/my.cnf without also changing all the passwords - the new and old schemes encrypt in a different way AFAIK. That'll force the server to use the older password authentication mechanism. David Christensen Brokers International, Ltd. 1200 E Main St PO Box 160 Panora, IA 50216 (800) 362-1097 or (641) 755-2775 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- From Peter Burden, [EMAIL PROTECTED] http://www.scit.wlv.ac.uk/~jphb -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]