<?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>Password &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/password/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 25 Apr 2018 18:28:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Script to find Database USER LOGIN Information</title>
		<link>https://www.dbrnd.com/2018/01/sql-server-script-to-find-database-user-login-information-password-expiration-authentication-security/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 27 Jan 2018 16:16:44 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[login expiration]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4047</guid>

					<description><![CDATA[In this post, I am sharing one T-SQL Script to find SQL Server USER LOGIN Information. As a DBA, we should check the USER LOGIN Information to make sure about the user expiration, password expiration. Using password expiration information, you can also notify the user before its password expires. [crayon-6a91b47f2b6f0480319206/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F01%2Fsql-server-script-to-find-database-user-login-information-password-expiration-authentication-security%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20Database%20USER%20LOGIN%20Information" data-a2a-url="https://www.dbrnd.com/2018/01/sql-server-script-to-find-database-user-login-information-password-expiration-authentication-security/" data-a2a-title="SQL Server: Script to find Database USER LOGIN Information"></a></p><p>In this post, I am sharing one T-SQL Script to find SQL Server USER LOGIN Information. </p>
<blockquote><p>As a DBA, we should check the USER LOGIN Information to make sure about the user expiration, password expiration.<br />
Using password expiration information, you can also notify the user before its password expires. </p></blockquote>
<pre class="crayon-plain-tag">SELECT 
	SL.name AS LoginName 
	,LOGINPROPERTY (SL.name, 'PasswordLastSetTime') AS PasswordLastSetTime 
	,LOGINPROPERTY (SL.name, 'DaysUntilExpiration') AS DaysUntilExpiration 
	,DATEADD(dd, CONVERT(int, LOGINPROPERTY (SL.name, 'DaysUntilExpiration')) 
				, CONVERT(datetime, LOGINPROPERTY (SL.name, 'PasswordLastSetTime'))) AS PasswordExpiration 
	,SL.is_policy_checked AS IsPolicyChecked 
	,LOGINPROPERTY (SL.name, 'IsExpired') AS IsExpired 
	,LOGINPROPERTY (SL.name, 'IsMustChange') AS IsMustChange 
	,LOGINPROPERTY (SL.name, 'IsLocked') AS IsLocked 
	,LOGINPROPERTY (SL.name, 'LockoutTime') AS LockoutTime 
	,LOGINPROPERTY (SL.name, 'BadPasswordCount') AS BadPasswordCount 
	,LOGINPROPERTY (SL.name, 'BadPasswordTime') AS BadPasswordTime 
	,LOGINPROPERTY (SL.name, 'HistoryLength') AS HistoryLength 
FROM sys.sql_logins AS SL 
WHERE is_expiration_checked = 1 
ORDER BY LOGINPROPERTY (SL.name, 'PasswordLastSetTime') DESC</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: How to change the default name of root User?</title>
		<link>https://www.dbrnd.com/2017/07/mysql-how-to-change-the-default-name-of-root-user/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 25 Jul 2017 16:16:09 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[root]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5693</guid>

					<description><![CDATA[When you install the MySQL, the root user is a default, and even most of the people also set the password &#8216;root&#8217;. For MySQL, username and password like root-root is a very common so hackers can easily try this combination and can attack in your database system. After the installation of MySQL Server, please don&#8217;t [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-change-the-default-name-of-root-user%2F&#038;title=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" data-a2a-url="https://www.dbrnd.com/2017/07/mysql-how-to-change-the-default-name-of-root-user/" data-a2a-title="MySQL: How to change the default name of root User?"></a></p><p>When you install the MySQL, the root user is a default, and even most of the people also set the password &#8216;root&#8217;. </p>
<p>For MySQL, username and password like root-root is a very common so hackers can easily try this combination and can attack in your database system. </p>
<p>After the installation of MySQL Server, please don&#8217;t forget to rename the name of the root user.<br />
In this post, I am sharing required steps for changing the name of the root user.</p>
<p><strong>Connect MySQL and check the list of users:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| debian-sys-maint | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+</pre> </p>
<p><strong>Rename the &#8216;root&#8217; user to &#8216;anvesh&#8217;:</strong></p>
<pre class="crayon-plain-tag">rename user 'root'@'localhost' to 'anvesh'@'localhost';</pre> </p>
<p><strong>Confirm the new user name:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| anvesh           | localhost |
| debian-sys-maint | localhost |
| mysql.sys        | localhost |
+------------------+-----------+</pre> </p>
<p><strong>Now, flush the privileges to make these changes happen:</strong></p>
<pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre> </p>
<p><strong>Now, connect with new user name:</strong></p>
<pre class="crayon-plain-tag">mysql -u anvesh -p</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: MEDIAPASSWORD &#8211; password to your Database Backup file</title>
		<link>https://www.dbrnd.com/2017/03/sql-server-mediapassword-password-to-your-database-backup-file-secure-file/</link>
					<comments>https://www.dbrnd.com/2017/03/sql-server-mediapassword-password-to-your-database-backup-file-secure-file/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 22 Mar 2017 16:16:07 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MEDIAPASSWORD]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Protect Database Backup]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4798</guid>

					<description><![CDATA[In this post, I am showing MEDIAPASSWORD option to set a password to your database backup file in SQL Server. We should not take a risk with our backup media file, especially when we are taking backup of sensitive data like the banking system. You can set a password using MEDIAPASSWORD option while taking a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&amp;linkname=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F03%2Fsql-server-mediapassword-password-to-your-database-backup-file-secure-file%2F&#038;title=SQL%20Server%3A%20MEDIAPASSWORD%20%E2%80%93%20password%20to%20your%20Database%20Backup%20file" data-a2a-url="https://www.dbrnd.com/2017/03/sql-server-mediapassword-password-to-your-database-backup-file-secure-file/" data-a2a-title="SQL Server: MEDIAPASSWORD – password to your Database Backup file"></a></p><p>In this post, I am showing MEDIAPASSWORD option to set a password to your database backup file in SQL Server.<br />
We should not take a risk with our backup media file, especially when we are taking backup of sensitive data like the banking system.</p>
<p>You can set a password using MEDIAPASSWORD option while taking a backup, and you cannot restore that backup file without specifying a password.</p>
<blockquote><p>You can set MEDIAPASSWORD in plain text, so again you have to take care of your backup/restore scripts. So again you have to take care of your backup/restore scripts.</p></blockquote>
<p><img fetchpriority="high" decoding="async" class="alignright wp-image-4801 size-full" title="SQL Server Database Backup Password" src="https://www.dbrnd.com/wp-content/uploads/2017/03/SQLServerDatabaseBackupPassword.jpg" alt="SQL Server Database Backup Password" width="448" height="273" srcset="https://www.dbrnd.com/wp-content/uploads/2017/03/SQLServerDatabaseBackupPassword.jpg 448w, https://www.dbrnd.com/wp-content/uploads/2017/03/SQLServerDatabaseBackupPassword-300x183.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2017/03/SQLServerDatabaseBackupPassword-150x91.jpg 150w" sizes="(max-width: 448px) 100vw, 448px" /></p>
<p>Once you set a password, it applies to all types of restore option like RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, RESTORE VERIFYONLY, and you must require a password for all these options.</p>
<p><em>Beginning with SQL Server 2012 the PASSWORD and MEDIAPASSWORD options are discontinued for creating backups. It is still possible to restore backups created with passwords.</em></p>
<p>Let me demonstrate this,</p>
<p><strong>T-SQL Script to take a backup with MEDIAPASSWORD:</strong><br />
I set password &#8216;dbrnd.com&#8217; for my dbrnd database backup.<br />
<pre class="crayon-plain-tag">BACKUP DATABASE dbrnd
TO DISK = 'C:\MyBackups\dbrnd.bak'
WITH COMPRESSION,
MEDIAPASSWORD='dbrnd.com'
GO</pre>
<strong>Try to restore this backup without giving a password:</strong><br />
<pre class="crayon-plain-tag">RESTORE DATABASE dbrnd
FROM DISK = 'C:\MyBackups\dbrnd.bak'
GO</pre>
<strong>You can get a below error:</strong><br />
<pre class="crayon-plain-tag">Msg 3279, Level 16, State 6, Line 1
Access is denied due to a password failure
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.</pre>
<strong>Try to restore with RESTORE HEADERONLY Command:</strong><br />
<pre class="crayon-plain-tag">RESTORE HEADERONLY
FROM DISK = 'C:\MyBackups\dbrnd.bak'</pre>
<strong>You can get a below error:</strong><br />
<pre class="crayon-plain-tag">Msg 3279, Level 16, State 6, Line 1
Access is denied due to a password failure
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.</pre>
<strong>T-SQL Script to restore with password:</strong><br />
<pre class="crayon-plain-tag">RESTORE DATABASE dbrnd
FROM DISK = 'C:\MyBackups\dbrnd.bak'
MEDIAPASSWORD = 'dbrnd.com',
RECOVERY
GO</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/03/sql-server-mediapassword-password-to-your-database-backup-file-secure-file/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL psql FATAL: error Peer authentication failed for user</title>
		<link>https://www.dbrnd.com/2017/01/postgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file/</link>
					<comments>https://www.dbrnd.com/2017/01/postgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 16 Jan 2017 20:29:04 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[peer]]></category>
		<category><![CDATA[peer authentication]]></category>
		<category><![CDATA[pg_hba.conf]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[psql]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4329</guid>

					<description><![CDATA[Recently, I have installed PostgreSQL 9.6 in Ubuntu 16.4. You can access the previous article and can find full detail installation steps. I was testing execution for one of my shell scripts. I have tried to connect PostgreSQL database and got this error. &#8221; psql FATAL: error Peer authentication failed for user &#8221; During at [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fpostgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file%2F&#038;title=PostgreSQL%20psql%20FATAL%3A%20error%20Peer%20authentication%20failed%20for%20user" data-a2a-url="https://www.dbrnd.com/2017/01/postgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file/" data-a2a-title="PostgreSQL psql FATAL: error Peer authentication failed for user"></a></p><p>Recently, I have installed PostgreSQL 9.6 in Ubuntu 16.4.<br />
You can access the previous article and can find full detail installation steps.</p>
<p>I was testing execution for one of my shell scripts. I have tried to connect PostgreSQL database and got this error. &#8221; psql FATAL: error Peer authentication failed for user &#8221; </p>
<p>During at database call, I was supplying the username and password. I check pg_hba.conf file and replace peer with a password.</p>
<p><strong>In pg_hba.conf, change this line from value peer to password:</strong></p>
<pre class="crayon-plain-tag">local   all             all                        peer

to:

local   all             all                        password</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/01/postgresql-psql-fatal-error-peer-authentication-failed-for-user-pg_hba-conf-file/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: pg_ident.conf to map Operating System Username and Database Username</title>
		<link>https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password/</link>
					<comments>https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 08 Dec 2016 18:19:29 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[pg_hba.conf]]></category>
		<category><![CDATA[pg_ident.conf]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4013</guid>

					<description><![CDATA[If you do not know about the role of pg_hba.conf file, visit the below link. PostgreSQL: How to Allow Remote Connection to Connect Database PostgreSQL also has a one more file related user access permission and that is pg_ident.conf. PostgreSQL provides Ident-based authentication and It works by obtaining the client&#8217;s operating system user name and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&amp;linkname=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F12%2Fpostgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password%2F&#038;title=PostgreSQL%3A%20pg_ident.conf%20to%20map%20Operating%20System%20Username%20and%20Database%20Username" data-a2a-url="https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password/" data-a2a-title="PostgreSQL: pg_ident.conf to map Operating System Username and Database Username"></a></p><p>If you do not know about the role of pg_hba.conf file, visit the below link.</p>
<blockquote class="wp-embedded-content" data-secret="JrH3IqJXlV"><p><a href="https://www.dbrnd.com/2016/01/postgresql-how-to-allow-remote-connection-to-connect-database/">PostgreSQL: How to Allow Remote Connection to Connect Database</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/postgresql-how-to-allow-remote-connection-to-connect-database/embed/#?secret=JrH3IqJXlV" data-secret="JrH3IqJXlV" width="600" height="338" title="&#8220;PostgreSQL: How to Allow Remote Connection to Connect Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>PostgreSQL also has a one more file related user access permission and that is pg_ident.conf.<br />
PostgreSQL provides Ident-based authentication and It works by obtaining the client&#8217;s operating system user name and using it as the allowed database user name with an optional user name mapping.</p></blockquote>
<blockquote><p>When we are using an external authentication system, system username might not be the same as database username. </p></blockquote>
<blockquote><p>To allow external authentication, We should map the system username with database username and we can also set a map name to hide the system username and database username related detail.</p></blockquote>
<p>For example, </p>
<p><strong>Go to the PostgreSQL data directory and Open pg_ident.conf file.</strong><br />
<strong>You can find below lines:</strong></p>
<pre class="crayon-plain-tag"># Put your actual configuration here
# ----------------------------------
# MAPNAME       SYSTEM-USERNAME         PG-USERNAME</pre> </p>
<p><strong>You can add value to map system username and database username:</strong></p>
<pre class="crayon-plain-tag"># Put your actual configuration here
# ----------------------------------
# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
User123         LinuxUser               PGUser</pre> </p>
<blockquote><p>Once you map your system user and database user in pg_ident.conf file, you can use map name in pg_hba.conf file to allow external authentication.</p></blockquote>
<p><strong>Go to your PostgreSQL data directory and open a pg_hba.conf file.</strong></p>
<p>You can add the map name of system user and database user in METHOD column.<br />
For Example, </p>
<pre class="crayon-plain-tag"># TYPE  DATABASE        USER            ADDRESS                 METHOD
host    all             all             120.172.0.0/16          ident map=User123</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL: How to change the Database User Password in Linux</title>
		<link>https://www.dbrnd.com/2016/08/postgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 08 Aug 2016 05:38:14 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1879</guid>

					<description><![CDATA[In this post, I am sharing basic commands to change the PostgreSQL database user password in Linux. I would like to share this kind commands and scripts because this is very common and day to day exercise for a Database Administrator. In the PostgreSQL, we have also one pg_hba.conf file. pg_hba.conf is a configuration file [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&amp;linkname=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file%2F&#038;title=PostgreSQL%3A%20How%20to%20change%20the%20Database%20User%20Password%20in%20Linux" data-a2a-url="https://www.dbrnd.com/2016/08/postgresql-how-to-change-the-database-user-password-in-linux-pg_hba-conf-file/" data-a2a-title="PostgreSQL: How to change the Database User Password in Linux"></a></p><p>In this post, I am sharing basic commands to change the PostgreSQL database user password in Linux. </p>
<p>I would like to share this kind commands and scripts because this is very common and day to day exercise for a Database Administrator. </p>
<blockquote><p>In the PostgreSQL, we have also one pg_hba.conf file.<br />
pg_hba.conf is a configuration file which is controlled Client Authentication.<br />
This file automatically installed when the data directory is initialized.</p></blockquote>
<p>If you want to login without password, you can put &#8220;peer&#8221; or &#8220;trust&#8221; instead of md5 in this file.<br />
like,</p>
<pre class="crayon-plain-tag">local      all     postgres     peer</pre> </p>
<p><strong>But for the security purpose, we should put md5.</strong></p>
<p><strong>Change database password using ALTER:</strong></p>
<p><strong>First login:</strong></p>
<pre class="crayon-plain-tag">sudo -u user_name psql database_name</pre> </p>
<p><strong>ALTER Command:</strong></p>
<pre class="crayon-plain-tag">ALTER USER user_name WITH PASSWORD 'MyNew_Password';</pre> </p>
<p><strong>Change database password using \password:</strong></p>
<p><strong>First login:</strong></p>
<pre class="crayon-plain-tag">root=# sudo -u user_name psql database_name</pre> </p>
<p><strong>Using \password:</strong></p>
<pre class="crayon-plain-tag">root=# \password user_name

Enter new password: ***
Enter it again: ***</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: Why psql is running without Password?</title>
		<link>https://www.dbrnd.com/2016/08/postgresql-why-psql-is-running-without-password/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 06 Aug 2016 05:38:57 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[pgpass.conf]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[psql]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1654</guid>

					<description><![CDATA[I have configured one of my PostgreSQL Test Server in windows operating system. I just open psql command line tool and it opened without asking a any password. I just surprised, when I logged in psql without any password. This should not happen in any situation. I was finding a solution of this problem and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&amp;linkname=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F08%2Fpostgresql-why-psql-is-running-without-password%2F&#038;title=PostgreSQL%3A%20Why%20psql%20is%20running%20without%20Password%3F" data-a2a-url="https://www.dbrnd.com/2016/08/postgresql-why-psql-is-running-without-password/" data-a2a-title="PostgreSQL: Why psql is running without Password?"></a></p><p>I have configured one of my PostgreSQL Test Server in windows operating system. </p>
<p>I just open psql command line tool and it opened without asking a any password. </p>
<blockquote><p>
I just surprised, when I logged in psql without any password. This should not happen in any situation. </p></blockquote>
<p><strong>I was finding a solution of this problem and came to know about pgpass.conf file for Windows OS and .pgpass file for Unix OS. </strong></p>
<p>This file exists on client location and contain information about login authentication. </p>
<p>For windows, you can find this file here:<strong> %APPDATA%\postgresql\pgpass.conf </strong><br />
<strong><br />
The format of this file:</strong></p>
<pre class="crayon-plain-tag">hostname:port:database:username:password</pre> </p>
<p>I have opened this file in windows and found that password written in plain text.<br />
Whenever I open psql, it takes default postgres user password from this file.</p>
<p><strong>I just removed this plain text password from pgpass.conf file and now psql prompts to enter a specific password for login.</strong></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Password Encryption using the Advanced Encryption Standard Algorithm (AES_ENCRYPT())</title>
		<link>https://www.dbrnd.com/2016/07/mysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 26 Jul 2016 19:51:25 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[AES_DECRYPT]]></category>
		<category><![CDATA[AES_ENCRYPT]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[password encryption]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1774</guid>

					<description><![CDATA[This is going to be one of most important article for the MySQL community because I am going to share, what should be our best practice to store encrypted passwords into MySQL Database Server. The MySQL provides different algorithm and function to encrypt and decrypt password data or any other sensitive information so that no [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&#038;title=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" data-a2a-url="https://www.dbrnd.com/2016/07/mysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt/" data-a2a-title="MySQL: Password Encryption using the Advanced Encryption Standard Algorithm (AES_ENCRYPT())"></a></p><p>This is going to be one of most important article for the MySQL community because I am going to share, what should be our best practice to store encrypted passwords into MySQL Database Server.</p>
<p>The MySQL provides different algorithm and function to encrypt and decrypt password data or any other sensitive information so that no one can access it in plain text format. </p>
<p><a href="https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_aes-decrypt" target="_blank"><strong>For different Encryption and Compression functions you can visit this MySQL Developer official site. </strong></a></p>
<blockquote><p><strong>Generally, people are using MD5 and SHA algorithm  for password encryption, but both are easy to break and vulnerable, so we should not use this in our general practice. </strong></p></blockquote>
<blockquote><p>
<strong>We should also not use PASSWORD() function because it is used by the authentication system in MySQL Server. </strong></p></blockquote>
<p><code><strong>Advanced Encryption Standard Algorithm (AES): </strong></code></p>
<p>This is one of the important encryption algorithm and it is highly secure because it encrypts the string using the encryption key string and returns an encrypted binary string output. </p>
<p>MySQL provides AES_ENCRYPT() to encrypt the string in binary format and AES_DECRYPT() to decrypt the string in plain text. </p>
<blockquote><p>The only one problem is, we should hide the key value for security purpose by setting object level permission or we can create a view to hide the encryption key value. </p></blockquote>
<p>You can create BINARY or BLOB data type to store AES encrypted password. </p>
<p><strong>Below is a small demonstration on this:</strong></p>
<p><strong>The syntax:</strong></p>
<pre class="crayon-plain-tag">AES_ENCRYPT(str,key_str)
AES_DECRYPT(crypt_str,key_str)</pre> </p>
<p><strong>First, create a table with sample data:</strong></p>
<p> </p><pre class="crayon-plain-tag">CREATE TABLE tbl_AESPassword
(
    ID INTEGER
    ,UserPassword BLOB
);

INSERT INTO tbl_AESPassword 
VALUES 
(1,AES_ENCRYPT('Anvesh','8'))
,(2,AES_ENCRYPT('Patel','88'));</pre><p> </p>
<p><strong>SELECT first row by comparing password using defined encryption key:</strong></p>
<pre class="crayon-plain-tag">SELECT *	
FROM tbl_AESPassword
WHERE UserPassword = AES_ENCRYPT('Anvesh','8')

-- Result: Returned only first record. 
ID      |  UserPassword
---------------------------
1       | BLOB</pre> </p>
<p><strong>To DECRYPT the password into plain text:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; SELECT AES_DECRYPT(AES_ENCRYPT('Anvesh','8'),'8');

+--------------------------------------------+
| AES_DECRYPT(AES_ENCRYPT('Anvesh','8'),'8') |
+--------------------------------------------+
| Anvesh                                     |
+--------------------------------------------+
1 row in set (0.00 sec)</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>NoSQL: &#8220;org.apache.cassandra.auth.CassandraRoleManager doesn&#8217;t support PASSWORD&#8221;</title>
		<link>https://www.dbrnd.com/2016/05/nosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password/</link>
					<comments>https://www.dbrnd.com/2016/05/nosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 07 May 2016 06:54:48 +0000</pubDate>
				<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Column Store]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[Graph Store]]></category>
		<category><![CDATA[Key Value Store]]></category>
		<category><![CDATA[Not Only SQL]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Unstrucutred]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2731</guid>

					<description><![CDATA[Last week, I was creating my first database User and Role, but I got the below error in Cassandra &#8211; InvalidRequest: code=2200 [Invalid query] message=&#8221;org.apache.cassandra.auth.CassandraRoleManager doesn&#8217;t support PASSWORD&#8221;. For me, this is very important to resolve this problem because the application requires different database users for each process. I tried many options to solve this [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&amp;linkname=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F05%2Fnosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password%2F&#038;title=NoSQL%3A%20%E2%80%9Corg.apache.cassandra.auth.CassandraRoleManager%20doesn%E2%80%99t%20support%20PASSWORD%E2%80%9D" data-a2a-url="https://www.dbrnd.com/2016/05/nosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password/" data-a2a-title="NoSQL: “org.apache.cassandra.auth.CassandraRoleManager doesn’t support PASSWORD”"></a></p><p><strong>Last week, I was creating my first database User and Role, but I got the below error in Cassandra &#8211; InvalidRequest: code=2200 [Invalid query] message=&#8221;org.apache.cassandra.auth.CassandraRoleManager doesn&#8217;t support PASSWORD&#8221;.</strong></p>
<p>For me, this is very important to resolve this problem because the application requires different database users for each process.  </p>
<p>I tried many options to solve this error and I have found that cassandra.yaml file require to edit.<br />
It has an authenticator parameter which has by default allow all types of authentication. </p>
<p>You can find this parameter and can change as mentioned below steps. </p>
<p><strong>Old value:</strong></p>
<pre class="crayon-plain-tag">authenticator: AllowAllAuthenticator</pre> </p>
<p><strong>Change with this new value:</strong></p>
<pre class="crayon-plain-tag">authenticator: PasswordAuthenticator</pre> </p>
<p><strong>Restart your Cassandra service:</strong></p>
<pre class="crayon-plain-tag">$ sudo service cassandra restart</pre> </p>
<p><strong>Login with default admin Cassandra user:</strong></p>
<pre class="crayon-plain-tag">$ cqlsh -u cassandra -p cassandra</pre> </p>
<p>Additionally, you can also check role manager parameter is exists or not. If below mention parameter does not exist in cassandra.yaml, you can add it. </p>
<pre class="crayon-plain-tag">role_manager: CassandraRoleManager</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/05/nosql-org-apache-cassandra-auth-cassandrarolemanager-doesnt-support-password/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to reset MySQL root Password in Ubuntu</title>
		<link>https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/</link>
					<comments>https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 11 Aug 2015 17:15:29 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[mysqld_safe]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=344</guid>

					<description><![CDATA[Hello Friends, Recently, I got a request for resetting the MySQL root password. One of my colleges tried many solutions from different blog and website, but he failed and the question came to me. As I am always ready for new research and problem solving, so I started my work to reset the MySQL root [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&amp;linkname=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Freset-mysql-root-password-ubuntu%2F&#038;title=How%20to%20reset%20MySQL%20root%20Password%20in%20Ubuntu" data-a2a-url="https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/" data-a2a-title="How to reset MySQL root Password in Ubuntu"></a></p><p>Hello Friends,</p>
<p>Recently, I got a request for resetting the MySQL root password. </p>
<p>One of my colleges tried many solutions from different blog and website, but he failed and the question came to me.</p>
<p>As I am always ready for new research and problem solving, so I started my work to reset the MySQL root password.</p>
<p>On the internet, you can find many similar solutions and I have also tired from these solutions, but I was failed to reset root/admin password.</p>
<p>After some exercise, I got success on this.</p>
<p><strong>Below are the final steps:</strong></p>
<p><strong>Step 1:</strong><br />
Stop MySQL Service.</p><pre class="crayon-plain-tag">sudo stop mysql</pre><p>
<p><strong>Step 2:</strong><br />
Kill all running mysqld.</p><pre class="crayon-plain-tag">sudo killall -9 mysqld</pre><p>
<p><strong>Step 3:</strong><br />
Starting mysqld in Safe mode.</p><pre class="crayon-plain-tag">sudo mysqld_safe --skip-grant-tables --skip-networking &amp;</pre><p>
<p><strong>Step 4:</strong><br />
Start mysql client</p><pre class="crayon-plain-tag">mysql -u root</pre><p>
<p><strong>Step 5:</strong><br />
After successful login, please execute this command to change any password.<br />
<a href="https://www.dbrnd.com/2015/05/mysql-flush-command/" target="_blank">Here you can visit more about MySQL Flush Command:</a></p>
<pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre>
<p><strong>Step 6:</strong><br />
You can update mysql root password .<br />
<pre class="crayon-plain-tag">UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';</pre>
<p><strong>Step 7:</strong><br />
Please execute this command.<br />
<pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
