| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Comments:
<0> ID is not gonna do it for ya if it's in 3 different tables <1> ok so I added a timestamp field. <1> Will someone elaborate on the query I will need? <2> !m root404 union <3> root404: (UNION Syntax) : http://dev.mysql.com/doc/mysql/en/UNION.html <1> I wish MySQL had docs like PHP.net... <1> lokus: Can you just explain it? <4> root404: select table1.url union table2.url union table3.url order by timefield <4> check syntax though <2> root404: ask again if you don;t understand after reading it <4> yeah - that link pretty much explains it <4> within the first 3 paragraphs... <4> root404: I think you need to include the timefield in your union though if you want to sort and limit by it... <1> soulfreshner: Would something like this work: "SELECT software.* UNION design.* ORDER BY date LIMIT 5" Or can I not use wildcards like that? <1> date is the timestamp <4> root404: try it
<4> i don't have the means to test it right now, but I can't think of a reason it wouldn't work off hand <4> as long as the tables have the same structure <4> and if it does have the same structure, why not just put everything in one table? <4> it would save you a lot of h***le in the long run, just ad a table_type column or something <5> where is LIKE documented in the mysql online docs? <1> soulfreshner: http://pastebin.com/594404 <1> That's what I have <5> nvm <6> kon_: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html <7> I'm looking for a way to export images that are in a blob fields to external files and replace them by file link. Any idea ? <1> But I get this error. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource <5> thx Kemurii :) <6> Yanndotname: write a nice script, goodluck! :) <8> root404: you're not doing proper error checking <4> root404: I think in this case it would be better to write out the fields, otherwise date will be ambiguous <8> root404: your query didn't work and you're not testing that <8> if mysql_query() fails you need to do a mysql_error() <7> Thanks Kemurii... but I'm way to ignorant to do so... I'm sure there is a nice quick way but where unable to find it out, despite a few hours spent in googling <4> root404: maybe order by software.date will work, but it'll look ugly... <1> soulfreshner: What do you mean write out the fields? <4> root404:I agree with darien - its easier if you actually know what the error is <4> select software.f1, software.f2...etc <6> Yanndotname: indeed, you need to make a script to load images from database, save them to file, update database with filepath.. <1> I've never used mysql_error <6> Yanndotname: not sure much scripts outthere doing such things, as not much people store images in DBMS anyway <6> root404: how can you script in PHP not using mysql_error? <4> root404: also use an echo mysql_errno().": ".mysql_error() somewhere after the query <1> Kemurii: I'm obviously not skilled in PHP or I wouldn't be asking for help.... <1> I'll get there though. <1> heh <1> soulfreshner: "1064: You have an error in your SQL syntax;" <2> more <9> /usr/bin/mysqladmin: connect to server at 'localhost' failed <1> lokus: more? <9> error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' <4> ok, well - echo $query too <9> Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! <9> Theres no mysqld.sock created <9> How to create it ? <7> Kemurii: Sure... I don't understand why they did that... I have to move an entire tea shop from one db to Virtuemart (jommla nice e-commerce componen)... my knowledge is just enough to play with importing / exporting and clearing stuff... but I was sure to find such a script existing somewhere and I did not :-( <2> root404: is that thw whole message? also please echo the query <4> S4nD3r: mysql is not started <9> But I tried to start, I have this <10> LOAD DATA INFILE '/data/cdr/link2voip.com-rates.csv' INTO TABLE rates (location, prefix, cost) FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'; <- that gives me errors and i cannot figure out where, i've been trying multiple queries many itmes now <4> S4nD3r: /etc/init.d/rc.d/mysql start <1> lokus: http://rafb.net/paste/results/g9HvL247.html <0> rpm: what's the error? <4> S4nD3r: or something to that effect :) depending on your distro <10> ERROR 1064 (42000): 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 'FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n'' at line 1 <9> debian <2> root404: syntax error, please check syntax, refer to the url earlier, I expect some examples there <4> root404 - there is a comma missing <1> *doh* <0> rpm: columns go after the field stuff <4> also - use backtics , date and name might be reserved...and iven if not - it's better to be safe :) <1> soulfreshner: Backticks as in `software.url`? <4> root404: `software`.`date` <9> apt-get install mysql-common mysql-client mysql-server I installed <9> correctely <10> hrm. <2> root404: not so simple , your union is completely wrong
<2> root404: and your select is wrong too <4> S4nD3r: then it should be /etc/init.d/mysql start <9> /usr/bin/mysqladmin: connect to server at 'localhost' failed <9> error: 'Access denied for user 'root'@'localhost' (using p***word: YES)' <4> S4nD3r: ps aux | grep mysql - what do you see? <1> lokus: What's wrong with it? <9> many process runing <9> many may <9> many <4> many mysql processes? <4> that's not right <9> Ok.. <9> I stoped all them <11> One process; many threads <2> root404: please read the url again and look at the examples carefully <9> When I started. I got the errors again <4> root404: also test them with the mysql client, rather than hacking away at the script...then use it as soon as it works <9> /usr/bin/mysqladmin: connect to server at 'localhost' failed <9> error: 'Access denied for user 'root'@'localhost' (using p***word: YES)' <1> soulfreshner: Now I'm getting "1109: Unknown table 'software' in field list" <4> S4nD3r: ah - then it's your username and p***word that's wrong <4> try without if it is a fresh install <1> soulfreshner: Nevermind :) <4> root404: just check your syntax carefully...it would be something like a missing comma <4> ok guys - gtg <4> later <9> /usr/bin/mysqladmin -u root p***word '123456' This do not works too <1> lokus: Could something like SELECT url, name, date FROM software AND design ORDER BY date LIMIT 5 work? <7> so people, nobody can help me exporting blob images to files, at least ? <11> Yanndotname: select into dumpfile... see select syntax <11> Yanndotname: Otherwise you'll have to pull the raw data and dump it yourself <1> lokus: This is what I ended up with " SELECT url, name, date FROM software UNION SELECT url, name, date FROM design ORDER BY date DESC LIMIT 5 " <2> root404: is it better? <1> lokus: It works, but is there a cleaner way/ <9> How do I create a p***word to root user ? <9> /usr/bin/mysqladmin -u root p***word '123456' This do not works too <0> root404: upgrade to 5.0 (if you're not on it) and create a view <1> shabbs: I'm on 5.0, I've never heard of views <1> What are they? <0> !m root404 views <3> root404: (Views) : http://dev.mysql.com/doc/mysql/en/ANSI_diff_Views.html <7> thanks, but I found no option in dump to export the images from the binary field :-( <12> yanndotname: What's to export? Bits is bits. <12> SELECT INTO DUMPFILE takes what's in the blob and puts it in the file. If what's in the blob is an image, what's in the file is an image. <13> can I do SELECT ... ORDER BY ... UNION SELECT ... ORDER BY and have the results returned first query followed by the second? <14> sorry i can't find this in the mysql docs but how does the unique work for selecting? i want to select unique sets for col1, col2, col3 any quick example to show me the proper syntax? <2> !m Davey union <3> Davey: (UNION Syntax) : http://dev.mysql.com/doc/mysql/en/UNION.html <13> lokus: oooh, UNION DISTINCT <13> will not include results in the second SELECT that are in the first <15> hello, I would like to log all problematic queries that is executed to the mysql server, how do I do that ? <0> holdred: define problematic <15> i know there is log-warnings and log-errors, but those are only for server related errors, not sql errors from client <5> how can i drop all tables that begin with anystring_* ? <0> BarnacleBob: SELECT DISTINCT <15> malformed sql statements, or any sql statements from the client that does not execute successfully. <16> how do you rename a table? <14> shabbs, just select distinct col1, col2, col3? <17> Hey all... my error logs are reporting a whole lot of "mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'", but it's not consistent, as the site normally works fine... can anyone provide any insight into this? <5> Sonderblade: rename table foo to bar <18> hello folks <18> mysql database with innodb engine can manage more then one foreign key in a table? <18> apparently nope <19> Hello, Im trying to build an mysql application but Im getting: <19> mysql.h: No such file or directory <19> errmsg.h: No such file or directory <16> kon_: thanks <19> I have build the mysql versio 4.1.18 <19> any idea? <15> Tvienti: does the file /var/lib/mysql/mysql.sock exists as of now? <0> BarnacleBob: your regular select statement but add in DISTINCT after SELECT <14> shabbs, great thanks <15> Tvienti: after starting the server, or did you specify a different socket file name? <2> Tvienti: is your mysql server running?
Return to
#mysql or Go to some related
logs:
r128 flgrx #php enable swat webinterface test alsa sonund device rebootin gentoo ubuntu E486: _getframe python what is n12br gentoo firefix ebuild qam 256 decrypt comcast
|
|