<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Ask! &#187; Databases</title>
	<atom:link href="http://www.linuxask.com/topics/databases/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxask.com</link>
	<description>Linux Ask! is a Q &#38; A web site specific for Linux related questions such as how to use common Linux commands.</description>
	<lastBuildDate>Tue, 05 May 2015 07:15:40 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>How to install redis on Mac OSX using home brew</title>
		<link>http://www.linuxask.com/questions/how-to-install-redis-on-mac-osx-using-home-brew</link>
		<comments>http://www.linuxask.com/questions/how-to-install-redis-on-mac-osx-using-home-brew#comments</comments>
		<pubDate>Wed, 31 Jul 2013 15:52:03 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Redis]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4304</guid>
		<description><![CDATA[How to install redis in Mac OSX using home brew Answer: To install redis on Mac OSX using homebrew, use # brew install redis<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-disable-services-auto-startup-if-they-are-installed-using-home-brew" rel="bookmark" title="How to disable services auto startup if they are installed using home brew">How to disable services auto startup if they are installed using home brew </a></li>
<li><a href="http://www.linuxask.com/questions/install-redis-server-in-ubuntu" rel="bookmark" title="Install Redis server in Ubuntu">Install Redis server in Ubuntu </a></li>
<li><a href="http://www.linuxask.com/questions/install-bash-completion-for-mac-osx" rel="bookmark" title="Install bash completion for Mac OSX">Install bash completion for Mac OSX </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to install redis in Mac OSX using home brew</p>
<p><strong>Answer:</strong></p>
<p>To install redis on Mac OSX using homebrew, use</p>
<p><code># brew install redis</code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-disable-services-auto-startup-if-they-are-installed-using-home-brew" rel="bookmark" title="How to disable services auto startup if they are installed using home brew">How to disable services auto startup if they are installed using home brew </a></li>
<li><a href="http://www.linuxask.com/questions/install-redis-server-in-ubuntu" rel="bookmark" title="Install Redis server in Ubuntu">Install Redis server in Ubuntu </a></li>
<li><a href="http://www.linuxask.com/questions/install-bash-completion-for-mac-osx" rel="bookmark" title="Install bash completion for Mac OSX">Install bash completion for Mac OSX </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-install-redis-on-mac-osx-using-home-brew/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable MySQL from autostart when Ubuntu bootup</title>
		<link>http://www.linuxask.com/questions/how-to-disable-mysql-from-autostart-when-ubuntu-bootup</link>
		<comments>http://www.linuxask.com/questions/how-to-disable-mysql-from-autostart-when-ubuntu-bootup#comments</comments>
		<pubDate>Sat, 18 May 2013 15:18:42 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4249</guid>
		<description><![CDATA[How to disable MySQL from autostart when Ubuntu bootup Answer: A newer version of MySQL use upstart to autostart when system bootup, to disable it # sudo mkdir /etc/init.disabled # sudo mv /etc/init/mysql.conf /etc/init.disabled/<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/disable-a-service-in-ubuntu-using-upstart" rel="bookmark" title="Disable a service in Ubuntu using upstart">Disable a service in Ubuntu using upstart </a></li>
<li><a href="http://www.linuxask.com/questions/etcinittab-is-missing-in-ubuntuetcinittab-is-missing-in-ubuntu" rel="bookmark" title="/etc/inittab is missing in Ubuntu">/etc/inittab is missing in Ubuntu </a></li>
<li><a href="http://www.linuxask.com/questions/disable-dns-hostname-lookup-in-mysql" rel="bookmark" title="Disable DNS hostname lookup in MySQL">Disable DNS hostname lookup in MySQL </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to disable MySQL from autostart when Ubuntu bootup</p>
<p><strong>Answer:</strong></p>
<p>A newer version of MySQL use upstart to autostart when system bootup, to disable it</p>
<pre># sudo mkdir /etc/init.disabled
# sudo mv /etc/init/mysql.conf /etc/init.disabled/
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/disable-a-service-in-ubuntu-using-upstart" rel="bookmark" title="Disable a service in Ubuntu using upstart">Disable a service in Ubuntu using upstart </a></li>
<li><a href="http://www.linuxask.com/questions/etcinittab-is-missing-in-ubuntuetcinittab-is-missing-in-ubuntu" rel="bookmark" title="/etc/inittab is missing in Ubuntu">/etc/inittab is missing in Ubuntu </a></li>
<li><a href="http://www.linuxask.com/questions/disable-dns-hostname-lookup-in-mysql" rel="bookmark" title="Disable DNS hostname lookup in MySQL">Disable DNS hostname lookup in MySQL </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-disable-mysql-from-autostart-when-ubuntu-bootup/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate random data in MongoDB</title>
		<link>http://www.linuxask.com/questions/generate-random-data-in-mongodb</link>
		<comments>http://www.linuxask.com/questions/generate-random-data-in-mongodb#comments</comments>
		<pubDate>Wed, 15 May 2013 15:16:21 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Advanced Linux]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4246</guid>
		<description><![CDATA[Generate random data in MongoDB Answer: You can use the following method to generate random string into a collection in MongoDB: function randomString() { var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; var randomstring = ''; var string_length = 100; for (var i=0; i&#60;string_length; i++) { var rnum = Math.floor(Math.random() * chars.length); randomstring += chars.substring(rnum,rnum+1); } return randomstring; } <a href='http://www.linuxask.com/questions/generate-random-data-in-mongodb' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/generate-uuid-in-php" rel="bookmark" title="Generate UUID in PHP">Generate UUID in PHP </a></li>
<li><a href="http://www.linuxask.com/questions/generate-random-number-in-linux" rel="bookmark" title="Generate random number in Linux">Generate random number in Linux </a></li>
<li><a href="http://www.linuxask.com/questions/generate-random-number-in-perl" rel="bookmark" title="Generate random number in Perl">Generate random number in Perl </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Generate random data in MongoDB</p>
<p><strong>Answer:</strong></p>
<p>You can use the following method to generate random string into a collection in MongoDB:</p>
<pre><code>function randomString() { 
        var chars = 
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"; 
        var randomstring = ''; 
        var string_length = 100;
        for (var i=0; i&lt;string_length; i++) { 
                var rnum = Math.floor(Math.random() * chars.length); 
                randomstring += chars.substring(rnum,rnum+1); 
        } 
        return randomstring; 
} 

for(var i=0; i<2000000; i++){db.test.save({x:i, data:randomString()});} 
</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/generate-uuid-in-php" rel="bookmark" title="Generate UUID in PHP">Generate UUID in PHP </a></li>
<li><a href="http://www.linuxask.com/questions/generate-random-number-in-linux" rel="bookmark" title="Generate random number in Linux">Generate random number in Linux </a></li>
<li><a href="http://www.linuxask.com/questions/generate-random-number-in-perl" rel="bookmark" title="Generate random number in Perl">Generate random number in Perl </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/generate-random-data-in-mongodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get the total database index size of my MongoDB</title>
		<link>http://www.linuxask.com/questions/how-to-get-the-total-database-index-size-of-my-mongodb</link>
		<comments>http://www.linuxask.com/questions/how-to-get-the-total-database-index-size-of-my-mongodb#comments</comments>
		<pubDate>Wed, 15 May 2013 07:47:01 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4235</guid>
		<description><![CDATA[How to get the total database index size of my MongoDB Answer: In you mongo shell, execute the following command: var sum = 0; db.getMongo().getDBs()["databases"].forEach(function(x) { sum += db.getMongo().getDB(x.name).stats().indexSize }); print(sum)<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/creates-an-index-in-mongodb" rel="bookmark" title="Creates an index in MongoDB">Creates an index in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/repair-and-compact-database-in-mongodb" rel="bookmark" title="Repair and compact database in MongoDB">Repair and compact database in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/create-an-index-on-a-document-in-mongodb" rel="bookmark" title="Create an index on a document in MongoDB">Create an index on a document in MongoDB </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to get the total database index size of my MongoDB</p>
<p><strong>Answer:</strong></p>
<p>In you mongo shell, execute the following command:</p>
<pre><code>var sum = 0; db.getMongo().getDBs()["databases"].forEach(function(x) { sum += db.getMongo().getDB(x.name).stats().indexSize }); print(sum)</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/creates-an-index-in-mongodb" rel="bookmark" title="Creates an index in MongoDB">Creates an index in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/repair-and-compact-database-in-mongodb" rel="bookmark" title="Repair and compact database in MongoDB">Repair and compact database in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/create-an-index-on-a-document-in-mongodb" rel="bookmark" title="Create an index on a document in MongoDB">Create an index on a document in MongoDB </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-get-the-total-database-index-size-of-my-mongodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check how long a MongoDB instance was running</title>
		<link>http://www.linuxask.com/questions/check-how-long-a-mongodb-instance-was-running</link>
		<comments>http://www.linuxask.com/questions/check-how-long-a-mongodb-instance-was-running#comments</comments>
		<pubDate>Mon, 15 Apr 2013 02:16:59 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4219</guid>
		<description><![CDATA[Check how long a MongoDB instance was running Answer: To see how long a MongoDB instance was running, you can login into the mongo shell, and enter db.serverStatus().uptime / 3600 The above command reply the value in term of hours.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/check-how-long-server-has-been-running" rel="bookmark" title="Check how long server has been running">Check how long server has been running </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-get-the-startup-warning-from-mongodb" rel="bookmark" title="How to get the startup warning from MongoDB?">How to get the startup warning from MongoDB? </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version" rel="bookmark" title="How to check the current MongoDB version">How to check the current MongoDB version </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Check how long a MongoDB instance was running</p>
<p><strong>Answer:</strong></p>
<p>To see how long a MongoDB instance was running, you can login into the mongo shell, and enter</p>
<p><code>db.serverStatus().uptime / 3600</code></p>
<p>The above command reply the value in term of <strong>hours</strong>.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/check-how-long-server-has-been-running" rel="bookmark" title="Check how long server has been running">Check how long server has been running </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-get-the-startup-warning-from-mongodb" rel="bookmark" title="How to get the startup warning from MongoDB?">How to get the startup warning from MongoDB? </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version" rel="bookmark" title="How to check the current MongoDB version">How to check the current MongoDB version </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/check-how-long-a-mongodb-instance-was-running/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get the startup warning from MongoDB?</title>
		<link>http://www.linuxask.com/questions/how-to-get-the-startup-warning-from-mongodb</link>
		<comments>http://www.linuxask.com/questions/how-to-get-the-startup-warning-from-mongodb#comments</comments>
		<pubDate>Thu, 11 Apr 2013 02:16:28 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4217</guid>
		<description><![CDATA[How to get the startup warning from MongoDB? Answer: The easiest way is login into the MongoDB using the shell, enter the command: db.adminCommand({getLog: "startupWarnings" })<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/drop-a-collection-in-mongodb" rel="bookmark" title="Drop a collection in MongoDB">Drop a collection in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/create-an-index-on-a-document-in-mongodb" rel="bookmark" title="Create an index on a document in MongoDB">Create an index on a document in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version" rel="bookmark" title="How to check the current MongoDB version">How to check the current MongoDB version </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to get the startup warning from MongoDB?</p>
<p><strong>Answer:</strong></p>
<p>The easiest way is login into the MongoDB using the shell, enter the command:</p>
<p><code>db.adminCommand({getLog: "startupWarnings" })</code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/drop-a-collection-in-mongodb" rel="bookmark" title="Drop a collection in MongoDB">Drop a collection in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/create-an-index-on-a-document-in-mongodb" rel="bookmark" title="Create an index on a document in MongoDB">Create an index on a document in MongoDB </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version" rel="bookmark" title="How to check the current MongoDB version">How to check the current MongoDB version </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-get-the-startup-warning-from-mongodb/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check the current MongoDB version</title>
		<link>http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version</link>
		<comments>http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version#comments</comments>
		<pubDate>Tue, 20 Nov 2012 04:19:58 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4064</guid>
		<description><![CDATA[How to check the current MongoDB version Answer: Simply type the following command in your MongoDB's shell db.version()<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-bash-shell-version" rel="bookmark" title="How to check the bash shell version">How to check the bash shell version </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-current-php-version-in-php" rel="bookmark" title="How to check current PHP version in PHP?">How to check current PHP version in PHP? </a></li>
<li><a href="http://www.linuxask.com/questions/check-how-long-a-mongodb-instance-was-running" rel="bookmark" title="Check how long a MongoDB instance was running">Check how long a MongoDB instance was running </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to check the current MongoDB version</p>
<p><strong>Answer:</strong></p>
<p>Simply type the following command in your MongoDB's shell</p>
<p><code>db.version()</code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-check-the-bash-shell-version" rel="bookmark" title="How to check the bash shell version">How to check the bash shell version </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-check-current-php-version-in-php" rel="bookmark" title="How to check current PHP version in PHP?">How to check current PHP version in PHP? </a></li>
<li><a href="http://www.linuxask.com/questions/check-how-long-a-mongodb-instance-was-running" rel="bookmark" title="Check how long a MongoDB instance was running">Check how long a MongoDB instance was running </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-check-the-current-mongodb-version/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Redis server in Ubuntu</title>
		<link>http://www.linuxask.com/questions/install-redis-server-in-ubuntu</link>
		<comments>http://www.linuxask.com/questions/install-redis-server-in-ubuntu#comments</comments>
		<pubDate>Fri, 28 Sep 2012 03:49:18 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Redis]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4030</guid>
		<description><![CDATA[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.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/install-sun-java-jdk-in-ubuntu-10-04" rel="bookmark" title="Install sun-java-jdk in Ubuntu 10.04">Install sun-java-jdk in Ubuntu 10.04 </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-install-ssh-server-in-ubuntu" rel="bookmark" title="How to install SSH server in Ubuntu?">How to install SSH server in Ubuntu? </a></li>
<li><a href="http://www.linuxask.com/questions/install-aws-tools-on-ubuntu" rel="bookmark" title="Install AWS tools on Ubuntu">Install AWS tools on Ubuntu </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Install Redis server in Ubuntu</p>
<p><strong>Answer:</strong></p>
<p>The easiest way is to install using the PPA approach.</p>
<pre><code># sudo add-apt-repository ppa:rwky/redis
# sudo apt-get update
# sudo apt-get install redis-server</code></pre>
<p>That's it.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/install-sun-java-jdk-in-ubuntu-10-04" rel="bookmark" title="Install sun-java-jdk in Ubuntu 10.04">Install sun-java-jdk in Ubuntu 10.04 </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-install-ssh-server-in-ubuntu" rel="bookmark" title="How to install SSH server in Ubuntu?">How to install SSH server in Ubuntu? </a></li>
<li><a href="http://www.linuxask.com/questions/install-aws-tools-on-ubuntu" rel="bookmark" title="Install AWS tools on Ubuntu">Install AWS tools on Ubuntu </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/install-redis-server-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show the current privileges of a MySQL user</title>
		<link>http://www.linuxask.com/questions/show-the-current-privileges-of-a-mysql-user</link>
		<comments>http://www.linuxask.com/questions/show-the-current-privileges-of-a-mysql-user#comments</comments>
		<pubDate>Sat, 24 Sep 2011 13:28:13 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3484</guid>
		<description><![CDATA[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&#62; SHOW GRANTS; +----------------------------------------------------------------------------------------------------------------------------------------+ &#124; Grants for root@localhost &#124; +----------------------------------------------------------------------------------------------------------------------------------------+ &#124; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' WITH GRANT OPTION &#124; +----------------------------------------------------------------------------------------------------------------------------------------+<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-create-a-new-mysql-user" rel="bookmark" title="How to create a new MySQL user?">How to create a new MySQL user? </a></li>
<li><a href="http://www.linuxask.com/questions/show-the-current-user-in-mysql" rel="bookmark" title="Show the current user in MySQL">Show the current user in MySQL </a></li>
<li><a href="http://www.linuxask.com/questions/reset-mysql-root-password" rel="bookmark" title="Reset MySQL root password">Reset MySQL root password </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Show the current privileges of a MySQL user</p>
<p><strong>Answer:</strong></p>
<p>To show the current privileges of a <strong>MySQL </strong>user, you can use the <strong>SHOW GRANTS</strong> statement</p>
<p>E.g.</p>
<pre><code>mysql&gt; SHOW GRANTS;

+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-create-a-new-mysql-user" rel="bookmark" title="How to create a new MySQL user?">How to create a new MySQL user? </a></li>
<li><a href="http://www.linuxask.com/questions/show-the-current-user-in-mysql" rel="bookmark" title="Show the current user in MySQL">Show the current user in MySQL </a></li>
<li><a href="http://www.linuxask.com/questions/reset-mysql-root-password" rel="bookmark" title="Reset MySQL root password">Reset MySQL root password </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/show-the-current-privileges-of-a-mysql-user/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show the current user in MySQL</title>
		<link>http://www.linuxask.com/questions/show-the-current-user-in-mysql</link>
		<comments>http://www.linuxask.com/questions/show-the-current-user-in-mysql#comments</comments>
		<pubDate>Fri, 16 Sep 2011 13:37:37 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3489</guid>
		<description><![CDATA[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&#62; SELECT CURRENT_USER(); +----------------+ &#124; CURRENT_USER() &#124; +----------------+ &#124; root@localhost &#124; +----------------+ 1 row in set (0.00 sec)<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/show-the-current-privileges-of-a-mysql-user" rel="bookmark" title="Show the current privileges of a MySQL user">Show the current privileges of a MySQL user </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-create-a-new-mysql-user" rel="bookmark" title="How to create a new MySQL user?">How to create a new MySQL user? </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-delete-mysql-user" rel="bookmark" title="How to delete MySQL user?">How to delete MySQL user? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Show the current user in MySQL</p>
<p><strong>Answer:</strong></p>
<p>Like in the shell, we can execute the command <strong><a href="http://www.linuxask.com/questions/display-current-login-user-information">whoami </a></strong>to find out the current user name, we can use the function <strong>CURRENT_USER()</strong>;</p>
<p>E.g.</p>
<pre><code>mysql&gt; SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/show-the-current-privileges-of-a-mysql-user" rel="bookmark" title="Show the current privileges of a MySQL user">Show the current privileges of a MySQL user </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-create-a-new-mysql-user" rel="bookmark" title="How to create a new MySQL user?">How to create a new MySQL user? </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-delete-mysql-user" rel="bookmark" title="How to delete MySQL user?">How to delete MySQL user? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/show-the-current-user-in-mysql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
