Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Sep 282012
 

Install Redis server in Ubuntu

Answer:

The easiest way is to install using the PPA approach.

# sudo add-apt-repository ppa:rwky/redis
# sudo apt-get update
# sudo apt-get install redis-server

That's it.

Sep 242011
 

Show the current privileges of a MySQL user

Answer:

To show the current privileges of a MySQL user, you can use the SHOW GRANTS statement

E.g.

mysql> SHOW GRANTS;

+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
Sep 162011
 

Show the current user in MySQL

Answer:

Like in the shell, we can execute the command whoami to find out the current user name, we can use the function CURRENT_USER();

E.g.

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)