ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2009-10-27 Thread F.A.I.Z.A.L
hi experts

ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

iam facing the above error while connecting the mysql database. i am also
checked the mysql.sock socket file is not in /tmp.

could you please help me to fix this problem. what i have to do now..

is there any way to replace the socket file from another mysql server or i
have to reinstall mysql software in this server. if re-installation from the
scratch mean what are the steps i have follow before and after installation
to safeguard the existing databases..

please provide you assistance to fix this issue..

many thanks in advance..


Best Regards
Faizal S
GSM : 9840118673
Blog: http://oradbapro.blogspot.com


Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2009-10-27 Thread lists
The socket hets created when you start the server
It might be in the mysql home dir, it might be in /var/run. 
See if its declared in my.cnf


Sent via BlackBerry from T-Mobile

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2009-10-27 Thread F.A.I.Z.A.L
Hi

thanks for your reply.

i found the problem, the problem was due to maintenance activity IT team
rebooted the machine but they didn't start the mysql server after reboot.

i executed mysqld with root credit. i got the below output but still the
cursor not return to prompt

bash-2.03# /usr/local/mysql/libexec/mysqld -u root
091027 15:35:09  InnoDB: Started; log sequence number 0 625687
091027 15:35:10 [Note] /usr/local/mysql/libexec/mysqld: ready for
connections.
Version: '5.0.51-log'  socket: '/tmp/mysql.sock'  port: 3306  Source
distribution

can you verify this. is it correct.

thanks in advance..




Best Regards
Faizal S
GSM : 9840118673
Blog: http://oradbapro.blogspot.com


On Tue, Oct 27, 2009 at 12:03 PM, li...@up-south.com wrote:

 The socket hets created when you start the server
 It might be in the mysql home dir, it might be in /var/run.
 See if its declared in my.cnf


 Sent via BlackBerry from T-Mobile



How can I know if Mysql Crashed or stopped gracefully

2009-10-27 Thread Bryan Cantwell
I have an environment where upon boot of a machine I need to know if 
mysql shutdown nicely or if it crashed.
How can I know for sure which was the case so that I can take action if 
needed?
I notice that issuing a reboot or shutdown -r now command, (in Linux) 
that the 'service mysql stop'  is never run... it just seems to catch 
the sig 15 and does its own shutdown...


I have scripted in the stop section of my init script to touch a file 
that I look for on restart, but if the stop is never executed on 
reboot/shutdown, then I have a problem.


Thanks for the help,
Bryancan

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



results of the query as a table

2009-10-27 Thread Olga Lyashevska

Dear all,

I run a query and I try to save results as a table. On the results of  
this first query I want to run yet another query (perhaps a few).
I have been trying to use CREATE VIEW statement, which works fine,  
except for the fact that fields are not indexed because as I  
understand it indices cannot be created on views. It really affects  
the performance, making it nearly impossible to run any further queries.


I am aware that it is a rather trivial problem, but still I did not  
manage to find a solution which would meet my requirements.


So my question is: are there any other possibilities to save results  
of the query as a table so that they will be re-used to run yet  
another query?


Thanks in advance,
Olga

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: results of the query as a table

2009-10-27 Thread Steve Edberg

At 2:59 PM + 10/27/09, Olga Lyashevska wrote:

Dear all,

I run a query and I try to save results as a table. On the results 
of this first query I want to run yet another query (perhaps a few).
I have been trying to use CREATE VIEW statement, which works fine, 
except for the fact that fields are not indexed because as I 
understand it indices cannot be created on views. It really affects 
the performance, making it nearly impossible to run any further 
queries.


I am aware that it is a rather trivial problem, but still I did not 
manage to find a solution which would meet my requirements.


So my question is: are there any other possibilities to save results 
of the query as a table so that they will be re-used to run yet 
another query?


Thanks in advance,
Olga



CREATE TABLE ... SELECT

should do what you want. For example

	CREATE TABLE foo SELECT thing1,thing2,concat(thing3,thing4) 
as thing5 from bar where thing4 like 'baz%' order by thing1 desc


You could create a TEMPORARY table if needed (CREATE TEMPORARY 
TABLE...). Assuming version 5.0:


http://dev.mysql.com/doc/refman/5.0/en/create-table.html

- steve

--
++
| Steve Edberg  edb...@edberg-online.com |
| Programming/Database/SysAdminhttp://www.edberg-online.com/ |
++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: results of the query as a table

2009-10-27 Thread Olga Lyashevska


On 27.10.2009, at 15:11, Steve Edberg wrote:


At 2:59 PM + 10/27/09, Olga Lyashevska wrote:

Dear all,

I run a query and I try to save results as a table. On the results  
of this first query I want to run yet another query (perhaps a few).
I have been trying to use CREATE VIEW statement, which works fine,  
except for the fact that fields are not indexed because as I  
understand it indices cannot be created on views. It really affects  
the performance, making it nearly impossible to run any further  
queries.


I am aware that it is a rather trivial problem, but still I did not  
manage to find a solution which would meet my requirements.


So my question is: are there any other possibilities to save  
results of the query as a table so that they will be re-used to run  
yet another query?


Thanks in advance,
Olga



CREATE TABLE ... SELECT

should do what you want. For example

	CREATE TABLE foo SELECT thing1,thing2,concat(thing3,thing4) as  
thing5 from bar where thing4 like 'baz%' order by thing1 desc


You could create a TEMPORARY table if needed (CREATE TEMPORARY  
TABLE...). Assuming version 5.0:


Thanks Steve. It is solved! Shall I add indices manually to speed up  
query?


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: results of the query as a table

2009-10-27 Thread Steve Edberg

At 3:29 PM + 10/27/09, Olga Lyashevska wrote:

On 27.10.2009, at 15:11, Steve Edberg wrote:


At 2:59 PM + 10/27/09, Olga Lyashevska wrote:

Dear all,

I run a query and I try to save results as a table. On the results 
of this first query I want to run yet another query (perhaps a 
few).
I have been trying to use CREATE VIEW statement, which works fine, 
except for the fact that fields are not indexed because as I 
understand it indices cannot be created on views. It really 
affects the performance, making it nearly impossible to run any 
further queries.


I am aware that it is a rather trivial problem, but still I did 
not manage to find a solution which would meet my requirements.


So my question is: are there any other possibilities to save 
results of the query as a table so that they will be re-used to 
run yet another query?


Thanks in advance,
Olga



CREATE TABLE ... SELECT

should do what you want. For example

	CREATE TABLE foo SELECT thing1,thing2,concat(thing3,thing4) 
as thing5 from bar where thing4 like 'baz%' order by thing1 desc


You could create a TEMPORARY table if needed (CREATE TEMPORARY 
TABLE...). Assuming version 5.0:


Thanks Steve. It is solved! Shall I add indices manually to speed up query?




It would probably help, yes. As it mentions near the bottom of the 
CREATE TABLE documentation page, you can override column definitions 
and create indexes in the same statement, something like:


	CREATE TABLE foo (a TINYINT NOT NULL),  c, unique(c) SELECT 
b+1 AS a, c FROM bar;


(never tried that myself). Or you could do an ALTER TABLE afterwards 
to add appropriate indexes. And are you familiar with the EXPLAIN 
command to help optimize queries/decide what indexes to add?


http://dev.mysql.com/doc/refman/5.0/en/create-table.html
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

http://dev.mysql.com/doc/refman/5.0/en/query-speed.html
http://dev.mysql.com/doc/refman/5.0/en/explain.html

- steve

--
++
| Steve Edberg  edb...@edberg-online.com |
| Programming/Database/SysAdminhttp://www.edberg-online.com/ |
++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



CONNECTION (SOCKET AND TCP/IP)

2009-10-27 Thread Krishna Chandra Prajapati
Hi All,

Any body can explain the difference between socket connection and tcp/ip
connection.

Thanks,
Krishna


Re: CONNECTION (SOCKET AND TCP/IP)

2009-10-27 Thread lists
Socket connections do not use tcp (meaning localhost)
Remote hosts use tcpip

Sent via BlackBerry from T-Mobile

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: results of the query as a table

2009-10-27 Thread Olga Lyashevska

Dear Steve,

On 27.10.2009, at 16:19, Steve Edberg wrote:
 Or you could do an ALTER TABLE afterwards to add appropriate  
indexes. And are you familiar with the EXPLAIN command to help  
optimize queries/decide what indexes to add?


Thanks for this! I have added indicies with ALTER TABLE.
And using EXPLAIN  and ANALYZE TABLE I found out that in fact I am  
creating a huge Cartesian product joining fields of two tables which  
are not indexed!
No wonder it took ages to get this query done, I used up 99% of CPU.  
Definitely it can and it should be optimized.

Thanks for your tips again.

Cheers,
Olga


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How can I know if Mysql Crashed or stopped gracefully

2009-10-27 Thread Johan De Meersman
Signal 15 is pretty much equal to a regular shutdown, except that if your
shutdown script doesn't run, you may be left with lockfiles, pidfiles and
the like.

A crash would most likely be visible in the logfile, and even if it isn't
(machine loses power), your log should show innodb running a recovery
procedure at startup.


On Tue, Oct 27, 2009 at 3:51 PM, Bryan Cantwell bcantw...@firescope.comwrote:

 I have an environment where upon boot of a machine I need to know if mysql
 shutdown nicely or if it crashed.
 How can I know for sure which was the case so that I can take action if
 needed?
 I notice that issuing a reboot or shutdown -r now command, (in Linux) that
 the 'service mysql stop'  is never run... it just seems to catch the sig 15
 and does its own shutdown...

 I have scripted in the stop section of my init script to touch a file that
 I look for on restart, but if the stop is never executed on reboot/shutdown,
 then I have a problem.

 Thanks for the help,
 Bryancan

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql?unsub=vegiv...@tuxera.be




Re: How can I know if Mysql Crashed or stopped gracefully

2009-10-27 Thread Todd Lyons
On Tue, Oct 27, 2009 at 7:51 AM, Bryan Cantwell bcantw...@firescope.com wrote:
 I notice that issuing a reboot or shutdown -r now command, (in Linux) that
 the 'service mysql stop'  is never run... it just seems to catch the sig 15
 and does its own shutdown...
 I have scripted in the stop section of my init script to touch a file that I
 look for on restart, but if the stop is never executed on reboot/shutdown,
 then I have a problem.

What distro?  Which version of mysql?  My comments below apply to our
InnoDB heavy CentOS systems.

Older versions of mysql (5.0.x on our CentOS machines) wait 60 seconds
for the mysqld process to completely die.  If mysql has a lot of data
to flush to disk, it can take longer than that 60 seconds.  The init
script assumes that the kill command didn't succeed, it prints out
FAILED, and the system shutdown process moves on to the next init
script.  Near the end of the system shutdown process, the shutdown
script issues a final SIGKILL to remaining running processes.  If
mysqld didn't finish flushing that data before this final KILL signal,
the mysqld process is killed instantly and you have an unclean
shutdown.

One quick solution is to manually stop mysql, watching to see when the
process finally goes away (top, ps, etc), then do your shutdown -r
now.

Modern versions of mysql (5.1.x) seem to handle this better because it
waits as long as it takes for mysqld to shut down properly or to start
up (and accept connections).  At least in my testing so far, I've not
hit a timeout or received an incorrect OK or FAILED message in the
5.1.x series.

-- 
Regards...  Todd
The best thing about pair programming is that you have the perfect
audience for your genius.  -- Kent Beck

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



START TRANSACTION COMMIT ROLLBACK

2009-10-27 Thread Mosaed AlZamil
Hello Everyone,
 I am a newbie using innodb.
How can I implement  START TRANSACTION COMMIT ROLLBACK when I need to update
two tables
that are located in two different databases. Would a single  START
TRANSACTION be sufficient ?
Any help would be appreciated.
TIA
Mos