Re: MySQL sock file is missing: server doesn't start
2010/10/11 Sabika M : > 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 cyclic! 2010/10/12 partha sarathy : > once mysqld gets started then only we can see the sock file and use the same > to > connect to mysql prompt. > check your error log... some error message will be there. make it correct > otherwise reply the error msg. 101012 20:21:29 [Note] Plugin 'FEDERATED' is disabled. 101012 20:21:30 InnoDB: Started; log sequence number 0 44263 101012 20:21:30 [ERROR] Can't start server : Bind on unix socket: No such file or directory 101012 20:21:30 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ? 101012 20:21:30 [ERROR] Aborting 101012 20:21:30 InnoDB: Starting shutdown... 101012 20:21:31 InnoDB: Shutdown completed; log sequence number 0 44263 101012 20:21:31 [Note] mysqld: Shutdown complete 2010/10/12 Michael Dykman : > More often than not, this is a file permission issue. Does the MySQL > user have permission to create a socket in /var/run/mysqld ?try > > ls -ld /var/run/mysqld > ls -l /var/run/mysqld > > and make sure everything is owned by the MySQL user. now, i have created the /var/run/mysqld dir and change the own to mysql user: "sudo chown mysql:mysql mysqld" The ls -ld output is: drwxr-xr-x 2 mysql mysql 40 2010-10-12 20:31 /var/run/mysqld The result is still 2002 error! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MySQL sock file is missing: server doesn't start
2010/10/11 partha sarathy : > 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 with "sudo mysqld_safe start" the server starts for some seconds, the /var/run/mysqld/ dir is created and after it stops by itself. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
MySQL sock file is missing: server doesn't start
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 5.1.41 on Ubuntu 10.04 How to resolve this issue? thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: SHOW TABLE STATUS
2010/4/7 Carsten Pedersen : > 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: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
SHOW TABLE STATUS
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: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: SELECT with replacement chars
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]
SELECT with replacement chars
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: mysqld_safe 100% CPU: how to kill it? On Linux
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:http://lists.mysql.com/[EMAIL PROTECTED]
mysqld_safe 100% CPU: how to kill it? On Linux
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: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
mysqld_safe 100% CPU: how to kill it? On Linux
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: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Select and COUNT
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 users, also those with 0 record?? Thanks in advance -- 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: View select results
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 first, a parameter called @prev with Null (' ') value: right? And, after, you use, instead IF ELSE statement, another syntax: is it trinary operator? if yes, why it not is in the online MySQL manual? -- 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: View select results
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` varchar(25) NOT NULL, `amount` int(3) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `products` (`area`, `text`, `amount`) VALUES ('area1', 'some text', 12), ('area1', 'other text here', 13), ('area3', 'example...', 22), ('area2', 'things', 123), ('area1', 'bla bla...', 24), ('area2', 'others again', 231), ('area1', 'english language..', 44), ('area1', 'server database', 53), ('area3', 'php language...', 22), ('area2', 'linux box', 951), ('area1', 'developer tools', 4), ('area2', 'others words', 1); -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
View select results
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, thing_32 //, value_three, thing_ dd area2, value_ten, thing_6w //, value_ff, thing_l So, do not repeat more times the value of the first column (area1, area2...) -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
SELECT and count fields
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: with this tab4: IDColor Type 1 black a 1 yellow a 1 white a 1 gray1 b 23 ciano a 23 red a 23 gray4 b I would want to obtain this: idTotColor Type 1 3 gray1 23 2 gray4 How can i do? Thanks -- 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: Update query in order to modify some fields
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"); +---+ | replace("the-object1","the","an") | +---+ | an-object1| +---+ 1 row in set (0.09 sec) ok. I will use the replace function in Update query. -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Update query in order to modify some fields
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 archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Check date interval in SELECT
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 interval and that they are different is from date_in that from date_out. In the example above, I would have to obtain only last record (id 3). Thanks in advance -- 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: Simple JOIN on three tables
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 based on the date (-MM-DD) -- 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: Simple JOIN on three tables
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 unitl 2005 and the third table until 2006. If a user select a date (example) between 2005 and 2006 I want to select the data from two tables -- 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: Simple JOIN on three tables
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 For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Simple JOIN on three tables
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 '-MM-DD' and '-MM-DD' ORDER BY a.date DESC But this query returns all the fields duplicated. Where it is mistaken? -- 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 counting chars with LEFT()
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 list -- you can't use '*'! ok, I wanted to avoid to write all the fields using * I will write every single field. thanks -- 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 counting chars with LEFT()
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 want. Again, check the syntax for LEFT() in the MySQL docs. the syntax is valid: from http://dev.mysql.com/doc/refman/5.0/en/string-functions.html: "LEFT(str,len) returns the leftmost len characters from the string str, or NULL if any argument is NULL." mysql> SELECT LEFT('foobarbar', 5); -> 'fooba' I have 30 fields: instead writing all 30 fields, I would want to select them all with * and only for one of they, fieldA, to obtain the first 20 chars: it's possible? -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
SELECT counting chars with LEFT()
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:http://lists.mysql.com/[EMAIL PROTECTED]
Subqueries in MySQL < 4.1
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 -- http://www.spacemarc.it -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]