#mysql
05 October 2007
Total 19 pages. You are browsing page 1/19.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Fri Oct 05 00:00:08 2007
--- Day changed Fri Oct 05 2007
00:00 <****> I did mysql_dump -A, and now I need to restore one of my databases. Not all, so, using head and tail commands I put the sql of the database in different script. The problem is that the file have special charts, like tildes (tíldes). And when I restore its seen like à and ejército.. How can I fix that?
00:00 <****> dormando: MySQL version?
00:00 <****> pbro, I can si this difference for like '%pbro%' or '%pbro' or... but not wehn they are maching a excat name
00:01 <****> seekwill: 4.1 on here
00:01 <****> dormando: What error are you getting?
00:01 <****> seekwill: syntax errors
00:01 <****> wfq: read the documentation. LIKE and = are pretty much the same, *except* when handling language sets where one character matches multiple characters
00:01 <****> dormando: You want to share?
00:02 <****> Trengo, I dont know. I'll google "slow queries" thanks
00:02 <****> seekwill: yeah, one minute
00:02 <****> dormando: Plus the query
00:03 <****> My brain is not working. I have a table called "searches". It has a "query" column. How do I best return a result set where they have been counted and sorted by number of most popular queries?
00:05 <****> Led-Hed edit your /etc/my.cnf and add the lines [mysqld]
00:05 <****> set-variable=long_query_time=1
00:05 <****> log-slow-queries=/var/log/mysql/log-slow-queries.log
00:06 <****> Trengo, thanks
00:06 <****> Led-Hed cheers
00:06 <****> oh and restart your server, of course
00:06 <****> yup already did, much thanks
00:07 <****> I have a table_a with 5M+ entries... I am creating a new table_b that has a one-to-one relationship with table_a and I need to create 5M+ corresponding entries into it, and I need to populate the foreign key in table_a
00:08 <****> does mysql have an each loop or something?
00:09 <****> jereme: If the the data in table_b is computable directly from table_a you can do INSERT ... SELECT ...
00:09 <****> jereme: Otherwise you can do INSERT INTO table_b (col1, col2, col3, ...) VALUES (...), (...), (...), ...
00:09 <****> jfarmer, but how would I then go back and populate my foreign key field in table_a?
00:09 <****> basically I have table_a.table_b_id
00:10 <****> jereme: Is it autoincrementing or something?
00:11 <****> seekwill: preferred pastebin?
00:11 <****> #mysql
00:11 <****> :)
00:11 <****> that's new
00:12 <****> jfarmer: it will be, yes... I could actually just force table_a.table_b_id to = table_a.id... the id's are already reserved... didn't even think of that
00:12 <****> I prefer flooding the channel than having to open up a browser window
00:12 <****> hrm. uh oh.
00:12 <****> I might've just made it work.
00:12 <****> :)
00:12 <****> I have a table called "searches". It has a "query" column. How do I best return a result set where they have been counted and sorted by number of most popular queries?
00:12 <****> seekwill: I found the note about aliases and 4.1 for multi-table deletes, but it also doesn't accept a LIMIT clause
00:12 <****> 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 'LIMIT 1' at line 1
00:12 <****> dormando LIMIT is a reserved word you could try `LIMIT`
00:13 <****> thanks bot
00:13 <****> Its been a pleasure serving you dormando
00:13 <****> :)
00:13 <****> So my work here is done
00:14 <****> dunno, we'll see if I have any data (and a job) left here
00:14 <****> unfortunately I made a cardinal sin and that wasn't my test window
00:14 <****> (I'm kidding, I know it'll work)
00:14 <****> the limit thing and the 4.1 change about table aliases was what did it
00:14 <****> seekwill: DELETE r FROM file_to_replicate AS r LEFT JOIN file AS f ON f.fid = r.fid WHERE f.dkey IS NULL;
00:14 <****> fwiw
00:15 <****> :) Well, if it works
00:15 <****> which was converted from a select that works
00:15 <****> anyway, thanks!
00:15 <****> somehow
00:20 <****> I did a mysql_dump -A, and the data have lings or accents. Now I see in my vim the data with extrange charters. Now I need to restore one of this databases. How can I do that and preserve the accents?
00:25 <****> I have a table called "searches". It has a "query" column. How do I best return a result set where they have been counted and sorted by number of most popular queries?
00:36 <****> helo is u at hoem
00:37 <****> no
00:37 <****> Why is that?
00:38 <****> someone I work with is trying to import a dump. it is failing with error 150. I looked at the dump and one table has a key "char(32) default NULL" with a foreign key constraint to another table that defines it's column "char(32) default NULL". could that produce the 150 error?
00:39 <****> oops. /me double checks that.
00:39 <****> 150
00:39 <****> More information and FK requirements: http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
00:39 <****> Why am I being ignored?
00:39 <****> I seriously am stuck.
00:40 <****> blue: what's your question?
00:42 <****> hey people
00:42 <****> http://spaceweather.com/research/db_screenshot.jpg
00:42 <****> Is there a way to form an SQL query to:
00:42 <****> return the months with the longest strings of unbroken spans of days with SunspotNumber of zero?
00:43 <****> That screenshot is only a tiny piece of a huge table
00:43 <****> I want to get the months which have the most continuous days of SunspotNumber zero
00:45 <****> "show engine innodb status" prints an "alter table" command that doesn't exist in the dump.
00:45 <****> Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist - what am i missing here? New installation
00:46 <****> but one of the columns is "default null" and the other "not null".
00:48 <****> I have a table called "searches". It has a "query" column. How do I best return a result set where they have been counted and sorted by number of most popular queries?
00:49 <****> select * from searches where 1 order by query desc
00:49 <****> Um... no.
00:49 <****> UMMMM
00:50 <****> god I hate people who do that
00:50 <****> so freaking condescending and annoying
00:50 <****> Huh? Your query makes no sense.
00:50 <****> whatever dude
00:51 <****> Table mysql.host does not exist, what does this mean?
00:51 <****> cant you understand it?
00:51 <****> meteors: Make sure you actually know SQL if you're gonna help people with it. ;)
00:57 <****> blueredfrog, something like SELECT COUNT(*) AS 'Queries', query FROM searches GROUP BY query ORDER BY Queries DESC; ?
01:00 <****> lacuna: Yes, but that particular one seems wrong :S
01:00 <****> Hmm, but it works... or so it seems.
01:00 <****> Thanks.
01:01 <****> I was not sure what to COUNT(*)
01:01 <****> well, count(*) or count query
01:01 <****> it'll give you the same result anyway
01:01 <****> but you're welcome :)
01:01 <****> and yes, I agree with you. if someone is to help out, make sure that guy knows how to help first
01:03 <****> It's silly when you make advanced queries and then you get stuck with the basics. Hehe.
01:03 <****> oh I know..
01:04 <****> I'm just glad to do some mysql stuff.. been doing ETL jobs all day
01:09 <****> ETL?
Total 19 pages. You are browsing page 1/19.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
