Skip to main content


Showing posts from 2013

redis server went away

It feels really awkward to see "redis: uncaught exception: Redis server went away" when it was working and suddenly this message bumps up. I faced the same situation while accessing php redis but I guess it's more generic one, more related to redis. So, here are possible solutions that I am able to find and highlighting the one which really did work for me.

1. /usr/sbin/setsebool httpd_can_network_connect=1

By default, SELinux does not allow Apache to make socket connections. So, enable the connection.

2. Try to stop the redis server and restart it again.
either of these two should work:
a) redis-cli
b) redis server

3. There might be issues with switch, try to use different switch.

swap two columns values in sql

There are various methods on net to swap values of two column, tried many of them. This one seems to be working for me:

UPDATE table_name SET A=B, B=@temp WHERE (@temp:=A) ;

Some of the queries that don't work are:

1. DECLARE @temp AS varchar(10)
UPDATE Employee1 SET @temp=LastName, LastName=FirstName, FirstName=@temp

2. UPDATE Employee1 SET LastName=FirstName, FirstName=LastName

NOTE: talking about sql query only, not including SAS etc