#mysql
07 October 2007
Total 21 pages. You are browsing page 4/21.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
03:32 <****> What function do I use to open mysql connections on different servers?
03:33 <****> like, I grab data from http://server.com
03:33 <****> and I want to put it into my localhost server
03:36 <****> hey
03:38 <****> Can MySQL handle 10 million rows quickly?
03:39 <****> StevenBao, if your queries and tables are constructed correctly, absolutely.
03:40 <****> StevenBao, 10 million isn't remarkably large.
03:40 <****> Yeah?
03:40 <****> Excellent... thank you Simetrical.
03:40 <****> Simetrical: constructed correctly?
03:41 <****> acomaco, yes.
03:41 <****> any guide? =)
03:41 <****> acomaco, many books. Lots of practical experience is a good idea too.
03:41 <****> hey can some one help me with mysql dumping i am using the windows server
03:43 <****> Simetrical: ok thx
03:45 <****> so can some one give me a hand?
03:46 <****> ask
03:46 <****> Don't ask to ask, Don't state: "I have a question", Don't ask: "Is anyone around?" or "Can anyone help?". Just Ask The Question. Also, please read: http://workaround.org/moin/GettingHelpOnIrc
03:46 <****> i need to make an .sql file so that i can move my db to my new server
03:48 <****> Do you have access to a command line? Do you have access to phpMyAdmin?
03:49 <****> i am using the windows server and yes its my server i have root acc
03:49 <****> REDLiNE, try using mysqldump.
03:51 <****> ???
03:52 <****> REDLiNE, if you don't understand what something is, it's common courtesy to Google it, read over what you find, and ask specific questions if you don't understand something. If you want someone to hold your hand, pay MySQL AB for support.
03:53 <****> errr i need help with this and this chan has helped me a lot of times b4 so that is why i came here
03:53 <****> I gave you the name of the utility you want: mysqldump.
03:54 <****> when i put that in my line nothing comes up
03:54 <****> REDLiNE, what line?
03:55 <****> the command line
03:55 <****> ./ db.sql will put the sql in i no that but i dont no how to take it out
03:55 <****> REDLiNE, the usual tool is mysqldump. What happens if you type it at the command line?
03:56 <****> is there a method in mysql where I can get a record meeting a certain condition, and the 10 records preceeding it, and the 10 records following it in a certain order?
03:56 <****> it comes up with a blank line
03:57 <****> and when i put a ; at the end i get an error
03:57 <****> hydoskee_, you could do that easily enough with two queries.
03:57 <****> REDLiNE, you need to run this in the command line, not inside mysql. If you're using Windows, it's cmd.exe.
03:58 <****> Simetrical: I know, but I'd like to be able to do it in one
03:58 <****> because for my code, it's a much more elegant solution
03:58 <****> hydoskee_, could do a UNION. Not sure if there's another way than that.
03:58 <****> you mean UNION two results?
03:58 <****> hydoskee_: UNION two selects.
03:58 <****> what's the approximate syntax of that?
03:59 <****> hydoskee_, SELECT .... UNION SELECT ....;
03:59 <****> hydoskee_: There are other ways, but union is fine.
03:59 <****> Xgc, what would be another way?
03:59 <****> unioning two selects, that is
03:59 <****> terrific, thank you!
04:02 <****> Simetrical: You can find the ids representing x+10 and x-10 with a derived table and grouping, then JOIN that with the original table to obtan the rows in question.
04:02 <****> obtain
04:02 <****> Or use subqueries to retrieve the id's, too. Lots of ways. UNION is probably simplest.
04:03 <****> Simetrical: The derived table is a subquery.
04:14 <****> I have a column named "code"
04:14 <****> but I only want five instances of code
04:14 <****> How can I limit it to five rows?
04:14 <****> like, if I wanted to add another row with "code", it wouldn't allow me to
04:16 <****> redtricycle, I'm not clear on what the column contains? You mean you want no more than five distinct values, or no more than five of a particular value?
04:18 <****> redtricycle, if you want no more than five distinct values, maybe you want an ENUM-type column. If you have a magic value that you only want to occur a maximum of five times, the only way I know of to do that is possibly some rather twisty behavior with unique keys, and that won't work nicely in all probability.
04:19 <****> But, I'm not the most knowledgeable person here by far.
04:19 <****> are your trying to limit the data in the field itself or the number of rows in the table based on the data?
04:22 <****> redtricycle, are you trying to list only 5 items to be allowed in the field value and no more?
04:23 <****> He only wants a maximum of 5 rows
04:23 <****> ... per code.
04:24 <****> seekwill, 5 rows in the table itself?
04:24 <****> He only wants a maximum of 5 rows per code.
04:24 <****> So like UNIQUE except "only five rows" instead of "only one row", you think?
04:25 <****> Umm... heh, I guess that's one way to put it.
04:25 <****> :)
04:25 <****> maybe, but it must be UNIQUE if it is in the same field
04:26 <****> wish i could get a better grasp of what he is actually trying to do with it.
04:26 <****> lol
04:26 <****> Maybe if he would talk more...
04:26 <****> that would help. lol
04:28 <****> SELECT COUNT(*) AS total FROM table WHERE code = 'foo'; if( $total == 5 ) echo "No more allowed!";
04:28 <****> How about that?
04:28 <****> Seems not very atomic.
04:28 <****> possible but that does not actually prevent mysql from doing it.
04:29 <****> Not concurrency-safe.
04:29 <****> That's pseudo code so you understand what he wants.
04:29 <****> Get it?
04:29 <****> Actually there was a huge discussion about pretty much exactly this not too long ago.
04:29 <****> (in here)
04:30 <****> yeah. thanks.
04:31 <****> Hey yall
04:31 <****> you could do it in your query with a subquery to count the rows before an insert.
04:31 <****> quick one, I have bunch of lines of text. Is there a type of input that will keep formatting?
04:31 <****> kylej, still not atomic, although closer.
04:32 <****> WRITE LOCK!
04:32 <****> KI4YJL, mysql_escape_string()?
04:32 <****> seekwill, touché.
04:32 <****> KI4YJL: MySQL doesn't care about formatting.
04:32 <****> is there a way to make it?
04:32 <****> KI4YJL: It preserves whatever data you put in it, including all it's formatting. It won't change it.
04:33 <****> well yah
04:33 <****> it's all one line now, it is 96
04:33 <****> And it'll stay like that when you take it out
04:33 <****> yes
04:33 <****> So, I can't make it retain formatting in an cell?
04:33 <****> a*
04:33 <****> It does already
04:33 <****> KI4YJL, it does retain formatting.
Total 21 pages. You are browsing page 4/21.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
