RE: sporadic error 13 on windows
-Original Message- From: Artem Kuchin [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 9:23 AM To: Baron Schwartz Cc: mysql@lists.mysql.com Subject: Re: sporadic error 13 on windows DBD::mysql::st execute failed: Can't create/write to file '#sql_948_0.MYD' (Errcode: 13) at cleanfilestore.pl line 89, STDIN ine 1. DBD::mysql::st fetchrow_array failed: fetch() without execute() at cleanfilestore.pl line 90, STDIN line 1. DBD::mysql::st execute failed: Can't create/write to file '#sql_948_0.MYD' (Errcode: 13) at cleanfilestore.pl line 89, STDIN ine 1. DBD::mysql::st fetchrow_array failed: fetch() without execute() at cleanfilestore.pl line 90, STDIN line 1. DBD::mysql::st execute failed: Can't create/write to file '#sql_948_0.MYD' (Errcode: 13) at cleanfilestore.pl line 89, STDIN ine 1. DBD::mysql::st fetchrow_array failed: fetch() without execute() at cleanfilestore.pl line 90, STDIN line 1. I found several places where anti-virus as referenced as the culprit. Did you look into that yet? http://forums.slimdevices.com/showthread.php?t=30543page=2 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Log Warnings Level
-Original Message- From: Colin Charles [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 17, 2007 9:08 PM To: Kristen G. Thorson Cc: mysql@lists.mysql.com Subject: Re: Log Warnings Level Kristen G. Thorson wrote: Hi! But all I really get from this reading is 0 turns it off, 1 prints some warnings, and 2 prints level 1 warnings plus aborted connections warnings. I have not been able to find any additional information in my search. Am I missing something, or is this all the documentation there is on this? What kind of additional information are you looking about the --W (or --log-warnings=N) option? Thank you for the response. I was looking for information on how high the level can go - 2? 5? 200? - and what types of warnings are logged for a given level? I'd pay attention to aborted connections, as MySQL Network's monitoring service actually does do so I'm not sure what you mean by this. Could you clarify? Thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Log Warnings Level
The manual indicates that you can specify a specific level to control what types of warnings are logged: http://dev.mysql.com/doc/refman/5.0/en/server-options.html (See section on log-warnings.) But all I really get from this reading is 0 turns it off, 1 prints some warnings, and 2 prints level 1 warnings plus aborted connections warnings. I have not been able to find any additional information in my search. Am I missing something, or is this all the documentation there is on this? Thanks, Kristen G. Thorson Programmer (804) 553-1130, Ext. 204 www.AllegroConsultants.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Reports
-Original Message- From: Ahmad Al-Twaijiry [mailto:[EMAIL PROTECTED] Sent: Friday, October 20, 2006 10:00 AM To: MySQL List Subject: Reports Hi everyone do you know any good (free) application that make it easy to generate (with charts) a very nice reports from mysql ? This is a very good tool. I don't use the charts features, so I'm not sure how advanced those are. http://jasperforge.org/sf/projects/ireport -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: 'Not a valid MySQL result resource' error
-Original Message- From: List [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 9:30 PM To: mysql@lists.mysql.com Subject: 'Not a valid MySQL result resource' error Hello, I'm running f.a.m.p, f =freebsd 4.7 and mysql is 3.23.52. Anyway, I inherited a website from someone else's server(I don't know what they we're running) but the admin section of the website generates this error iin the apache error log when trying to login( on the screen just takes you back to login saying invalid: snip [Tue Oct 17 19:10:08 2006] [error] PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /usr/local/apache/website/incoming/_includes/_page-specialeventsnav.php on line 16 This is the first error. So look for the MySQL-Link resource suppiled to mysql_query(). $r = mysql_query($x,$db); $x is a string, so that's not it. $db should be the resource, so it's the one throwing the error. So you either don't have a connection, or that's the wrong variable for your connection. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: how to store quotes in mysql?
battling this problem on several forums and mailing lists, I got confused: when store string that contains quotations (ie afan's php shop) in mysql does it have to be stored with backslashes (afan\'s \php\ shop) or just the way it is? my login's telling me the way it is. am I wrong? Yes, MySQL stores it that way for a specific reason. That is strings are generally input in the form: INSERT INTO table (blah) VALUES('blah'); That said, if you didn't have the slash escape, you'd have something like: INSERT INTO table (blah) VALUES('I'm blah); Which MySQL would choke on, not knowing what to do with m blah. Also, this is done to prevent SQL injection, like: INSERT INTO table (blah) VALUES('[bl' ; DELETE FROM table; SELECT('ah]'); where [] is what the user inputs. Now when displaying, you'll have to unescape the slashes generally. Unfortunately I can't remember in PHP if that's because of magic quotes or just the way the db has it stored. My gut instinct is the former. No no no no. If you have to unescape your data before you display it, then you escaped it too many times. If you have the following query: INSERT INTO myTable VALUES ('I\'m Happy'); MySQL does NOT store this value as I\'m Happy it is stored as I'm Happy The escape character is needed so that the interpreter that reads your SQL commands can understand the query. MySQL does not choke on apostrophes or quotes. It has no problem with them. They're just characters. The interpreter needs to know the difference between a string-defining quote and a quote that is part of the data. Hence the escape characters. Just as if you have the following PHP code: ?php echo 'I\'m Happy'; ? PHP does not print out I\'m Happy it prints out I'm Happy The problem is indeed caused by magic quotes. Magic quotes automagically escapes data for you. When you escape your escaped data with addslashes or the like, you're escaping your escape characters as well. kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: how to store quotes in mysql?
-Original Message- From: Chris White [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 09, 2006 11:43 AM To: mysql@lists.mysql.com Subject: Re: how to store quotes in mysql? On Wednesday 09 August 2006 08:37 am, Kristen G. Thorson wrote: [ stuff here ] kgt I'm confused.. did you read my email? Most of what you said doesn't seem to correlate with what I said. Can you quote the specific lines that you're disagreeing with? -- Chris White PHP Programmer/DBacillus Interfuel Sure: Yes, MySQL stores it that way for a specific reason. MySQL does not STORE escape characters, unless you have escaped an escape character. The following query: INSERT INTO myTABLE VALUES ('I\'m Happy'); is instructing MySQL to store the string value I'm Happy. It does not store I\'m Happy. Now when displaying, you'll have to unescape the slashes generally. A clear indication that you have over-escaped your data. If you have properly escaped your queries, then you should never need to unescape them. If SELECT string_value FROM myTable; returns I\'m Happy then you have inserted your data as follows: INSERT INTO myTable VALUES( 'I\\\'m Happy' ); This happens because magic quotes produced escaped data: I\'m Happy You then run addslashes() or similar and end up with this: I\\\' Happy kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Is select ... insert working with 3.23(58) ??
RAPPAZ Francois wrote: Hi I'm stuck with a sequence of sql commands to duplicate a record whithin the same table (server is 3.23.58): I have table t1 with data : char and id: auto_increment, int, unsigned, primary key. I would like to do the following SET @template = 104; DROP table IF EXISTS tmp; CREATE TABLE tmp SELECT data FROM t1 WHERE [EMAIL PROTECTED]; INSERT INTO t1 (id, data) SELECT null as id, tmp.data FROM tmp; And I always get 0 rows inserted. By the way last_insert_id() gives something meaningfull: the id is incremented, but the other fields are left empty. I there a way to get this working with that server version ? Thanks for any help François Rappaz Works for me on 3.23.58-log. Make sure @template is an id that exists. [EMAIL PROTECTED] root]# mysql test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1382731 to server version: 3.23.58-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql CREATE TABLE `t1` ( `id` int(11) NOT NULL auto_increment, `data` char(3) NOT NULL default '', PRIMARY KEY (`id`) ); Query OK, 0 rows affected (0.01 sec) mysql INSERT INTO t1 SELECT id, code AS data FROM VATtest.VAT_locations; Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0 mysql SELECT * FROM t1; ++--+ | id | data | ++--+ | 1 | 1| | 2 | 2| | 3 | 3| | 4 | 40 | | 5 | 50 | | 6 | 51 | | 7 | 60 | | 8 | 99 | ++--+ 8 rows in set (0.00 sec) mysql SET @template = 1; Query OK, 0 rows affected (0.00 sec) mysql DROP table IF EXISTS tmp; Query OK, 0 rows affected (0.00 sec) mysql CREATE TABLE tmp SELECT data FROM t1 WHERE [EMAIL PROTECTED]; Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql INSERT INTO t1 (id, data) SELECT null as id, tmp.data FROM tmp; Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql SELECT * FROM t1; ++--+ | id | data | ++--+ | 1 | 1| | 2 | 2| | 3 | 3| | 4 | 40 | | 5 | 50 | | 6 | 51 | | 7 | 60 | | 8 | 99 | | 9 | 1| ++--+ 9 rows in set (0.00 sec) kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: what happened to error log in MySQL 4.1x/Windows XP
[EMAIL PROTECTED] wrote: Hi, I haven't admin'd MySQL in a couple of years, and I have forgotten and lot (and probably never knew even more.) I recently installed the current 4.1x MySQL release in Windows XP. I am trying to track down problems, and can't seem to get an error log. I expected to see a file, mysql.err in the data directory. Not only isn't it there, but trying to add something like err-log (extrapolating from the --err-log I'd used in Unix) in the mysqld area of the my.ini file prevents the server from launching, so that is clearly either not the correct syntax or not the correct place for such a line (or both). Next, is there supposed to be a way to start/restart MySQL in Windows other than by going to the Services panel for the general computer? Is this something that can be done from the command line? Many thanks, ari [EMAIL PROTECTED] Manual: http://dev.mysql.com/doc/refman/5.0/en/error-log.html |log-error in my.ini should work. kgt | -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SHOW commands.
Michael Williams wrote: Thanks for the responses everyone. Just a quick FYI, I am using Python as an intermediary to sync the DBs (I'm fine with using whatever as long as it's Debian compatible). I suppose I should have explained before, but I'm using the Python script to connect from a client machine to a server machine which is why I prefer a command to be able to 'sync' the data. Although I will have DB access on the server, there is no guarantee that I'll have actual disk write access. Hence, again, the need to be able to query for the command so as to write it to a text file on the client machine for use, etc. Sort of a hey, server, what would it take to make table BLAH if I wanted to recreate it completely? kind of thing. There's no one command, but you can build it by pulling the information you need from: SHOW FIELDS FROM table SHOW KEYS FROM table And then of course a select on the table. I have some PHP code that does this, and it's only 50 lines or so. kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Insert query problem
Jeff wrote: tickets(id,from,department,subject,body,lastaction,lastpost,priority,sta tus,created,fromname,lastpostname,attach,ct,uniq,notify,replyto) values(null,'jmckeon','1','test','test test',unix_timestamp(now()),'[EMAIL PROTECTED] [EMAIL PROTECTED]','Medium','Open',unix_timestamp(now()),'Jeff McKeon','Jeff McKeon','','','ks5hslajdfasd','1','[EMAIL PROTECTED]') Use `from` (those are backticks) See: http://dev.mysql.com/doc/refman/5.0/en/legal-names.html kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: REITF?
http://www.google.com/search?hl=enlr=q=real+estate+investment+trustbtnG=Search REIT = real estate investment trust Maybe the extra F is for fund? I didn't see any mention of REITF - but I have seen the acronym REIT before. kgt Ed Curtis wrote: Does anyone on the list know what REITF stands for? I'm guessing it's some type of data format for real estate information but I can't find any information on it anywhere. Thanks, Ed -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Convert Subquery - need to find max of a set
I need to convert this query into one without a subquery: SELECT r.selector_forms_results_max_points AS points, r.selector_forms_results_description AS description, FROM selector_forms_results AS r WHERE r.selector_forms_id = 1 AND r.selector_forms_results_max_points = ( SELECT DISTINCT r.selector_forms_results_max_points AS max_points FROM selector_forms_results AS r WHERE r.selector_forms_results_max_points = 12 ORDER BY r.selector_forms_results_max_points DESC LIMIT 1 ); Given selector_forms_results_max_points like below: 9 9 9 11 11 11 11 13 13 and selector_forms_results_max_points target of 12, I want the maximum of the set of selector_forms_results_max_points that are less than 12. So in this case, I want all rows where selector_forms_results_max_points = 11. I hope I have explained this somewhat clearly. I cannot see how this can be accomplished with a join, but my sql skills are rudimentary. Thanks for any help. Table structure and sample data follow. kgt Table: CREATE TABLE `selector_forms_results` ( `selector_forms_results_id` int(11) NOT NULL auto_increment, `selector_forms_id` int(11) NOT NULL default '0', `selector_forms_results_description` varchar(255) NOT NULL default '', `selector_forms_results_max_points` int(11) NOT NULL default '0', PRIMARY KEY (`selector_forms_results_id`), KEY `selector_forms_results_max_points` (`selector_forms_results_max_points`) ); And some sample data: insert into `selector_forms_results` values (1,1,'Pro1 180',9); insert into `selector_forms_results` values (2,1,'Iron Eagle 180',9); insert into `selector_forms_results` values (3,1,'RR 180',9); insert into `selector_forms_results` values (4,1,'Pro1 200',11); insert into `selector_forms_results` values (5,1,'Iron Eagle Platinum 200',11); insert into `selector_forms_results` values (6,1,'RR 200',11); insert into `selector_forms_results` values (7,1,'IK 200',11); insert into `selector_forms_results` values (8,1,'Pro1 215',13); insert into `selector_forms_results` values (9,1,'Iron Eagle Platinum 215',13); -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Convert Subquery - need to find max of a set
[EMAIL PROTECTED] wrote: Kristen G. Thorson [EMAIL PROTECTED] wrote on 10/14/2005 09:15:21 AM: I need to convert this query into one without a subquery: SELECT r.selector_forms_results_max_points AS points, r.selector_forms_results_description AS description, FROM selector_forms_results AS r WHERE r.selector_forms_id = 1 AND r.selector_forms_results_max_points = ( SELECT DISTINCT r.selector_forms_results_max_points AS max_points FROM selector_forms_results AS r WHERE r.selector_forms_results_max_points = 12 ORDER BY r.selector_forms_results_max_points DESC LIMIT 1 ); Given selector_forms_results_max_points like below: 9 9 9 11 11 11 11 13 13 and selector_forms_results_max_points target of 12, I want the maximum of the set of selector_forms_results_max_points that are less than 12. So in this case, I want all rows where selector_forms_results_max_points = 11. I hope I have explained this somewhat clearly. I cannot see how this can be accomplished with a join, but my sql skills are rudimentary. Thanks for any help. Table structure and sample data follow. kgt Table: CREATE TABLE `selector_forms_results` ( `selector_forms_results_id` int(11) NOT NULL auto_increment, `selector_forms_id` int(11) NOT NULL default '0', `selector_forms_results_description` varchar(255) NOT NULL default '', `selector_forms_results_max_points` int(11) NOT NULL default '0', PRIMARY KEY (`selector_forms_results_id`), KEY `selector_forms_results_max_points` (`selector_forms_results_max_points`) ); And some sample data: insert into `selector_forms_results` values (1,1,'Pro1 180',9); insert into `selector_forms_results` values (2,1,'Iron Eagle 180',9); insert into `selector_forms_results` values (3,1,'RR 180',9); insert into `selector_forms_results` values (4,1,'Pro1 200',11); insert into `selector_forms_results` values (5,1,'Iron Eagle Platinum 200',11); insert into `selector_forms_results` values (6,1,'RR 200',11); insert into `selector_forms_results` values (7,1,'IK 200',11); insert into `selector_forms_results` values (8,1,'Pro1 215',13); insert into `selector_forms_results` values (9,1,'Iron Eagle Platinum 215',13); The only advantages of doing this style of query as a subquery is that you do not need to explicitly create/destroy a temporary table (the engine does that for you behind the scenes) and you can write it in one statement. In my experience, the subquery versions are usually noticably slower. YMMV. Here is a non-subquery equivalent of your particular query: CREATE TEMPORARY TABLE tmpMAX ( KEY (`selector_forms_id`) ) SELECT `selector_forms_id` , MAX(`selector_forms_results_max_points`) as max_points FROM `selector_forms_id` WHERE `selector_forms_results_max_points`=12 GROUP BY `selector_forms_id`; SELECT r.`selector_forms_results_max_points` AS points, r.`selector_forms_results_description` AS description, FROM `selector_forms_results` AS r INNER JOIN `tmpMAX` tm on r.`selector_forms_id` = tm.`selector_forms_id` AND r.`selector_forms_results_max_points` = tm.`max_points` WHERE r.`selector_forms_id` = 1; DROP TEMPORARY TABLE tmpMAX; I made this a little less restrictive than your original query so that you could run the query against other `selector_form_id` values if you wanted. Instead of using a temporary table, I could have used a single variable to hold the max value as you only wanted the list for a single value of `selector_forms_id`. Does this help? Shawn Green Database Administrator Unimin Corporation - Spruce Pine Thank you, this works perfectly for me. I don't even have any questions! kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
How to use logrotate to manage binary logs
Hi all, This may be a simple solution that I'm just not seeing. logrotate has trouble with binlogs since the extension keeps changing, so instead of actually rotating logs out, I just get a dir filled with binlog.001.1 binlog.002.1 binlog.003.1 binlog.004.1 binlog.005.1 binlog.006.1 and on to inifinity. The manual says If you supply an extension in the log name (for example, |--log-bin=/|file_name.extension|/|), the extension is silently removed and ignored, so it appears I'm stuck. Does anyone have some pointer for me to set up auto-rotation? I'm somehow not finding much info on this. kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: connection error from c application
Your syslog8.txt file has two problems: 1. The first field, log_date, is in m/d/ format. It will not be converted by MySQL automatically. It needs to be in -mm-dd format. For this reason, all records will have the default value of '-00-00' for that field. 2. The primary key on your table is log_id. In the sample you sent, all of the log_id's are the same. The first row is inserted, and all others with that ID are skipped. kgt Elizabeth Bonifacio wrote: Dear Guys, I have been stucked in loading file using load data local infile command. At first it is loading a null value on my first record followed with one record from my input file. The rest are ignored and i've been receiving lots of warnings. I tried converting the text file into a csv and was successful in loading all the files but with a lot of null values and data going another field. I used the fields terminated by ',' lines terminated by ',' instead of '\r\n' because the loading problem. I tried reformatting my txt and csv file, check its spacing(tabs) one by one but still the data seem to go haywire. I'm actually building an application that will accept continuous data (syslog) using c++ that I need to store in Mysql. But just want to handle one thing at a time so I'm just testing how it will accept loading file from the mysql prompt. I'm running on windows XP, mysql server 4.1.11. Kindly refer to the table structure and the attached file. I know you guys are experience and must have encounter this matter before. Will appreciate all your help to a new developer like me, Thanks, Elizabeth mysql show create table log8; | log8 |CREATE TABLE `log8` ( `log_date` date default '-00-00', `log_time` time default '00:00:00', `device_id` varchar(17) default NULL, `log_id` varchar(11) NOT NULL default '', `type` varchar(7) default NULL, `subtype` varchar(7) default NULL, `pri` varchar(6) default NULL, `vd` varchar(4) default NULL, `serial_number` int(11) default NULL, `duration` int(5) default NULL, `policyid` tinyint(3) default NULL, `proto` tinyint(3) default NULL, `service` varchar(10) default NULL, `status` varchar(6) default NULL, `src` varchar(15) default NULL, `srcname` varchar(15) default NULL, `dst` varchar(15) default NULL, `dstname` varchar(15) default NULL, `src_int` varchar(8) default NULL, `dst_int` varchar(8) default NULL, `sent` int(11) default NULL, `rcvd` int(11) default NULL, `sent_pkt` tinyint(4) default NULL, `rcvd_pkt` tinyint(4) default NULL, `src_port` int(11) default NULL, `dst_port` int(11) default NULL, `vpn` varchar(5) default NULL, `tran_ip` varchar(15) default NULL, `tran_port` int(5) default NULL, `dir_disp` varchar(5) default NULL, `tran_disp` varchar(5) default NULL, PRIMARY KEY (`log_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | 1 row in set (0.08 sec) mysql On 6/27/05, Gleb Paharenko [EMAIL PROTECTED] wrote: Hello. Send an example of your file and your table's definition (use SHOW CREATE TABLE for this purpose). Please, next time send your replies to the list. Hope you're doing great today. Back to my question last week, I've been encountering this problem of loading my file using the load data local infile command for a particular text file. I cannot determine the error in my sql codes since i find no problem loading other text file into the database. mysql load data local infile 'syslog5.txt' into table log4 fields terminated by ' \t' lines terminated by '\n'; Query OK, 2 rows affected, 513 warnings (0.03 sec) Records: 20 Deleted: 0 Skipped: 18 Warnings: 505 I'm not familiar with this warnings myself. I can only load the first line in the syslog5.txt and the rest are ignored. From the two rows only the first line is stored and the rest are ignored. The result of my select statement from the log4 table includes all null value on the first row and the value of the second line for the second row. Would appreciate if you can teach me how to debug the warning or maybe enlighten me on the cause of the problem. Thanks for all your help. Elizabeth On 6/24/05, Gleb Paharenko [EMAIL PROTECTED] wrote: Hello. What 'SHOW WARNINGS' reports? Elizabeth Bonifacio [EMAIL PROTECTED] wrote: -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problems using Binary Install on Mac OS 10.4.1
http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html Double check that mysqld is running. I usually find out that it's not when I get that error. kgt Elton Hughes wrote: Hello All, I am trying to install MySQL 4.1.12 on my Powermac G4. My OS is 10.4.1. I downloaded the binary distribution from the MySQL website. I uncompressed it and opened the .dmg installer. I ran the installer. Where it prompted for the Administrator's password, I gave it. The installation completed successfully. I then followed the instructions and installed the StartUp item without problem. I then tried to access the database and I get the following message: - mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) - Should the installer have installed mysql.sock in /tmp on Macs running OS 10.4.1? Is there a step I missed or is missing in the documentation? Can MySQL run on a Mac using 10.4.1? Thank you for your time. Elton = NOVA505 W. Olive Ave. Suite 550 Elton Hughes (IT) Sunnyvale CA 94086 Phone: 408-730-7235 Fax: 408-730-7643 - -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LIMIT error
I think you might be confusing UPDATE and SELECT syntax. As far as I ever knew, you couldn't specify a limit offset in an update statement. I don't see in mysql update docs where it indicates offset is allowed. kgt David Legault wrote: Hello, I'm using the MySQL C API and I got the following error for this query: UPDATE tracks SET track_state='-2', track_cost='1.50' WHERE track_flynum='10' AND track_testcase='45' ORDER BY track_step DESC LIMIT 0,1 SQL Error 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1 If I put LIMIT 1 instead of LIMIT 0,1 I get the correct result. This seems to be a weird problem and according to the documentation, should be equivalent, but it seems not. Running on Win2k, MySQL 4.1.11, mysqld-nt.exe Thanks David -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql database problems
Are your php scripts by any chance called phpWebSite? If so, you might find more help here: http://www.phpwsforums.com/ What you're getting is almost definitely a PHP script catching some kind of error trying to connect to the database server. You should have a file called configure.php or something similar. Make sure the database settings are correct. kgt Dwayne Hottinger wrote: Greetings all, Im new to mysql and have inherited several mysql databases and everything has been going well until lately. Most of my webpages come from mysql databases with php scripts. Now I am getting the message Unable to load database indicated by configuration file or something similiar when trying to connect to any database running on the server when the mysql user is running @localhost. I can however login at terminal as the mysql user and look at the database with no problems. My mysql version is 3.23.58 (upgraded from yum), php version 4.3.10, server is Fedora Core 2 kernel 2.6.5-1.358smp. Im pretty new to mysql so be gentle and easy in any help. Everything was working fine prior to Friday of last week. Mysqld.log show nothing other than start and restarts that I initiated trying to get things working. thanks, ddh -- Dwayne Hottinger Network Administrator Harrisonburg City Public Schools -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How to set trabnsaction isoloation in my.ini file
Adam Lipscombe wrote: I have MySql 4.1.12 installed on an XP box in C:\mysql. I have the settings below in my C;\MySql\my.ini file: I have the transaction-isolation set to READ-COMMITTED but the server seems to ignore this. When the server starts up the tx_isolation as reported by mysqladmin extended-status is REPEATABLE-READ. I can set it manually from the mysql command line and that works. The tx_isolation is then reported as READ-COMMITTED. Its almost as if the server is not reading the my.ini file. It may not be. Do you specify this file when you start the server on the command line? If you don't then you need to move my.ini to the windows directory: When the MySQL server starts on Windows, it looks for options in two files: the `my.ini' file in the Windows directory, and the `C:\my.cnf' file. The Windows directory typically is named something like `C:\WINDOWS' or `C:\WinNT'. You can determine its exact location from the value of the |WINDIR| environment variable using the following command: C:\ echo %WINDIR% MySQL looks for options first in the `my.ini' file, then in the `my.cnf' file. However, to avoid confusion, it's best if you use only one file. If your PC uses a boot loader where the |C:| drive isn't the boot drive, your only option is to use the `my.ini' file. Whichever option file you use, it must be a plain text file.
Convert subquery
I am moving some code that was developed against MySQL 4.1 to a server with 3.23, and I have one query that uses a subquery. I'm having a bear of a time wrapping my mind around how to convert this. The original query is this: SELECT page.page_id, page.page_keyword FROM page WHERE page.page_id6 AND page.page_id NOT IN ( SELECT page_links.child_id FROM page_links WHERE page_links.page_id=6 ) The table `page_links` contains parent (page_links.page_id) and child (page_links.child_id) mappings for items in `page`. Given a page.page_id=6, I want all items in `page` that satisfy the following: page.page_id6 and page.page_idpage_links.child_id only where page_links.page_id=6 So, for a given page, I want all possible child page candidates (condition is that current child pages and the given page are not possible candidates). Thanks in advance! kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Convert subquery
Shawn, Thanks so much, this is exactly what I was looking for. I was having trouble getting the condition (page_links.page_id=6) in the right place. I had gotten as far as SELECT page.page_id, page_keyword FROM page LEFT JOIN page_links ON page.page_id=page_links.child_id WHERE page.page_id6 AND page_links.child_id is null; Which of course didn't give me what I was looking for. And of course it never occured to me I could put the missing condition in the ON clause. This one was a challenge for me, as I normally don't have to do anything beyond very simple queries. Thanks again! kgt [EMAIL PROTECTED] wrote: Kristen G. Thorson [EMAIL PROTECTED] wrote on 05/17/2005 02:37:12 PM: I am moving some code that was developed against MySQL 4.1 to a server with 3.23, and I have one query that uses a subquery. I'm having a bear of a time wrapping my mind around how to convert this. The original query is this: SELECT page.page_id, page.page_keyword FROM page WHERE page.page_id6 AND page.page_id NOT IN ( SELECT page_links.child_id FROM page_links WHERE page_links.page_id=6 ) The table `page_links` contains parent (page_links.page_id) and child (page_links.child_id) mappings for items in `page`. Given a page.page_id=6, I want all items in `page` that satisfy the following: page.page_id6 and page.page_idpage_links.child_id only where page_links.page_id=6 So, for a given page, I want all possible child page candidates (condition is that current child pages and the given page are not possible candidates). Thanks in advance! kgt Original: SELECT page.page_id, page.page_keyword FROM page WHERE page.page_id6 AND page.page_id NOT IN ( SELECT page_links.child_id FROM page_links WHERE page_links.page_id=6 ) JOINED: SELECT page.page_id, page.page_keyword FROM page LEFT JOIN page_links on page.page_ID = page_links.child_id and page_links.page_id=6 WHERE page.page_id6 AND page_links.page_id is null The trick to doing a NOT IN() query as a JOIN query is that you try to make an _optional_ match on your columns/conditions (LEFT JOIN...ON...) then look for those rows where the match-up conditions are *not* met (WHERE table_on_the_right.nonnullablecolumnname is NULL). I have assumed that in the table page_links, page_id is not a nullable column. So by checking for a null where there shouldn't be one, you detect where the matching conditions in your LEFT JOIN phrase weren't met. Does that make sense? I know that talking in the negative can be confusing so here it is from the other direction. A LEFT JOIN will make sure that all of the rows of the LEFT table (the first table listed) are available to be processed against the conditions of the WHERE clause but only those rows from the table on the right-hand side of the phrase that meet the ON conditions will be in that same list. All column values (even those that are not normally nullable) for the table on the right side of a LEFT JOIN will be NULL if there is no match that meets the ON condition(s). Shawn Green Database Administrator Unimin Corporation - Spruce Pine
Re: Convert subquery
I actually had something similar to this at one point, but I never got it working. Your query returned 148 rows, which I can tell you right away can't be right since there are only 130 items in `page`. I believe the problem is that it doesn't take into account that a page may be a child page of several different parents. Therefore this part: SELECT page.page_id, page_keyword FROM page LEFT JOIN page_links ON page.page_id=page_links.child_id Will return more than 130 rows: mysql SELECT page.page_id, page_keyword, page_links.page_id FROM page LEFT JOIN page_links ON page.page_id=page_links.child_id; +--+--++ | page.page_id | page_keyword | page_links.page_id | +--+--++ |5 | training | 4 | |5 | training | 6 | |5 | training | 17 | |4 | services | 6 | |4 | services | 12 | |4 | services | 13 | |4 | services | 14 | |4 | services | 15 | Then adding the condition ( page_links.page_id 6 OR page_links.child_id IS NULL ) would still leave duplicate rows: +--+--++ | page.page_id | page_keyword | page_links.page_id | +--+--++ |5 | training | 4 | |5 | training | 17 | |4 | services | 12 | |4 | services | 13 | |4 | services | 14 | |4 | services | 15 | Shawn has already posted a working answer, so this is just me sharing how proud I am that I figured it out well enough to know why it doesn't work, which I guess is as good a learning tool as any! Thanks, kgt Jan Pieter Kunst wrote: 2005/5/17, Kristen G. Thorson [EMAIL PROTECTED]: I am moving some code that was developed against MySQL 4.1 to a server with 3.23, and I have one query that uses a subquery. I'm having a bear of a time wrapping my mind around how to convert this. The original query is this: SELECT page.page_id, page.page_keyword FROM page WHERE page.page_id6 AND page.page_id NOT IN ( SELECT page_links.child_id FROM page_links WHERE page_links.page_id=6 ) With some minimal test data, this seems to work, at first sight: SELECT page.page_id FROM page LEFT JOIN page_links ON page_links.child_id=page.page_id WHERE (page_links.page_id 6 OR page_links.page_id IS NULL) AND page.page_id 6 JP .
Re: Need help in running MySql in PHP script
The folks at http://us4.php.net/mailing-lists.php can help you. In PHP 5, MySQL is no longer enabled by default, nor is the MySQL library bundled with PHP. http://us4.php.net/manual/en/faq.databases.php#faq.databases.mysql.php5 kgt CIKALA Frédéric ROSI/SIPROD wrote: It seems like you got the same problem' as me : Php (? ) do not have the librairies include, and you need to run a kink of daemon in order to make t works. Under linux, it is just a question of the good rpm to install (for me it was php-mysql-4.3.9-3.i386.rpm). Under windows, you'll need to install some kind of bridge whose name begins with php-mysql*. Check weather the php.ini has got the extension ligne uncommented ... Hope it helps -Message d'origine- De : madderla sreedhar [mailto:[EMAIL PROTECTED] Envoyé : lundi 16 mai 2005 14:52 À : sql firm Objet : Need help in running MySql in PHP script Hi, Iam using mysql 5.04 , php 5.0 with IIS 5.0 webserver and written some scripts and executed on IE webbrowser but getting an fatal error undefined function mysql_connect() in the code kindly tell me where iam going wrong and also tell the mysql username how to find it out becoz when Iam opening the Mysql from start button it only asks the password and doesnot prompt for an username tell the porcedure to create a new user an tell me how to identify the current user in Mysql. Is there any special code to be written in .ini file of php to link Mysql with php to run the Mysql code in php scripts,if so please tell the code required in detail. Any sort of help is welcome. Thanks Sreedhar __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Suggestions to retrieve surviving data
Hello all, I have a problem on a development machine that somehow got every single mysql program in the /usr/bin directory wiped out (which looks like it was everthing but mysqld). The server is actually up and running, and the datadir is intact, so it looks like my data is okay. However, I had this set up only with users from localhost, so I can't connect from a client on another machine. It's like I'm trying to reach an island but I don't have a boat. I have an older backup, but would like to try and save the current data. It's not at all critical, so I don't want to go to too much bother - it's just a convenience thing. I only have 4 important MYISAM tables, so my plan is: 1. Shut down server 2. Back up datadir 3. Install MySQL-server and MySQL-client 4. Restore backup to datadir I'm installing same version over the old from RPM, and planning to just -force the install. My second thought was I could try just forcing the install of client and mysqldump-ing the data before reinstalling the server, which I'm thinking is probably the better way to go. Am I missing any issues or a better way to do this? Thanks, kgt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Using Different Database Groups On the Same Computer
http://dev.mysql.com/doc/mysql/en/multiple-unix-servers.html There may be some helpful notes there. How are you determining which datadir mysqld is using when it's actually running? Are you logging in with mysql or mysqladmin? Make sure that if you are doing so, that you're actually logging in to each server separately, and not just looking at the variables for the same server that you've logged into twice. At the very least, try passing --port and --datadir and any other necessary options on command line for both mysqld processes. Command line options should override all others, so if it works then, you know you have a problem with your cnf file or environment variables. Kristen Hal Vaughan wrote: On Thursday 17 February 2005 10:18 am, Hassan Schroeder wrote: Hal Vaughan wrote: I've tried this by running 2 instances of mysqld, the first with no arguments, and the second like this: mysqld --port=3307 --datadir=/dbtest/mysql I have to run mysqld directly -- not through safe_mysqld (which /etc/init.d/mysql calls). If I run it through safe_mysqld, I can run only one instance at a time, it will exit without running a new instance if it detects one already running. FWIW, `/etc/init.d/mysql` and `safe_mysqld` are just shell scripts. Hence you can copy and change them easily to run multiple versions or instances of most software... I see that, but even when I bypass them, I can run 2 instances of mysqld, it shows up in the task list as 2 separate tasks, but they both use the data directory specified in the last instance I run. I'm trying to get 2 different instances of mysqld running at the same time, each using a different port and different data directory. Hal -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code.
Re: Mysql running as root
The line: MySQL 4.0.18 running on localhost as [EMAIL PROTECTED] refers to the hostname and user you log into *mysql* with. It does not tell you what user mysql is running under on the OS. The user and hostname that phpMyAdmin logs in under are changed in the phpMyAdmin config.inc.php file. Kristen Russ wrote: On Wednesday 16 February 2005 08:48 pm, Gleb Paharenko wrote: Hello. Please tell us, in what way do you launch your MySQL server. Send your configuration file. sql running as root. When I log on as root and look at the users, I do not see a mysql user. Do I need to create this user and what permissions does it Log on into the server and use 'ps aux' command to check under what user account mysqld running is. Look into /etc/passwd file to check that mysql user is present on your system. the host database,etc. can these be copied to my new Linux enviroment or is it best to rebuild everything? I think you should, dump your data from the live windows server with the mysqldump program (if you don't have such, setup it and copy tables to its data directory). And then, import your data from the dump file into the new Linux server. Russ [EMAIL PROTECTED] wrote: I have two questions: 1) I'm still having trouble getting mysql to run as user mysql. All the file and folders have been changed to be owned by user mysql but phpadmin shows my sql running as root. When I log on as root and look at the users, I do not see a mysql user. Do I need to create this user and what permissions does it need? How can the files and folders be owned by a user if they do not exist? 2) When my windows environment died I was unable to dump mysql. I was able to recover the Data files for both tables I had (.myd, .myi and .frm) Also for the host database,etc. can these be copied to my new Linux enviroment or is it best to rebuild everything? Thanks in advance for any help!! -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET ___/ www.mysql.com I am using SuSE 9.1 Pro. I started mysql in the runlevel editor of YaST. It start when I boot the system. below are the results of the two items you asked me to look at: ps aux mysql 5471 0.0 0.4 21584 2400 ?S07:38 0:00 /usr/sbin/mysqld /etc/passwd mysql:x:60:2:MySQL database admin:/var/lib/mysql:/bin/false This is what I see in phpMyAdmin. Welcome to phpMyAdmin 2.5.6 MySQL 4.0.18 running on localhost as [EMAIL PROTECTED] thanks again for your help.