#mysql
03 October 2007
Total 31 pages. You are browsing page 1/31.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Wed Oct 03 00:00:09 2007
--- Day changed Wed Oct 03 2007
00:00 <****> login root?
00:00 <****> Eld: truth be told, the app seems well behaved right now. Searchs are executed properly even on strange char sets. But i want to make sure this doesn't bite me in the ass later
00:02 <****> oh...duh...this app is for devopment only. I had root user working before. Then I upgraded php and installed phpMyadmin and it stopped working. Funny that would disable me from being able to login to mysql using the command line
00:03 <****> spg2007: This hopefully means the app shows consistent behaviour with respect to the charset. You'll be in trouble if your data is mixed latin1 and utf8.
00:03 <****> well...I have to get going to pick up the kids. I will try and figure this out tomorrow. Thanks.
00:04 <****> Eld: thanks for all your help
00:05 <****> spg2007: Maybe check out the http headers.
00:05 <****> and everyone
00:06 <****>
00:08 <****> hey all need help /input
00:08 <****> getting error
00:09 <****> Warning: Your privilege table structure seems to be older than this MySQL version!
00:09 <****> Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!
00:09 <****>
00:09 <****> spg2007: Yes. This is a "luser header" (http equivalent), there is also the real content type header.
00:09 <****> I run the script but it says that root has a password
00:09 <****> but I never set one
00:10 <****> spg2007: Both should say utf-8.
00:13 <****> UnixDog: Maybe somebody else did it?
00:14 <****> its my server no one had access
00:14 <****> unless it was hcked
00:15 <****> is there a page for reseting the passwd
00:15 <****> UnixDog: Is it debian?
00:15 <****> no centos
00:16 <****> UnixDog: There is a mysql option --skip-privilege-tables IIRC.
00:16 <****> --skip-grants
00:16 <****> !tell UnixDog about reset root
00:16 <****> UnixDog See http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
00:16 <****> D.?????
00:17 <****> spg2007: Wow!
00:17 <****> what showed up?
00:17 <****> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
00:17 <****> Got a failure from command:
00:17 <****> cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql
00:17 <****> Please check the above output and try again.
00:17 <****> just looks like black boxes to me :)
00:18 <****> spg2007: 17 strange chars.
00:20 <****> hello. I see that TIMEDIFF() returns an amount of time, represented like (for example), "-17:33:51". How can I get this represented as an amount of seconds?
00:21 <****> centosian: Some NIX%TIMESTAMP% function
00:21 <****> bah. Subtract the unix_timestamps instead of using TIMEDIFF.
00:21 <****> I realized it just as I saw your response, ElDiabolo ; but thx anyways
00:24 <****> there is also time to sec function
00:29 <****> spg2007: Is this multi-utf8ed?
00:30 <****> spg2007: utf-8 interpreted as latin1 that is converted to utf8 repeatedly?
00:31 <****> Hello. Im making a news system where user can comment. Lets say I want to list 20 news on the frontpage, and also show how many comments each news have. How can I count how many comments each news have, without running 20 queries inside a while loop?
00:31 <****> Cypherus: use GROUP BY
00:33 <****> ElDiabolo, do you have any examples that could work in my case?
00:33 <****> Cypherus: something like: select col1, col2, col3, count(*) from news LEFT JOIN comments on comments.newsid = id GROUP BY col1, col2, col3
00:33 <****> Cypherus: SELECT news_id, COUNT(1) FROM user_comments GROUP BY news_id
00:34 <****> ok bbiab
00:34 <****> working on this
00:34 <****> would it be better to cache it?
00:34 <****> Cypherus: Why?
00:34 <****> so it wouldn't have to run all the time
00:34 <****> this will be a site with alot of users..
00:35 <****> Cypherus: You have mysql 5?
00:35 <****> yeah
00:35 <****> if this query is run a lot then the query will probably get cached
00:35 <****> by mysql
00:35 <****> automaticly?
00:35 <****> Cypherus: Read about the query cache.
00:35 <****> in general yes... you might need to tweak the query cache settings to fine-tune it
00:36 <****> Cypherus: Provided the underlying tables are not changed.
00:36 <****> ok, sounds advanced for someone who's still new to this..
00:36 <****> Cypherus: Don't optimize unless you have to.
00:37 <****> this site is assumed to have 500 000 pageviews a day.
00:37 <****> on the sites that lists 20 news.
00:38 <****> Cypherus: Might even be doable on a single box.
00:38 <****> Don't optimize it unless you have to?
00:39 <****> ElDiabolo, so how do I run this? hehe
00:39 <****> Cypherus: You are aware of the importance to seperate read- and write access to the database.
00:40 <****> what do you mean?
00:40 <****> Hey how do I reverse the order by ?
00:40 <****> jsoftw, DESC
00:41 <****> Cypherus: You may need to run this on multiple boxes. One master for and several read only slaves.
00:41 <****> ElDiabolo, don't worry about that! I will run just fine on this box
00:42 <****> Cypherus: 10 pages/s average - dynamically generated? What box?
00:43 <****> no idea, but that's not for me to worry about..
00:45 <****> Cypherus: Then don't care about the number of page views.
00:45 <****> That can EASILY be done on one box
00:45 <****> not even a great box
00:45 <****> chadmaynard: Depends on the pages.
00:46 <****> not really
00:46 <****> anyway, let's say the exact number is 500 000 pageviews.
00:46 <****> I can do that in my head
00:46 <****> 500 000 * 21 = 10 500 000 queries a day.
00:46 <****> seekwill: Your head can deliver 10 pages /s?
00:46 <****> dammit the fire alarm is going off
00:46 <****> ElDiabolo: I'm that good
00:47 <****> Cypherus: thanks
00:47 <****> 10,5 mill queries is a bit much
00:48 <****> Cypherus: No, thats OK. If your pages only do 21 querys.
00:49 <****> Currently my PHP script fetches the 20 last news (1 query). Then it runs a while loop, and runs 20 queries inside that while loop (20 more queries).
00:49 <****> What kind of queries?
00:49 <****> Isn't there a way to do this in just one query?
00:49 <****> first just a normal "select news from news", then 20 counts.
00:49 <****> You'll have to be more specific
00:50 <****> Cypherus: Writing is easy, reading is the hard part.
Total 31 pages. You are browsing page 1/31.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
