title: How to connect database MySQL in R with Password?
body: <p>My problem is that I am able connect database without using password and also able execute the queries but when I am trying to connect database with password it is giving error. The details I have mentioned below what I am doing and what is the error:</p>
  
  <pre><code>&gt;library(DBI)
  &gt;library(RMySQL)
  &gt;drv&lt;-dbDriver("MySQL")
  &gt;con&lt;-dbConnect(drv,user="sam",password="sam123",dbname="test")
  </code></pre>
  
  <p>then the error is like:</p>
  
  <blockquote>
  <pre><code>Error in mysqlNewConnection(drv, ...) : 
    RS-DBI driver: (Failed to connect to database: 
    Error: Access denied for user 'sam'@'localhost' (using password: YES)
  </code></pre>
  </blockquote>
  
  <p>Please help me out of this problem.</p>