title: Can not connect with mysql database in jsp
body: <p>i am trying to connect with mysql database after run the web app there is an error like:
  HTTP Status 500 - Internal Server Error
  type Exception report
  message Internal Server Error
  description The server encountered an internal error that prevented it from fulfilling this request.
  exception
  javax.servlet.ServletException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'mysqluser=root'</p>
  
  <p>root cause</p>
  
  <p>com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'mysqluser=root'</p>
  
  <p>note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.
  GlassFish Server Open Source Edition 4.0</p>
  
  <p>My JSP code is:</p>
  
  <pre><code>`&lt;%@ page import ="java.sql.*" %&gt;
  </code></pre>
  
  <p><code>&lt;%<br>
  </code>String fname = request.getParameter("fname");</p>
  
  <pre><code>`String lname = request.getParameter("lname");
  `String email = request.getParameter("email");
  `String user = request.getParameter("uname"); 
  `String pwd = request.getParameter("pass");
  </code></pre>
  
  <p><code>Class.forName("com.mysql.jdbc.Driver");
  </code>Connection con = <code>DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql"+ "user=root");
  </code>Statement st = con.createStatement();</p>
  
  <pre><code>`int i = st.executeUpdate("insert into members(first_name, last_name,email, uname, pass) values ('" + fname + "','" + lname + "','" + email + "','" + user + "','" + pwd + "')");
  `if (i &gt; 0)
  `{
   `out.print("Registration Successfull!"+"&lt;ahref='index.jsp'&gt;Go to Login&lt;/a&gt;");
  `} 
  `else {
      `response.sendRedirect("index.jsp");
  </code></pre>
  
  <p><code>}
  </code>%>
  `</p>
  
  <p>My database does not have any password.
  I was establish my connectivity in netbeans by following steps:
  Step 1: Service tab
  Step 2: Right click on Databases and select New Connection...
  Step 3: Follow the steps. 
  Test connection was successfully then finish.
  I am using linux Fedora 20 OS </p>