Re: MySQL sock file is missing: server doesn't start

2010-10-12 Thread spacemarc
2010/10/11 Sabika M sabika.makhd...@gmail.com: are the permissions on that directory correct? The .sock file is created at start up by mysql mysqld doesn't start because are missing /var/run/mysqld dir and /var/run/mysqld/mysqld.sock file. Dir and file are created on mysqld boot, i presume. It's

Re: MySQL sock file is missing: server doesn't start

2010-10-11 Thread spacemarc
2010/10/11 partha sarathy par...@mafiree.com: Hi, This can be useful... http://mafiree.com/blg/?p=124 i've checked your link but it doesn't work. mysqld server is not running and if i want to start it i obtain 2002 error because the /var/run/mysqld/mysqld.sock file is missing. If i start it

MySQL sock file is missing: server doesn't start

2010-10-10 Thread spacemarc
hi MySQL server doesn't start because #2002 the /var/run/mysqld/mysqld.sock is missing. The server only start with sudo mysqld_safe but without the mysqld.sock file. I've checked my /etc/mysql/my.cnf file and the paths are correct for [client] and [mysqld]: /var/run/mysqld/mysqld.sock I run

Re: SHOW TABLE STATUS

2010-04-08 Thread spacemarc
2010/4/7 Carsten Pedersen cars...@bitbybit.dk: AFAIR, MySQL 4.x supports LIKE, e.g. SHOW TABLE STATUS LIKE 'tab_%' yes, but if the tables have different names (table1, tab_2, abcd... ) your syntax will not work. How to do? -- MySQL General Mailing List For list archives:

SHOW TABLE STATUS

2010-04-07 Thread spacemarc
hi all, in MySQL 4.1.x i want to obtain the status of more tables with one only query. In 5.x i use SHOW TABLE STATUS WHERE Name IN ('tab_1', tab_2, 'tab_3') In 4.1.x i tried to use but it doesn't works: how to set the query? Thanks -- MySQL General Mailing List For list archives:

SELECT with replacement chars

2008-12-05 Thread spacemarc
Hi how can i replace, in a SELECT query, the last 3 numbers with asterisks? from 0123456789 to 0123456*** -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: SELECT with replacement chars

2008-12-05 Thread spacemarc
thanks, it works fine (on mysql 4 and 5) SELECT CONCAT(LEFT(myfield,LENGTH(myfield) - 3), '***') FROM table; -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

mysqld_safe 100% CPU: how to kill it? On Linux

2007-06-11 Thread spacemarc
Hi when I stop mysql server with sudo /etc/init.d/mysql stop the mysqld_safe process go to 100% of CPU and I must to kill it manually. What's happens? Ho can I stop it without killing? -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives:

Re: mysqld_safe 100% CPU: how to kill it? On Linux

2007-06-11 Thread spacemarc
2007/6/11, Ananda Kumar [EMAIL PROTECTED]: try mysqladmin shutdown I've tried but nothing is happens: the mysqld_safe process is always to 100% -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Select and COUNT

2007-06-08 Thread spacemarc
Hi all, I have this query: SELECT tableA.*, COUNT(*) AS Tot FROM tableB LEFT JOIN tableA ON tableA.uid=tableB.uid GROUP BY tableA.uid This query shows only the users (tableA) that are in tableB with at least 1 record (like total) but not the users that have 0 record. How can I obtain all

mysqld_safe 100% CPU: how to kill it? On Linux

2007-06-08 Thread spacemarc
Hi when I stop mysql server with sudo /etc/init.d/mysql stop the mysqld_safe process go to 100% of CPU and I must to kill it manually. What's happens? Ho can I stop it without killing? -- Scripts: http://www.spacemarc.it -- MySQL General Mailing List For list archives:

View select results

2007-05-02 Thread spacemarc
Hi my table have three fields that, if selected, are shown like: area1, value_one, thing_one area1, value_two, thing_32 area1, value_three, thing_ dd area2, value_ten, thing_6w area2, value_ff, thing_l can I obtain a recordset like this? area1, value_one, thing_one //, value_two,

Re: View select results

2007-05-02 Thread spacemarc
2007/5/2, Peter Brawley [EMAIL PROTECTED]: Works for me. Please post a CREATE TABLE stmt enough INSERTs to demonstrate the problem. This is the dump (MySQL: 5.0.38): the table is not final version, just to test the query. CREATE TABLE `products` ( `area` varchar(25) NOT NULL, `text`

Re: View select results

2007-05-02 Thread spacemarc
2007/5/2, Peter Brawley [EMAIL PROTECTED]: Right, give the computed column an alias differeing from the column name, eg SET @prev=''; SELECT IF(area = @prev, '', @prev := area) AS AreaHdr, text,amount FROM products ORDER BY area DESC; ok, now it works! thanks! One last thing: you set, at

SELECT and count fields

2006-12-07 Thread spacemarc
Hi I have this select: SELECT tab1.field, tab2.field, tab3.field FROM table JOIN JOIN WHERE tab4.type=b GROUP BY etc ORDER BY etc Now, the tab4 has three fields: id, color, type. I want to select where type=b and to count all the occurrences of color in the same query. Example:

Update query in order to modify some fields

2006-11-17 Thread spacemarc
Hi I have more fields with values as the-object1 the-object2 the-object45 I must to change only the part begins them to other words, example: the-object2 must become an-object2 Which syntax I can use? Thanks in advance -- http://www.spacemarc.it -- MySQL General Mailing List For list

Re: Update query in order to modify some fields

2006-11-17 Thread spacemarc
2006/11/17, Mike Kruckenberg [EMAIL PROTECTED]: If it's values you are updating you can use the replace() string function to do something like this: update table1 set field1=replace(field1,'the','an'); To demonstrate: mysql select replace(the-object1,the,an);

Check date interval in SELECT

2006-10-29 Thread spacemarc
Hi I have 3 fields like this: id date_in date_out 1 2006-09-05 2006-09-10 2 2006-09-15 2006-09-20 3 2006-09-25 2006-09-30 Example: if I have an time interval like '2006-09-05' and '2006-09-21', I have to search, in the same time, only the records that not included in time

Simple JOIN on three tables

2006-10-18 Thread spacemarc
Hi I have 3 tables with the same fields. I would want to find the data that they are comprised in the time interval: SELECT a.*, b.*, c.* FROM tab1 a, tab2 b, tab3 c WHERE a.date between '-MM-DD' and '-MM-DD' OR b.date between '-MM-DD' and '-MM-DD' OR c.date between

Re: Simple JOIN on three tables

2006-10-18 Thread spacemarc
ok, instead I use (SELECT * FROM tab1 WHERE mydate between 'the-date1' and 'the-date2' ) UNION (SELECT * FROM tab2 WHERE mydate between 'the-date1' and 'the-date2' ) etc But if I wanted to use a join I can make it however or not? -- http://www.spacemarc.it -- MySQL General Mailing List

Re: Simple JOIN on three tables

2006-10-18 Thread spacemarc
2006/10/18, Peter Brawley [EMAIL PROTECTED]: You can join on any row(s) you like. What are you trying to acccomplish? I simply want to select the records from my three tables that are comprised in time interval. Now, the first table comprises the records until to 2004 year; the second table

Re: Simple JOIN on three tables

2006-10-18 Thread spacemarc
2006/10/18, William R. Mussatto [EMAIL PROTECTED]: Then it is really a UNION. I hope you have the date field as an index otherwise you are looking at a table scan which is always slow. Ok, if I have the field ID that have the same value in three tables but I want to select however the data

SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
Hi, I want to get all records from Tab1 and the first 20 words for the fieldA SELECT *, LEFT(fieldA, 20) AS fieldA FROM Tab1 But this query does not work: why? thanks! -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
2006/9/6, Miles Thompson [EMAIL PROTECTED]: First of all - please reply to the list .. I thought you wanted all fields, that's the way your SELECT statement is constructed. If just the first 20 char from fieldA, then ... SELECT LEFT(fieldA, 20) AS fieldA FROM Tab1 should do what you

Re: SELECT counting chars with LEFT()

2006-09-06 Thread spacemarc
2006/9/6, Bill Tantzen [EMAIL PROTECTED]: You are actually selecting fieldA twice -- the first time (with '*') will return the entire column. The second time with only the first 20 chars. If you only want to see the first 20 chars, you will have to explicitly name every column in your select

Subqueries in MySQL 4.1

2006-08-23 Thread spacemarc
Hi, I have a query like this: SELECT table1.*,( SELECT COUNT( field2 ) FROM table2 WHERE id=10 ) AS total FROM table1 GROUP BY id LIMIT 1 but the subqueries do not work with mysql 4.1. How can I convert it (or make to work) in MySQL 3.x, 4.0 possibly in one only query? thanks --