Is there an MSSQL limit function?
I want to run a query like: select * from table order by rand() limit 3 in MySQL it would work but I need to run it in MSSQL. I've been searching for a limit function in MSSQL and I can't find a way to do it. I'm experienced with MySQL but know nothing about MSSQL. If someone could point me in the right direction I would really appreciate it! Thanks, Dean - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Statistical analysis query?
Hi. A little explanation of the table usage would have been nice. E.g. it's not clear to me, if shift 232 is also listed in the shifts table or not. I presume the latter from now (in which case shifts is more like a did_show_shifts). Also, you did not specify what special cases are to be taken care of. E.g. can there be volunteers which do not have a shift assigned yet? Can there be a shift in the future? And so on... I presume that the tables reflect complete recordings _after_ each shift. On Fri, Feb 15, 2002 at 11:38:29PM -0800, [EMAIL PROTECTED] wrote: I'm stumped -- which isn't saying much because I'm hardly a scientist. I am struggling to write a query that will tell me how many times a new volunteer ( defined as a volunteer who has never worked a shift ) did not show up for his shift (first shift). From my data I would eventually like to be able to say: a brand new volunteer does not show up for his shift 1 in x times. Well, either one of my presumptions is false or a different layout would probably better, namely: shifts SID | WHEN| VID | SHOW --- 230 | 2000-01-28 | 584 | yes 231 | 2000-02-01 | 485 | yes 232 | 2000-02-01 | 259 | no 233 | 2000-02-03 | 147 | yes ... (avoiding DATE because it's a reserved word) In this case your question would be a variation of the one described in the tutorial section of the manual (getting the rows for the group-wise smallest (=date) value of a column): http://www.mysql.com/doc/e/x/example-Maximum-column-group-row.html Your question is like for each volunteer, find whether he showed up (=SHOW) for his first shift (minimum WHEN). See the metioned manual section for more detail. So this would be something like CREATE TEMPORARY TABLE tmp SELECT VID, MIN(WHEN) AS WHEN FROM shifts GROUP BY VID; SELECT t.VID, t.DATE, s.SHOW FROM tmp t, shifts s WHERE s.VID=t.VID AND s.WHEN=t.WHEN; This gives you, for each volunteer, when his first shift was and if he showed up. You want to know, the percentage of how often a volunteer misses his first shift in avarage. You get this, if you replace the SELECT clause by: SELECT AVG( IF( s.SHOW = 'no', 1, 0 ) ) FROM ... In MySQL a comparision returns 1, 0 or NULL and therefore this can be abbriviated as SELECT AVG( s.SHOW = 'no' ) FROM ... The disadvantage of using AVG() to evaluate the number of posivite hits is that the query has to go through the whole tmp table and cannot use indexes. So, if your tables are not small (1 rows) or you do this query not only once, you want to use the following instead: (of course, this presume that you created an index on tmp.SHOW!) SELECT @volunteers := COUNT(VID) FROM volunteer; SELECT COUNT(*) / @volunteers FROM tmp t, shifts s WHERE s.VID=t.VID AND s.WHEN=t.WHEN AND s.SHOW='no'; This presumes, that there are no VID in volunteer, that are not in shifts and vice versa. If that's not true, use instead SELECT @volunteers := COUNT(DISTINCT v.VID) FROM volunteer v, shifts s WHERE v.VID = s.VID Okay, so your final queries could look like (the simple way) SELECT @volunteers := COUNT(VID) FROM volunteer; CREATE TEMPORARY TABLE tmp SELECT VID, MIN(WHEN) AS WHEN FROM shifts GROUP BY VID; SELECT AVG( s.SHOW = 'no' ) FROM tmp t, shifts s WHERE s.VID=t.VID AND s.WHEN=t.WHEN; Now back to your original table layout. Without going in-depth again, I guess the following should work (presuming that SID in shifts and no_show_shifts are distinct): SELECT @volunteers := COUNT(VID) FROM volunteer; CREATE TEMPORARY TABLE tmp SELECT VID, MIN(WHEN) AS WHEN, 'yes' AS SHOW FROM shifts GROUP BY VID; INSERT INTO tmp SELECT VID, MIN(WHEN), 'no' AS SHOW FROM no_show_shifts GROUP BY VID; CREATE TEMPORARY TABLE tmp2 SELECT VID, MIN(WHEN) AS WHEN FROM tmp GROUP BY VID; SELECT AVG( s.SHOW = 'no' ) FROM tmp2 t, tmp s WHERE s.VID=t.VID AND s.WHEN=t.WHEN; Or with a more complex SELECT (don't know if it's faster or slower without testing): SELECT @volunteers := COUNT(VID) FROM volunteer; CREATE TEMPORARY TABLE tmp SELECT v.VID, MIN(s.WHEN) AS WHEN_YES, MIN(n.WHEN) AS WHEN_NO FROM shifts LEFT JOIN shifts s ON s.VID=v.VID LEFT JOIN no_show_shifts n ON n.VID=v.VID GROUP BY VID; SELECT AVG( IS_NULL(WHEN_YES) OR ( !ISNULL(WHEN_NO) AND WHEN_NOWHEN_YES ) ) FROM tmp t, shifts s WHERE s.VID=t.VID AND s.WHEN=t.WHEN; Btw, this presume that not both, MIN(shifts.WHEN) and MIN(no_show_shifts.WHEN) can be NULL for a certain VID at the same time, i.e. that for each VID there is a row either in shifts or in no_show_shifts. Of course, in MySQL 4.x, you could use UNION to simplify that query. But using UNION is a sign for strange table design (justified by needs or not) and this is why I started my first example with a changed table layout. And, as initally said, maybe I made
Re: Statistical analysis query?
Richard, I'm stumped -- which isn't saying much because I'm hardly a scientist. I am struggling to write a query that will tell me how many times a new volunteer ( defined as a volunteer who has never worked a shift ) did not show up for his shift (first shift). From my data I would eventually like to be able to say: a brand new volunteer does not show up for his shift 1 in x times. I have three tables: volunteer VID | Name - 524 | Joe Doe 254 | Karen Smith 485 | Bob Nesbit shifts SID | DATE | VID --- 230 | 2000-01-28 | 584 231 | 2000-02-01 | 485 233 | 2000-02-03 |147 234 | 2000-02-04 | 584 no_show_shifts SID | DATE| VID --- 232 | 2000-02-01 | 259 239 | 2000-02-08 | 369 Is it possible to write a query that will solve this problem? If so, can anyone tell me how I can do it? If not what other data do I need? Any help is appreciated. You're stumped!? Where does that leave us? Unfortunately (AFAIK) the sample data you have enclosed does not demonstrate the condition you seek to describe - perhaps it would have been better if you gave us a replicable example, so that we can UNDERSTAND the problem before we try to help you out. Neither did you enclose your current best-shot so that we might see how you have approached the problem (and perhaps further 'discover' aspects of the problem) [grumble!] Forgive me for ignoring the finer points of your requirement, in an attempt to actually get the 'right data' coming off the tables first...What does the following query do for you? SELECT volunteer.VID, volunteer.Name, no_show_shifts.SID, no_show_shifts.DATE, shifts.SID, shifts.DATE, count() FROM volunteer, no_show_shifts, shifts WHERE no_show_shifts.VID = volunteer.VID AND shifts.VID = volunteer.VID GROUP BY volunteer.VID HAVING no_show_shifts.DATE shifts.DATE Does the COUNT() have to mention no_show_shifts.DATE or .SID? Please advise, =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Selecting records with the highest value no greater than x
In Re: Selecting records with the highest value no greater than x, [EMAIL PROTECTED] wrote: IMO, there is one, if I did understand the question correctly: SELECT * FROM NEWS WHERE RATING = 4 ORDER BY RATING DESC, RAND() LIMIT 1; This give back a random news entry of the highest score available, but smaller than 5. It just gives back a random news story, as it is logically identical to SELECT * FROM NEWS WHERE RATING = 4 ORDER BY RAND() LIMIT 1; You would need a 'non-uniform' random function for your version to work. Thanks for the user variable URL. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [PHP] MySQL question...not sure if this is the correct forum to ask.
Luie, Wouldn't replace change all the entries in your table row, same effect as update? I believe the question is how to test which entry in a form has a new value and replace/update only that value in the table. If I have a form... __ |Employee Record Update| | | |ID No: 1234 | |Name:_| |Address: _| |Status: Married | | | |Submit| -- If I have this table... _ |idnonameaddressstatus| |-| |1234Peter45 street Single| |_| Which means I only want to replace the status and the name and address remains the same. How do you test w/c entries in the form have new values and change only those entries in the table? Peter, this is basically what your asking, right? I actually need to figure this one out myself so I would appreciate any info. Do not use REPLACE if the table uses an AUTO_INCREMENT id, because if you do, any other tables linking into the id column will need to be changed/become dislocated. Even if this is not the case, under these circumstances a REPLACE is two db operations (DELETE followed by INSERT) and should be 'costed' accordingly. In order to populate the form you must have first performed a SELECT to retrieve the data from the db. So from there you can figure out what the data used to be - if you want/need to. You already have/send the existing data values in/to the form (and can have it return form values as normal, and include the 'original values' in invisible fields - if you have to go that far). When the form response comes back you have two choices: 1 PHP: use PHP to compare the ex-db values and the values returned from the form, then dynamically construct a precise UPDATE statement (tailoring the SET clauses to the requisite column name and data value pairs). This is a bit fiddly - and becomes more so as the number of form fields increases. 2 MySQL: use the intelligence of the MySQL UPDATE command (RTFM: MySQL only changes those values which need to be changed) and issue a command which appears to UPDATE every possible-form-affected column (regardless of whether is needs to be updated - according to 'form-thinking', because MySQL will decide for you and do the 'database-thinking') Regards, =dn What about REPLACE? http://www.mysql.com/doc/R/E/REPLACE.html 'REPLACE works exactly like INSERT, except that if an old record in the table has the same value as a new record on a unique index, the old record is deleted before the new record is inserted' Hi, Can the UPDATE statement have conditional check embedded in it? I have a page that displays a record (in a FORM format) that the user can change the information on each column. I want to check each column and see which has been changed and update the table for entries that were changed only. for each column data { if column is changed then update; else do nothing; } Maybe I am making this too complicated than it needs and just go ahead and update all of the columns regardless with the new values, regardless they are actually different or not. Thanks in advance, -Peter - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: where to report a bug? (was: mysql from localhost vs. remote)
Hi Benjamin, INSERT INTO mysql.db VALUES ('%','xyz00_%','xyz00','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); Has the second line anything to do with the behaviour? It shouldn't as you use xyz00 below and user field will match only the user name 'xyz00_%'. nope, has nothing to do with the issue. But the second field is db, not user. Thus, the statement is correct by itself. local mysql -h192.168.121.34 -uxyz00 -p1234 -e 'select user()' +--+ | user() | +--+ | [EMAIL PROTECTED] | +--+ It works fine for me, you see? And no, I have not any other entry in the privilege tables, that would allow user xyz00@localhost to connect. Thanks for eveluating this issue so thorowly. The interesting part is, why does it display for you xyz00@localhost, whilst it displays an IP for me? Are you sure you copied the correct error message? If so, my first guess would be that your hosts config is mixed up a bit. You might be right, because it works today for me too! I just wanted to try it again to check the error message, and now it suddenly works. I will do some more tests, but it seems, the problem was somewhere else. We had another, similar, issue two days ago. FTP logfiles showed localhost for the client when FTP was used via SSH tunnel. Not it is the hostname. I will check with the other hostmasters, if somebody changed something. Anyhow, xyz00@localhost should match the first of the both lines in the user table. That was my point, it SHOULD have worked anyway, but it didn't. Doubling the user entries is not a good solution, by my opionon, because it means that we have to maintain double rights and passwords. But only in the user table. You can use the hosts table to tell MySQL that two (or more) host should be viewed as a group and avoid doubling entries in the other ones this way. I have not understood this yet, but I will check up with my colleagues (I am not the mysql expert as you can easily see, but our mysql expert is unavailable these days). Thanks for your help! Michael -- Hostsharing eG / c/o Michael Hönnig / Boytinstr. 10 / D-22143 Hamburg phone:+49/40/67581419 / mobile:+49/177/3787491 / fax:++49/40/67581426 http://www.hostsharing.net --- Webhosting Spielregeln selbst gemacht - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Compile error. MySql C++ API
Vipul Kotecha writes: Hi List, I am new to the MySql C++ API and I am compiling one file it gives me error saying Error E2303 ..\..\include\sqlplus\resiter1.hh 56: Type name expected Error E2275 ..\..\include\sqlplus\resiter1.hh 56: { expected Error E2275 ..\..\include\sqlplus\resiter1.hh 56: { expected and many warnings. Can you please tell me what option I have to set in my make file. Thanks, Vipul. What compiler are you using ?? -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SHOW GRANTS not returning anything?
I'm a total newbie to MySQL, so I'm reading the documentation right now. In General Security I read that SHOW GRANTS should give me a picture of who has what rights, but if I use SHOW GRANTS I get the following error: ERROR 1064: You have an error in your SQL syntax near '' at line 1 What am I doing wrong? -- Med venlig hilsen/Best regards, Søren Neigaard mailto:[EMAIL PROTECTED] -- Everything should be made as simple as possible, but no simpler. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Giving root access from another host?
I want to try out MySQL-GUI from my workstation, and I want to connect to my database server, but it says that root has no access rights from this host. How do I give root this kind of acccess? -- Med venlig hilsen/Best regards, Søren Neigaard mailto:[EMAIL PROTECTED] -- Sometimes I think we're alone in the universe, and sometimes I think we're not. In either case the idea is quite staggering. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Giving root access from another host?
Søren Neigaard writes: I want to try out MySQL-GUI from my workstation, and I want to connect to my database server, but it says that root has no access rights from this host. How do I give root this kind of acccess? -- Med venlig hilsen/Best regards, Søren Neigaard mailto:[EMAIL PROTECTED] -- Sometimes I think we're alone in the universe, and sometimes I think we're not. In either case the idea is quite staggering. Hi! Read our manual on the subject. Ether grant priveleges to user@host_from_which_you_try_to_connect or to user@%, which means connecting rights from any host. -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Changing a query to work with MySQL
Hi, I'm very new to database design and have developed an application running on M$ Access and am currently in the process of moving the back end to MySQL, mainly to make use with a website easier. All is fine except for one query which contains a sub select so therefore will not work. The query and associated VB code is shown below, could someone have a look at it and suggest a work around to get this part working with MySQL please? CurrentDb.Execute DELETE * FROM KeywordsForPicture WHERE (KeywordsForPicture.PicID= Forms!frmPhotographs!textPicID ) AND (KeywordsForPicture.KeywordID IN (SELECT KeywordID FROM Keywords WHERE Keywords.SubCatID= cboSubCategory )) While I'm here are there any other tweaks people would suggest while using the Access Front end? The Access front end is a semi temporary arrangement, next personal challenge is to create a php driven front end. Thanks Alex --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.324 / Virus Database: 181 - Release Date: 14/02/2002 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: SHOW GRANTS not returning anything?
You can SHOW GRANTS FOR foo which gives you information about user 'foo'. To show info about everyone, use SELECT * FROM user; hth Doug On Sat, 16 Feb 2002 13:59:02 +0100, Søren Neigaard wrote: I'm a total newbie to MySQL, so I'm reading the documentation right now. In General Security I read that SHOW GRANTS should give me a picture of who has what rights, but if I use SHOW GRANTS I get the following error: ERROR 1064: You have an error in your SQL syntax near '' at line 1 What am I doing wrong? -- Med venlig hilsen/Best regards, Søren Neigaard mailto:[EMAIL PROTECTED] -- Everything should be made as simple as possible, but no simpler. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Giving root access from another host?
Søren, Saturday, February 16, 2002, 3:11:40 PM, you wrote: SN I want to try out MySQL-GUI from my workstation, and I want to connect SN to my database server, but it says that root has no access rights from SN this host. How do I give root this kind of acccess? You should set privileges for your user (root) to connect from another host. For example: GRANT ALL ON *.* TO 'root'@'your_host' identified by 'your_password' WITH GRANT OPTION; Look in the manual: http://www.mysql.com/doc/G/R/GRANT.html SN Med venlig hilsen/Best regards, SN Søren Neigaard mailto:[EMAIL PROTECTED] -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SHOW GRANTS not returning anything?
Søren, Saturday, February 16, 2002, 2:59:02 PM, you wrote: SN I'm a total newbie to MySQL, so I'm reading the documentation right SN now. In General Security I read that SHOW GRANTS should give me a SN picture of who has what rights, but if I use SHOW GRANTS I get the SN following error: ERROR 1064: You have an error in your SQL syntax near '' at line 1 SN What am I doing wrong? You did using wrong sintax for SHOW GRANTS statement. The correct sintax is: SHOW GRANTS FOR 'user'@'host'; -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
connections to MySQL
Lonnie, Friday, February 15, 2002, 8:11:59 PM, you wrote: LC Hello All, LC I am new to this list and hope that someone could answer this LC question for me. LC I am running on a fresh install of Redhat 7.2 and am trying to LC connect to MySQL from a program that I have to test the connections, LC but am getting error messages saying that the host in not allowed to LC connect to this MySQL server. LC This is strange because I ran my test app on the same machine that LC the MySQL server is running. LC Is there some file that I must modify to tell MySQL to accept LC connections from various machines including localhost? LC Also, does some one have a simple test program that they know works LC that I might be able to use to try and connect to a simple database? You can find more info about connecting to the MySQL Server if you look at: http://www.mysql.com/doc/C/o/Connecting.html Check your privileges. If you have problems with privileges you can get some more info at: http://www.mysql.com/doc/G/R/GRANT.html or http://www.mysql.com/doc/A/c/Access_denied.html LC Thanks in advance, LC Lonnie -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
mysql from localhost vs. remote
Michael, Friday, February 15, 2002, 4:08:42 PM, you wrote: MH Hi mysql list members, MH We use the following statements to setup users and rigts for a mysql MH server which is accessible locally and via internet: MH INSERT INTO mysql.user VALUES MH ('%','xyz00',PASSWORD('...'), MH 'N','N','N','N','N','N','N','N','N','N','N','N','N','N'); MH INSERT INTO mysql.db VALUES MH ('%','xyz00_%','xyz00','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); MH The server runs on 66.70.34.150:3307. We can connect via socket locally MH and via Host:Port remote: MH remote-system mysql -h 66.70.34.150 -P 3307 -u xyz00 -p MH = works MH local-system mysql -S /var/run/mysql-ext/mysql.sock -u yxz00 -p MH = works MH But we can NOT connect locally by host:port: MH local-system mysql -h 66.70.34.150 -O 3307 -u xyz00 -p MH = ERROR 1045: Access denied for user: 'xyz00@localhost' (Using MH password: YES) MH On a mysqld which is accessible only locally the both INSERT statements MH above would have localhost instead of %. Why does localhost not MH qualify for %? Do we have to double the entries, having separate ones MH for localhost? It does not make sense, does it? When you set '%' or '66.70.34.150' for entries in table 'user' that means you can access via TCP/IP, if you set 'localhost' that means you can connect to the database through unix socket. Please, look in the manual: http://www.mysql.com/doc/C/o/Connection_access.html http://www.mysql.com/doc/A/c/Access_denied.html http://www.mysql.com/doc/A/d/Adding_users.html MH Thanks MH Michael -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Re: Foreign keys in InnoDB tables
Martin, -Original Message- From: Martin Bratbo [EMAIL PROTECTED] Newsgroups: mailing.database.mysql Date: Saturday, February 16, 2002 4:46 PM Subject: Re: Re: Foreign keys in InnoDB tables Heikki here is the statements that i cant get to work: first I create one innoDB table: fk1 create table fk1( noegle integer primary key, tekst varchar(20))type=InnoDB; then I create a second InnoDB table: fk2which references the first: create table fk2( prim integer primary key, frem integer, Foreign key fk (frem) references fk1(noegle))type=InnoDB; you have a syntax error here: after FOREIGN KEY you have a symbol 'fk'. MySQL+InnoDB ignores the constraint. The syntax of a foreign key constraint definition in InnoDB: FOREIGN KEY (index_col_name, ...) REFERENCES table_name (index_col_name, ...) Note that you should not use quoted table or column names in a FOREIGN KEY clause. The InnoDB parser does not currently know that notation. An example: CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id)) TYPE=INNODB; Both tables have to be InnoDB type and there must be an index where the foreign key and the referenced key are listed as the first columns. InnoDB does not auto-create indexes on foreign keys or referenced keys: you have to create them explicitly. Best regards, Heikki Tuuri Innobase Oy --- Order technical MySQL/InnoDB support at https://order.mysql.com/ See http://www.innodb.com for the online manual and latest news on InnoDB I then insert a tuple into the first table insert into fk1 values (1,'xx'); no problem then I insert a tuple into the second table a tuble that shoud have been rejected because it violates the referntial integrity insert into fk1 values (1,'xx'); but this tuple is accepted and inserted into fk2 it seem that the foreig keyconstraint doesn't do anythig even thoug both tabels are InnoDB tables, is the any settings that is neccesarry to activate the constraint ? my my.ini file is as follows: [mysqld] basedir=d:/mysql datadir=d:/mysql/data innodb_data_file_path=ibdata1:500M;ibdata2:500M innodb_data_home_dir=D:\mysql\innodb set-variable=innodb_mirrored_log_groups=1 innodb_log_group_home_dir=D:\mysql\iblogs set-variable=innodb_log_files_in_group=3 set-variable=innodb_log_file_size=30M set-variable=innodb_log_buffer_size=8M innodb_flush_log_at_trx_commit=1 #.._arch_dir must be the same as .._log_group_home_dir innodb_log_arch_dir=D:\mysql\iblogs innodb_log_archive=0 set-variable=innodb_buffer_pool_size=70M #454 MySQL Technical Reference for Version 4.0.1-alpha set-variable=innodb_additional_mem_pool_size=10M set-variable=innodb_file_io_threads=4 set-variable=innodb_lock_wait_timeout=50 Regards Martin, there is a bug in 4.0.1 which can make a foreign key definition to fail in an assertion failure in dict0crea.c, if you have set default-character-set to something else than latin1 in my.cnf. Harald Fuchs reported the bug on this mailing list a couple of days ago, and the bug is now fixed in 4.0.2. Please send your my.cnf or my.ini to this mailing list, and post the exact sequence of SQL statements which in your opinion produces a wrong response. Best regards, Heikki Tuuri Innobase Oy --- InnoDB - transactions, row level locking, and foreign key support for MySQL See http://www.innodb.com, download MySQL-Max from http://www.mysql.com Martin Bratbo wrote in message ... According to the manual it should in fact be possible to enforce foreign key constraint in MySql if both the referreing and referred tables are of type InnoDB. But I haven't been able to, make the foreign keys work, they did'nt blok any insertions. Are foreign keys still only for compability, or is there a way to actually make the constraints work if the tables are InnoDB ? I am running 4.0.1-alpha-max on win98 Regards Martin Bratbo - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Statistical analysis query?
You're stumped!? Where does that leave us? Unfortunately (AFAIK) the sample data you have enclosed does not demonstrate the condition you seek to describe - perhaps it would have been better if you gave us a replicable example, so that we can UNDERSTAND the problem before we try to help you out. Neither did you enclose your current best-shot so that we might see how you have approached the problem (and perhaps further 'discover' aspects of the problem) [grumble!] Forgive me for ignoring the finer points of your requirement, in an attempt to actually get the 'right data' coming off the tables first...What does the following query do for you? SELECT volunteer.VID, volunteer.Name, no_show_shifts.SID, no_show_shifts.DATE, shifts.SID, shifts.DATE, count() FROM volunteer, no_show_shifts, shifts WHERE no_show_shifts.VID = volunteer.VID AND shifts.VID = volunteer.VID GROUP BY volunteer.VID HAVING no_show_shifts.DATE shifts.DATE Does the COUNT() have to mention no_show_shifts.DATE or .SID? I would think that it does not really matter becasue are SIDs are unique and sequential ( if a volunteer pooped out on shift 198 and came the next day and did shift 200 we know he had an earlier cancelation). I'll see where I can get with your query and let you know what I get. Please advise, =dn - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Suspected Bug
* Miguel Angel Solorzano snip * Roger Baklund mysql rename table U1 to U2; ERROR 7: Error on rename of '.\test\u1.MYI' to '.\test\u2.MYI' (Errcode: 13) mysql alter table U1 rename as U2; Query OK, 0 rows affected (0.01 sec) snip How you can see we don't have a constant behavior of the Windows OS in the handle of lower/upper case names. The user should know if his application will works on NT/Win2K should expects error messages with write operation using different syntax with the lower/upper case. Thanks for the detailed reply. :) I did my tests on a pretty old version, 3.23.30-gamma, on a win2k machine. I was not aware of the lower_case_table_names variable. (This explains why I got lower case filename in my error message, while Fred Lovine got upper case filename... I was a bit puzzled about that.) Can we from this conclude that it is safer to use all lowercase table names when one want to make an application that should run on _any_ platform? That way there should never be an error because of letter casing in table names, regardless of the lower_case_table_names setting, windows version and even mysql version (at least 3.23.6 and later)? There is a phrase about this in the documentation: If you have a problem remembering the used cases for a table names, adopt a consistent convention, such as always creating databases and tables using lowercase names. URL: http://www.mysql.com/doc/N/a/Name_case_sensitivity.html Maybe this should be upgraded to an advise to use lowercase names to assure cross platform and version compatibility? -- Roger query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Selecting records with the highest value no greater than x
* [EMAIL PROTECTED] In Re: Selecting records with the highest value no greater than x, [EMAIL PROTECTED] wrote: IMO, there is one, if I did understand the question correctly: SELECT * FROM NEWS WHERE RATING = 4 ORDER BY RATING DESC, RAND() LIMIT 1; This give back a random news entry of the highest score available, but smaller than 5. It just gives back a random news story, as it is logically identical to SELECT * FROM NEWS WHERE RATING = 4 ORDER BY RAND() LIMIT 1; No, it's not. The former will sort on the rating first, and then do a random sort within each rating group. You would need a 'non-uniform' random function for your version to work. I don't understand why you say this. Benjamin's ORDER BY clause will select a random row among those having the highest rating lower or equal to four, just as one would expect from the statement. -- Roger query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
User Tables
I just reinstalled MySQL 4.01 (Mandrake 8.1) and am having a problem using the GRANT statement. When trying to grant privileges in a database, I get an error message that the User table is read only. I've checked the permissions and they're OK, includes read and write. Am I looking at the right files, /mysql/mysql/user.* ? Rich -- [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Error untarring MySQL on a RAQ3
While untarring MySQL on a RAQ3 using: tar -xvfz mysql-3.23.32.tar.gz I recieved the following errors: tar: Cannot open z: No such file or directory tar: Error is not recoverable: exiting now Any Help? Should there be a z: directory? And where? Doug Cotton [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Distributed Fulltext?
On Fri, 2002-02-15 at 02:44, Alex Aulbach wrote: Wednesday, from David Axmark: Your other point about exact vs. approximate answers is unclear, I expect that Google's answers are exact for their currently available indexes at any given time. But even if they are approximate, I'd be happy with that too. The scoring on a FULLTEXT search in Mysql is exact but based on a formula that is approximate anyway. No, MySQL returns all data according to a search. Web engines return what they they find on one search machine. So you can get different results with Google every time you hit refresh if you are routed to different machines. This had happened to me when I was looking for the number of matches and not the result itself. So we should try to make fulltext searches with a limit between 10 and 100 be fast to be closer to google. I have also head about some other things web search engines do since I know some people at FAST but I have forgot that already. My opinion is, that mySQL itself never should try to find approximate matches. This is against the definition of SQL itself. SQL is a fourth generation language. That means, if you say SELECT, the engine selects. And it has to be as exactly that, what I have searched, every time, on every machine in any combination with the same data. So SQL needs a new language construct to make an approximate search. But what is an approximate search? How is approximate defined? I agree, If there is a good technical reason for doing so. I would be willing to add a keyword APPROXIMATE for such a thing. But it would have to be a extremely clear even to uninitiated that this is approximate. I can se such a feature used by the people who build search engines with MySQL. I don't think it is a good idea to implement it in this way. Approximazation must be always done on the application level, cause it is highly dependend on application, what an approximate result could be. We will try to make every feature as good as possible. But we do have limited resources. Exactly. FTS is not so important as other features and people which want you to include a new feature should think about supporting mysql with money. :-) But (yes, we support mysql! :-) I think the need is growing rapidly, cause the amount of data, that has to be indexed is growing over the years. And other DB's have much more experices with it. Currently we can live with the speed. Those who cannot live with it should buy better machines, think about their SE-concept or support mysql. Search engines techniques are *not* trivial, so the last way is in my eyes one of the cheapest. Well there is always the option of sponsoring further fulltext development. We have a guy who has been working on the GNU fulltext engines who is interesting in working with MySQL fulltext. But for the moment we can not afford it. This was my first thought: People write about speed problems and how to cluster and so on. Things, that I would calculate with weeks and high TCO. But it maybe much cheaper to pay mySQL for this. How much do you estimate would it cost to implement inverted files? I think this is difficult, cause Sergei told me, that he couldn't use mySQL-index files any more. If needed we could add a new index file (.MYT ?). But what would require some internal changes of unknown (to me) size. But if this is needed for continues development of fulltext we will do it. I just ask, nothing special in sight, but many questions from everyone who needs it. Cause FTS is a feature which highly improves the value of a web site. And coustomers have no problem to pay for things they think they get money for. FTS is such a thing. But perhaps if we know, under which circumstances FTS is improved, it is easier for us to find a possible way to share the costs for it or find a compromise. I also understand, if mySQL don't want to speak about it here. I think it is also important for us, how much it can be theoretically improved. My calculations showed me a theoretical speed up of factor 100 or so. This is ... wow. But in live everything is most times slower... We want to do things as fast as possible in most cases. We will try to do this for text-search also but the question is how long time it will take before we finish. So if some of you are interested in sponsoring this (or know about others who might be) write to [EMAIL PROTECTED] Or like this... maybe we find coustomers who needs it. Think it's possible. My personal feeling is and my stomach says, that fulltext indexing is a feature, which needs to be expanded. We do have Sergei working on it still. And we do plan to expand it during the coming months. But the way to get our attention in cases like this is simple. Give us some core or money! /David - Before posting, please check:
RE: Error untarring MySQL on a RAQ3
tar -xvfz mysql-3.23.32.tar.gz tar: Cannot open z: No such file or directory tar: Error is not recoverable: exiting now Any Help? Should there be a z: directory? And where? Try: tar zxvf mysql-3.23.32.tar.gz z = gzipped x = eXtract v = verbose f = file You had a 'z' after the 'f', therefore tar thought 'z' was the file to untar :) :wq //andreas http://phpwizard.dk - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
urgent : Problem in Group by clause
hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i want to get details about whose files are designed by who..etc... that is i need to use group by in select statement.. i want to display the details in the web page ... say there are 3 records as below against each field: 1. 'a.jpg','test','david','john','2002-02-14' 2. 'b.bmp','bmp file','richard','mary','2002-02-14' 3. 'c.htm','web','david','mary','2002-02-15' now i want to display the details grouped by Designer (the third field). when i use the following query: select FileName,Title,Designer,UploadedBy,SubmittedDate From UploadDetails Group By Designer i get only one row... why? can anyone solve this problem... thanks in advance Shankar __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
urgent : Problem in Group by clause
hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i want to get details about whose files are designed by who..etc... that is i need to use group by in select statement.. i want to display the details in the web page ... say there are 3 records as below against each field: 1. 'a.jpg','test','david','john','2002-02-14' 2. 'b.bmp','bmp file','richard','mary','2002-02-14' 3. 'c.htm','web','david','mary','2002-02-15' now i want to display the details grouped by Designer (the third field). when i use the following query: select FileName,Title,Designer,UploadedBy,SubmittedDate From UploadDetails Group By Designer i get only one row... why? can anyone solve this problem... thanks in advance Shankar __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: urgent : Problem in Group by clause
Hi Shankar, This is your old buddy Scott S. Try order by rather than group byThis will get you what you are looking for Scott Salisbury - Original Message - From: SankaraNarayanan Mahadevan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 16, 2002 3:42 PM Subject: urgent : Problem in Group by clause hi all, i have a problem in mysql query... lemme state the scenario... i have a table 'UploadDetails' in which i am storing data regd files... the fields are: FileName, Title, Designer, UploadedBy, SubmittedDate i want to get details about whose files are designed by who..etc... that is i need to use group by in select statement.. i want to display the details in the web page ... say there are 3 records as below against each field: 1. 'a.jpg','test','david','john','2002-02-14' 2. 'b.bmp','bmp file','richard','mary','2002-02-14' 3. 'c.htm','web','david','mary','2002-02-15' now i want to display the details grouped by Designer (the third field). when i use the following query: select FileName,Title,Designer,UploadedBy,SubmittedDate From UploadDetails Group By Designer i get only one row... why? can anyone solve this problem... thanks in advance Shankar __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Suspected Bug
At 17:59 16/02/2002 +0100, Roger Baklund wrote: Hi, Thanks for the detailed reply. :) I did my tests on a pretty old version, 3.23.30-gamma, on a win2k machine. I was not aware of the lower_case_table_names variable. (This explains why I got lower case filename in my error message, while Fred Lovine got upper case filename... I was a bit puzzled about that.) Can we from this conclude that it is safer to use all lowercase table names when one want to make an application that should run on _any_ platform? In my personal opinion yes, not only this but to use short description names and avoiding blank spaces. However I know that the developer sometimes doesn't have option. That way there should never be an error because of letter casing in table names, regardless of the lower_case_table_names setting, windows version and even mysql version (at least 3.23.6 and later)? There is a phrase about this in the documentation: If you have a problem remembering the used cases for a table names, adopt a consistent convention, such as always creating databases and tables using lowercase names. URL: http://www.mysql.com/doc/N/a/Name_case_sensitivity.html Maybe this should be upgraded to an advise to use lowercase names to assure cross platform and version compatibility? Yes. Regards, Miguel -- Roger query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- For technical support contracts, goto https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Miguel A. Solórzano [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer /_/ /_/\_, /___/\___\_\___/ Mogi das Cruzes - São Paulo, Brazil ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
suse linux 7.3
well I am running suse linux 7.3 and well to be honest I am a real newbie, so here I go I am gettingh this error msg cant connect to local mysql server through socket /var/liv/mysql/mysql.sock so what should I do_ what does this error msg mean_ cheers - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How compressable is a typical MySQL database?
Hi list, How compressible is a typical MySQL database? Is this more dependent on the type of columns used i.e. a lot of text columns as opposed to a lot of columns containing integer values? The uncompressed size of the database is in the region of about 800-MB. Also will it suffice to only compress the specific sub-directory pertaining to the relevant database below /mysql/ ? George mysql, sql, query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How compressable is a typical MySQL database?
would probably be very dependent on the data within the database. if it's a lot of text data, then very compressable, as text typically compresses nicely. if you store a bunch of binary data (images or something), then probably not as much... tar your mysql dir and gzip it, or gzip -9 or bzip2 if you're looking for more compression. test it out. -tcl. On Sun, 17 Feb 2002, George Labuschagne wrote: Hi list, How compressible is a typical MySQL database? Is this more dependent on the type of columns used i.e. a lot of text columns as opposed to a lot of columns containing integer values? The uncompressed size of the database is in the region of about 800-MB. Also will it suffice to only compress the specific sub-directory pertaining to the relevant database below /mysql/ ? George mysql, sql, query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How compressable is a typical MySQL database?
Sorry, I forgot to ask the folowing as well. When considering the amount by which text can be compressed as compared to other data types, would it be better to store numerical values as text or to store them as integer/float values. If the db needs to be compressed and backed up on a bi-weekly basis. George tc lewis [EMAIL PROTECTED] 02/17 2:14 AM would probably be very dependent on the data within the database. if it's a lot of text data, then very compressable, as text typically compresses nicely. if you store a bunch of binary data (images or something), then probably not as much... tar your mysql dir and gzip it, or gzip -9 or bzip2 if you're looking for more compression. test it out. -tcl. On Sun, 17 Feb 2002, George Labuschagne wrote: Hi list, How compressible is a typical MySQL database? Is this more dependent on the type of columns used i.e. a lot of text columns as opposed to a lot of columns containing integer values? The uncompressed size of the database is in the region of about 800-MB. Also will it suffice to only compress the specific sub-directory pertaining to the relevant database below /mysql/ ? George mysql, sql, query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How compressable is a typical MySQL database?
In that case, i would highly recommend using mysqldump to backup your databases. Simply compressing the actual DB's could give you tables in inconsistent states, UNLESS you first shut down your DB server, then run the backup. Something to think about. j- k- On Saturday 16 February 2002 15:26, George Labuschagne wrote: Sorry, I forgot to ask the folowing as well. When considering the amount by which text can be compressed as compared to other data types, would it be better to store numerical values as text or to store them as integer/float values. If the db needs to be compressed and backed up on a bi-weekly basis. George tc lewis [EMAIL PROTECTED] 02/17 2:14 AM would probably be very dependent on the data within the database. if it's a lot of text data, then very compressable, as text typically compresses nicely. if you store a bunch of binary data (images or something), then probably not as much... tar your mysql dir and gzip it, or gzip -9 or bzip2 if you're looking for more compression. test it out. -tcl. On Sun, 17 Feb 2002, George Labuschagne wrote: Hi list, How compressible is a typical MySQL database? Is this more dependent on the type of columns used i.e. a lot of text columns as opposed to a lot of columns containing integer values? The uncompressed size of the database is in the region of about 800-MB. Also will it suffice to only compress the specific sub-directory pertaining to the relevant database below /mysql/ ? George mysql, sql, query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- Joshua Kugler, Information Services Director Associated Students of the University of Alaska Fairbanks [EMAIL PROTECTED], 907-474-7601 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Cannot create or delete databases
Hello, Just recently I started having problems creating and deleting databases... When I login as the user root I get this error when I try and create or delete a DB. ERROR 1006: Can't create database 'tier2'. (errno: 13) I am fully aware that the errno: 13 is a permissions denied error code. the following are the GRANTS that have been givin to the user ROOT: +--- | Grants for root@localhost +--- | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '546d9699645d04f3' WITH GRANT OPTION | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON guestbook2k.* TO 'root'@'localhost' | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON cbms.* TO 'root'@'localhost' | | GRANT ALL PRIVILEGES ON test.* TO 'root'@'localhost' +--- I have been pullin my hair out over this onefor the past 12 hours.. I even uninstalled mySQL and reinstalled it to see if that would fix the problem..unfortunatly it did not.. Any help or advice would be greatly appreciated.. Thx Troy - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
beginner question: how many queries via PHP are...
Hello I am new to the subject. I am experimenting in mysql via PHP with a nice book (PHP and MySQL Web development). My question is how many queries to mysql, made via PHP, should considered ok for efficiency. I know it has much to do with the size of databases, but I would like to get an idea. Thanks. Nikolas - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: beginner question: how many queries via PHP are...
I am new to the subject. I am experimenting in mysql via PHP with a nice book (PHP and MySQL Web development). My question is how many queries to mysql, made via PHP, should considered ok for efficiency. I know it has much to do with the size of databases, but I would like to get an idea. Thanks. Unfortunately there really is no set number one could come up withit all depends on what you need, the intended load of the server, speed of the queries, optimizations of both MySQL and the OS, the system you're using and a plethora of other variablesbasically remember it's not size but speed that determines efficiency...so if it takes 2 seconds to complete 5 queries you'd be better off doing that than a single query for the same information that thats 5 seconds to complete =) Sincerely, Craig Vincent - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
inserting into sets
Would someone please tell me how to insert sets into a MySQL DB? e.g. insert into table_name (x) values ('a', 'b', 'c', 'd'); , where x is a set. I am unsure on what should be inside of the second set of parentheses. Sorry to be posting a syntax question to the list, but I don't see it spelled out in the manual, or at least I am unable to figure it out if it is there, and I thought that it would be easy to answer for one of you. I have wasted lots of time searching the web for the syntax, as well as experimenting, with no results. Thanks, John PS: Here is what I am trying to do in more detail if it helps. mysql describe applicant_ext_skills; +---++--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---++--+-+-+---+ | applicant_num | int(5) | | PRI | 0 | | | unix_arr | set('rlogin','ls','cd','more','kill','cp','mv','rm','mkdir','pwd','rmdir','chmod','quota','du','lprm','man','ftp','grep','ps','lpq','lpr','pipe','redirect','mpage','newuser') | YES | | NULL| | +---++--+-+-+---+ mysql insert into applicant_ext_skills (applicant_num, unix_arr) values (3, 'rlogin', 'ls', 'cd', 'more', 'kill', 'cp', 'mv', 'rm', 'mkdir'); Query OK, 1 row affected (0.00 sec) mysql Where the collection of unix commands is the set I am trying to insert. However, nothing seems to be getting stored. mysql select applicant_num from applicant_ext_skills; +---+ | applicant_num | +---+ | 0 | | 1 | | 2 | | 3 | +---+ 4 rows in set (0.00 sec) mysql select unix_arr from applicant_ext_skills; +--+ | unix_arr | +--+ | NULL | | | | | | | +--+ 4 rows in set (0.00 sec) mysql - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
operating system error number 3
Hello everyone: I am hoping you can help me. I have Windows 98 SE as my operating system. I have installed MySQL 4.0.1. I originally had Win ME and MySQL 3.23.48 but could not make them work together. Hopefully, someone will be able to help me. The error I am getting is InnoDB: Warning: operating system error number 3 in a file operation. InnoDB: Cannot continue operation. I have never used MySQL in my life before this. I have read the manual and done an online search to figure out how to fix this error but have had no luck. If you are able to help me please be detailed in how I am to fix this problem. Any help will be appreciated. I am trying to develop this database for a Church to use. Thank-you, Loretta - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
I need MySQL-DBI-perl-bin but can only find Mysql-dbi-perl-bin
Hello, I'm sure this is a rehash of a common benchmark installation problem, but my searches have not yielded a satisfactory answer. I've been digging through some old threads related to this subject, but I'm still unable to find MySQL-DBI-perl-bin that is required by MySQL-bench-3.23.48-1.i386.rpm. I can find a ton of links to Mysql-DBI-perl-bin, though. Follows is the output from my attempt at installing the benchmark RPM that I downloaded from one of the mysql mirror sites. rpm -i MySQL-bench-3.23.48-1.i386.rpm error: failed dependencies: MySQL-DBI-perl-bin is needed by MySQL-bench-3.23.48-1 Thanks in advance, Ryan _ Send and receive Hotmail on your mobile device: http://mobile.msn.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: operating system error number 3
At 23:29 16/02/2002 -0500, Loretta wrote: Hi! Hello everyone: I am hoping you can help me. I have Windows 98 SE as my operating system. I have installed MySQL 4.0.1. I originally had Win ME and MySQL 3.23.48 but could not make them work together. Hopefully, someone will be able to help me. Sorry but in Windows you can't to run simultaneously both versions. You only can have one server running. The error I am getting is InnoDB: Warning: operating system error number 3 in a file operation. InnoDB: Cannot continue operation. Because InnoDB found the other server already running. Regards, Miguel I have never used MySQL in my life before this. I have read the manual and done an online search to figure out how to fix this error but have had no luck. If you are able to help me please be detailed in how I am to fix this problem. Any help will be appreciated. I am trying to develop this database for a Church to use. Thank-you, Loretta - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- For technical support contracts, goto https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Miguel A. Solórzano [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer /_/ /_/\_, /___/\___\_\___/ Mogi das Cruzes - São Paulo, Brazil ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: inserting into sets
At 22:47 -0500 2/16/02, John Fulton wrote: Would someone please tell me how to insert sets into a MySQL DB? e.g. insert into table_name (x) values ('a', 'b', 'c', 'd'); , where x is a set. I am unsure on what should be inside of the second set of parentheses. A SET value is a single string constructed from individual SET members separated by commas. INSERT INTO table_name (x) VALUES('a,b,c,d'); Sorry to be posting a syntax question to the list, but I don't see it spelled out in the manual, or at least I am unable to figure it out if it is there, and I thought that it would be easy to answer for one of you. I have wasted lots of time searching the web for the syntax, as well as experimenting, with no results. Thanks, John PS: Here is what I am trying to do in more detail if it helps. mysql describe applicant_ext_skills; +---++--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---++--+-+-+---+ | applicant_num | int(5) | | PRI | 0 | | | unix_arr | set('rlogin','ls','cd','more','kill','cp','mv','rm','mkdir','pwd','rmdir','chmod','quota','du','lprm','man','ftp','grep','ps','lpq','lpr','pipe','redirect','mpage','newuser') | YES | | NULL| | +---++--+-+-+---+ mysql insert into applicant_ext_skills (applicant_num, unix_arr) values (3, 'rlogin', 'ls', 'cd', 'more', 'kill', 'cp', 'mv', 'rm', 'mkdir'); Query OK, 1 row affected (0.00 sec) mysql Where the collection of unix commands is the set I am trying to insert. However, nothing seems to be getting stored. mysql select applicant_num from applicant_ext_skills; +---+ | applicant_num | +---+ | 0 | | 1 | | 2 | | 3 | +---+ 4 rows in set (0.00 sec) mysql select unix_arr from applicant_ext_skills; +--+ | unix_arr | +--+ | NULL | | | | | | | +--+ 4 rows in set (0.00 sec) mysql - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Fw: WIN/Linux Compatibility
Hi all, I was wondering if there is any chance that table information is compatible between Windows and Linux? IE. If I copy windows data files to a linux server, can mySQL on the linux server read this data? I don't believe this is possible, but I couldn't find any posts and wanted to confirm. I realize that we may need to import through an SQL query. Thanks in advance. Alex Charlton [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Fw: WIN/Linux Compatibility
On Sun, 2002-02-17 at 02:54, Alex Charlton wrote: Hi all, I was wondering if there is any chance that table information is compatible between Windows and Linux? Hi Alex, MyISAM tables are (mostly) OS and platform independent. You should be able to copy them between Linux and Windows without changes See http://www.mysql.com/doc/M/y/MyISAM.html If you are using another type of table, please check the relevent section of the MySQL documentation. Ciao! -- __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Zak Greant [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Advocate /_/ /_/\_, /___/\___\_\___/ Calgary, Canada ___/ www.mysql.com 403.244.7213 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How compressable is a typical MySQL database?
On Sat, Feb 16, 2002 at 03:56:42PM -0900, Joshua J.Kugler wrote: In that case, i would highly recommend using mysqldump to backup your databases. Simply compressing the actual DB's could give you tables in inconsistent states, UNLESS you first shut down your DB server, then run the backup. Not true at all. Try this: FLUSH TABLES WITH READ LOCK back stuff up UNLOCK TABLES It's safe and keeps the server on-line. Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.47-max: up 9 days, processed 318,436,941 queries (379/sec. avg) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php