% in mysql root password prevents jsp page to connect

my root password to connect to the mysql database is ab12% and when i ran my jsp page which worked in my windows machine with the password asdb34, on a linux machine with mysql password ab12% its showing urlencoder error and the error pointed to the connection string telling unknow escape sequence %.
can u please help me to recover this problem other than changing the password?
how shld i rewrite my connection string
my current string is
CONNECTIONSTRING=jdbc:mysql://127.0.0.1,:3306/sitedb?user=root&password=ab12%

Try the Oracle JDBC forum - http://forums.oracle.com/forums/forum.jspa?forumID=99&start=0
or Sun's JDBC forum:
http://forum.java.sun.com/index.jspa?tab=java

Similar Messages

  • Trouble resetting forgotten MySQL root password

    Hi there,
    As the title suggests, I've forgotten my MySQL root password (and where I wrote it down) and have done endless searches (Google, MySQL site and forum, etc.), tried the resolutions but have not had any luck in resetting the password.
    I tried the instructions on the MySQL site, but when I did that, I got this:
    I've tried removing and restarting instances, as well as uninstalling MySQL, rebooting and then re-installing; still no success.
    I'm running PHP (5.3.0) and MySQL (5.1.37) on Windows Vista.
    I appreciate any help anyone can offer.
    Thanks,
    Heather

    The simplest way that I know to deal with this situation on Windows is to uninstall MySQL. Doing so should leave the databases intact in the data folder, although you might want to copy the contents of the data folder to a different location first.
    Inside the data folder is another folder called mysql. Delete it, and then reinstall MySQL. You should then be able to set up a new root password.

  • Hidding Password in JSP page

    Hi all,
    I m using the password value in the jsp page as ahidden variable which is thereafter used in the java script. but the problem is that while in view mode of the jsp page if u right click and view the source the password is getting displayed. which should not happen actually. can anybody help me regarding how to hide the password from the public view. i m using the following code for getting the password value.
    <input type="hidden" name="ftpPwd" value='<%=request.getAttribute("ftpPwd") %>' />
    Thanks in Advance
    Nandini

    Yes, I get that. But that's how it works, you can't change that. The best you can do is work with a hash instead of the plaintext password; but that's besides the point.
    What I'm asking is what do you want to achieve? If you explain that then maybe someone can give you a better way to do it.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • 10.3 MYSQL Root Password problem..

    We are running OSX Server 10.3.9 with the built in MYSQL. Somehow the root password for MYSQL that was set is not working and I am locked out with a 1045 error. I need to know how I go about resetting the ROOT password for MYSQL. as I mentioned, I am using the MYSQL that comes with 10.3.9. I have looked online but the tutorials for resetting the passwords do not work on my version...
    Thanks...
    -- Dave Hauss

    I think by default Solaris uses CRYPT_DEFAULT=__unix__ which limits you to 8 characters.
    in order to have more than 8 usable characters in your passwd, then you must use "md5"
    CRYPT_DEFAULT=md5
    this is located in : /etc/security/policy.conf
    I think you may want to change the password length in /etc/default/passwd
    PASSLENGTH= (default=6) change it to something of your liking.
    be sure to do a little more research on the exact steps, but this is what you are loking for. im just going by memory here.

  • Problem resetting mysql root password

    I have install 5.5.20 from mysql from the TAR file. that install was done from an admin user by the name of mysql. Using the mysql user, I have reached a point where I am unable to reset the root password. I have tried both method of resetting the password with no success. Here is what I did. (path omitted for brevity, but used in the commands)
    shell>mysqld_safe --skip-grant-tables
    shell>mysql
    mysql>UPDATE mysql.user SET Password=PASSWORD('newPass')
        -> WHERE User='root';
    mysqlQuery OK, 0 rows affected (0.05 sec)
    Rows matched: 0  Changed: 0  Warnings: 0
    shell> mysqld_safe
    shell> mysql -u root -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    created an init file that had ths
    --------contents of minit-------
    UPDATE mysql.user SET Password=PASSWORD("newPass") WHERE User='root';
    FLUSH PRIVILEGES;
    ------------eof--------------
    mysqld_safe --init-file=minit
    killed mysqld
    mysqld_safe
    mysql -u root -p
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    By the way, I closely monitored the .err file and nothing unusual or pacular showed up there.
    Anyone see what I did wrong? Anyone have other suggestions?

    I have install 5.5.20 from mysql from the TAR file. that install was done from an admin user by the name of mysql. Using the mysql user, I have reached a point where I am unable to reset the root password. I have tried both method of resetting the password with no success. Here is what I did. (path omitted for brevity, but used in the commands)
    shell>mysqld_safe --skip-grant-tables
    shell>mysql
    mysql>UPDATE mysql.user SET Password=PASSWORD('newPass')
        -> WHERE User='root';
    mysqlQuery OK, 0 rows affected (0.05 sec)
    Rows matched: 0  Changed: 0  Warnings: 0
    shell> mysqld_safe
    shell> mysql -u root -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    created an init file that had ths
    --------contents of minit-------
    UPDATE mysql.user SET Password=PASSWORD("newPass") WHERE User='root';
    FLUSH PRIVILEGES;
    ------------eof--------------
    mysqld_safe --init-file=minit
    killed mysqld
    mysqld_safe
    mysql -u root -p
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    By the way, I closely monitored the .err file and nothing unusual or pacular showed up there.
    Anyone see what I did wrong? Anyone have other suggestions?

  • MYSQL Root password

    Hi Guys,
    I'm rather new to all this PHP and MYSQL stuff, so please bear with me. I have downloaded and installed a copy of MYSQL and PHP, and am now trying to change tohe root password, but I keep getting an error message.
    I log in to MYSQL with:
    /usr/local/mysql/bin/mysql
    from there I type:
    UPDATE mysql.user SET Password = PASSWORD('****') WHERE User = 'root';
    but I keep getting an error message of:
    ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user'
    what have I got wrong?

    I've tried to follow the above advice.
    I've completely deleted my MySQl on OS X Server 10.4.7 and reinstalled using the lastest package "mysql-standard-5.0.24a-osx10.4-powerpc.dmg".
    I just cannot get mysql to work properly, to set my root password.
    See my first attempts with Terminal below (No.1)...
    MySQL Adminsitaror and CoCoa SQL connecs with no username or password.
    I've also tried to follow marcs advice at http://www.entropy.ch/software/macosx/mysql/ but to no avail.
    See my second attemps with Terminal below (No.2)...
    If I can crack how to reinstall and setup MySQL on OS X Server 10.4.7 then I'll have a good Disaster Recovery Plan, I hope you can help, thanks.
    No.1
    Last login: Fri Sep 22 17:26:02 on ttyp1
    Welcome to Darwin!
    Server:~ admin$
    Server:~ admin$ sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables -u root &
    [1] 1014
    Server:~ admin$ A mysqld process already exists
    [1]+ Exit 1 sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables -u root
    Server:~ admin$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
    Stopping MySQL database server
    Server:~ admin$ sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables -u root &
    [1] 1066
    Server:~ admin$ Starting mysqld daemon with databases from /usr/local/mysql/data
    Server:~ admin$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    Starting MySQL database server
    Server:~ admin$ /usr/local/mysql/bin/mysql -u root
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (13)
    Server:~ admin$ /usr/local/mysql-standard-5.0.24a-osx10.4-powerpc/bin/mysql -u root
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (13)
    Server:~ admin$
    No.2
    Last login: Fri Sep 22 17:26:12 on ttyp1
    Welcome to Darwin!
    Server:~ admin$ sudo find /usr/local/mysql/data -type f -exec rm {} ';'
    Password:
    Server:~ admin$
    Server:~ admin$ sudo hostname 127.0.0.1
    Server:~ admin$ cd /usr/local/mysql
    Server:/usr/local/mysql admin$ sudo ./scripts/mysqlinstalldb
    Installing all prepared tables
    060922 17:35:30 [Warning] Setting lowercase_tablenames=2 because file system for /usr/local/mysql-standard-5.0.24a-osx10.4-powerpc/data/ is case insensitive
    060922 17:35:30 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=127-bin' to avoid this problem.
    Fill help tables
    060922 17:35:31 [Warning] Setting lowercase_tablenames=2 because file system for /usr/local/mysql-standard-5.0.24a-osx10.4-powerpc/data/ is case insensitive
    060922 17:35:31 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=127-bin' to avoid this problem.
    To start mysqld at boot time you have to copy support-files/mysql.server
    to the right place for your system
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    ./bin/mysqladmin -u root password 'new-password'
    ./bin/mysqladmin -u root -h 127.0.0.1 password 'new-password'
    See the manual for more instructions.
    You can start the MySQL daemon with:
    cd . ; ./bin/mysqld_safe &
    You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
    cd sql-bench ; perl run-all-tests
    Please report any problems with the ./bin/mysqlbug script!
    The latest information about MySQL is available on the web at
    http://www.mysql.com
    Support MySQL by buying support/licenses at http://shop.mysql.com
    Server:/usr/local/mysql admin$ sudo chown -R mysql data/
    Server:/usr/local/mysql admin$ /usr/local/mysql/bin/mysqladmin -u root password operate
    /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (13)'
    Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
    Server:/usr/local/mysql admin$

  • MySql select statement in jsp page

    Ok,
    I need help with this select statement.
    <%
    // Determine what option is set to.
    if(option == null || "".equals(option) || "Verify1".equals(option)){
      if("Verify1".equals(option)){
      // Retrive query specific to submitted form.
      try {
          Class.forName("org.gjt.mm.mysql.Driver").newInstance();
          conn = DriverManager.getConnection("jdbc:mysql://" + mysql_host + ":3306/" + mysql_database, mysql_login, mysql_password);
          st = conn.createStatement();
          rs= st.executeQuery("SELECT organization FROM tblevent_approval WHERE MAX (keyid))";
          // Get query results.
          while(rs.next()){
            organization = rs.getString("organization");
      finally {
            if(rs != null){
              rs.close();
            if(st != null){
              st.close()
            if(conn != null){
              conn.close();
    %>THE ERROR I AM GETTING
    Syntax error, insert ")" to complete Expression

    This line has the closing bracket inside the closing quote for the statement...
    >       rs= st.executeQuery("SELECT organization FROM tblevent_approval WHERE MAX (keyid))";It should be:
    rs= st.executeQuery("SELECT organization FROM tblevent_approval WHERE MAX (keyid)");A simple typo ;-)
    Hope this helps...

  • ExecuteQuery in jsp page.

    Hello,
    i have a problem with executingQuery from Mysql server into a jsp page. what happens exactly is that only one row of the query is executed .
    there must be something missing that prevents displaying the whole query.
    anybody to suuggest a solution.
    thanks.
    Nour

    Hi Nour,
    This forum is for the Web Application Framework and not for JSP you might not get a response for your problem as fast as you expect.
    You can follow this link for jsp in which you will find someone to help you:
    http://forum.java.sun.com/forum.jsp?forum=45

  • Passing input parameters from an applet to a JSP page

    Hello all,
    Yes, its one of these questions which I have tried to find a solution from the already large number of postings but with no luck. I'm still a novice to Java/JSP so bear with me.
    Consider this scenario.
    1. An applet which has two input boxes (say First name and surname). 2. These parameters will be passed to a JSP page (so the applet will call a JSP page).
    3. The JSP will have have the necessary logic (or actually a JavaBean will) to connect to a database and add a new record with these parameters (first name and surname).
    I also need to consider editing/updating the record in the database. So a JSP page will connect to the database, retrieving the required record from the database and then display the parameters back in an applet in two input boxes (first name and surname) to be edited and saved again.
    I have been able to develop a similar application using simple HTML forms to add and update records in a database so I'm not worried about the database connectivity simply the issue of passing parameters from the applet to the JSP page and vice versa (for edit/update).
    Once i've managed to do this with input boxes, I can experiment with the other input types radios, checkboxes, select etc.
    Many thanks in advance,
    Assad

    create an URL object with u'r specified link of the java class and send the parameters..write trhis action in any buttonclick event in u'r applet.

  • JSP initialization and connection to R3 using  a link in JSP

    Hi all,
    I am new to JSP's. I need java scriptlet code for jsp initialization.Also in my jsp page i need to make a link and on clicking, this link should fetch data from the backend R3 system.
    Suggest some help.
    Pooja Gehani

    I think You need to read something about JCO (JavaConnector) - is java based library thanks to it You can make calls to function modules in R3 system (for example fetch data using some function module). When it comes to jsp please check some tutorials in SDN or Google cause it is difficult to explain You jsp technology in few words.
    Below is example of jsp page which connects to R3 System, invoke some function with some parameters, gets return table and save it to file rettab.html.
    Remeber to add sapjco.jar to classpath.
    Please reward points if it was helpful.
    <%@ page import = "com.sap.mw.jco.JCO.*" %>
    <HTML>
    <head>
    </head>
    <body>
    <%
              JCO.Client mConnection;
              mConnection = JCO.createClient("001","koperski","password",null,
                   "127.0.0.1","01");
              JCO.Repository mRepository;
              mRepository = new JCO.Repository("myRep", mConnection);
              try {
                   mConnection.connect();
                   IFunctionTemplate funcTemplate =
                        mRepository.getFunctionTemplate("someFunction");
                   JCO.Function function = funcTemplate.getFunction();
                   ParameterList parameterList = function.getImportParameterList();
                   parameterList.setValue("0010000000082","someParameter");
                                           JCO.Table retTable =
                   function.execute();     function.getTableParameterList().getTable("SomereturnTab");
                   retTable.writeHTML("f:\rettab.html");
                            mConnection.disconnect();
    catch (Exception e) {}
    %>
    </body>
    </HTML>

  • JSP and DB2 Connection

    I tried to use this class in my jsp page to connect to the DB2 database, However, no data from the DB appears on the page and i get no errors whatsoever. Can anyone be kind enough to take a look? Thanks
    package WH;
    import java.sql.*;
    import java.sql.Statement;
    public class DbConnect1 {
    private String dbUser = "XXX";
    private String dbPasswd = "XXX";
    private String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
    private String dbURL = "jdbc:db2:http://xx.xx.xxx.xx:8080/invsys";
    private Connection dbCon;
    public DbConnect1(){}
    public boolean connect() throws ClassNotFoundException,SQLException{
    try
    Class.forName(dbDriver);
    System.out.println("Loaded the instantDB JDBC driver.");
    dbCon = DriverManager.getConnection(dbURL, dbUser, dbPasswd);
    System.out.println("Created and connected to database TimingTest");
    return true;
    catch (Throwable e)
    e.printStackTrace();
    System.out.println("FAIL LAHHHHHHHHHHHH");
    return false;
    public void close() throws SQLException{
    dbCon.close();
    //accepts the SQL query in the form of a string from the JSP file in which this bean is implemented
    public ResultSet execSQL(String sql) throws SQLException{
    System.out.println("haha");
    //initiates the connection with the dbCon connection object
    Statement s = dbCon.createStatement();
    ResultSet r = s.executeQuery(sql);
    return (r == null) ? null : r;
    public int updateSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    int r = s.executeUpdate(sql);
    return (r == 0) ? 0 : r;

    Here is a copy of my JSP file.
    <%@ page language='java' %>
    <%@ page import="java.sql.*" %>
    <jsp:useBean id="DbConnectBean1" scope="page" class="WH.DbConnect1" />
    <%
         //Get status
         /*String message;
         String status = request.getParameter("status").trim();
         if (status == "duplicateEmail")
         message="Please try again. An account with the same emaill address has already been created.";
         else if (status == "deleteOk")
         message="Delete successful.";
         else
              message="";*/
    //Get Contacts
         String name;
         String email;
         String extNo;
         String phoneNo;
         String remarks;
         String SQLstmt;
         SQLstmt = "Select * from CONTACT";
    if (DbConnectBean1.connect()==true){
    %>
    <html>
    <head>
    <title>Display Contacts</title>
    <script src="validation.js" language="Javascript"></script>
    <script Language="JavaScript">
    //Perform Validation
    /* function checkForm() {
    var alertString=checkChkBox(theForm.chkItem.value);
         formSubmit(alertString);
    </script>
    </head>
    <body bgcolor="#ffffff">
    <form action="USRDelContact.jsp" name="theForm" onsubmit="return checkForm();">
    </form>
    <table>
    <tr>
    <td><input type="chkAll" id="chkAll"onclick="checkAll(document.theForm.chkItem)"/></td>
    <td>Name</td>
    <td>Extension No.</td>
    <td>Mobile Phone No.</td>
    <td>Email Address</td>
    <td>Remarks</td>
    <td> </td>
    </tr>
    <%
         ResultSet r = DbConnectBean1.execSQL(SQLstmt);
         while (r.next()){
    %>
    <tr>
    <td><input type="checkbox" name="chkItem" id="chkItem" value="<%= r.getString("Email")%>"/></td>
    <td><%= r.getString("Emp_Name")%></td>
    <td><%= r.getString("Ext_No")%></td>
    <td><%= r.getString("Cellphone")%></td>
    <td><a href="mailto:<%= r.getString(Email")%">"><%= r.getString("Email")%></a></td>
    <td><%= r.getString("Remarks")%></td>
    <td><a href="USREditContact.jsp?email=<%= r.getString("Email")%>">Edit</a></td>
    </tr>
    <%
    if (r.next()==false)
    %>
    <tr>
    <td colspan="7">There are no records currently.</td>
    </tr>
    <% }
    }//end if%>
    <tr colspan="6">
    <td>
    <%//=message%> <input type="submit" name="btnDelete" value="Delete">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    </a>

  • Sending colour from a JSP page into a MySQL database field

    Dear All,
    I am working on trying to send different colours into a MySQL database field from a JSP page.
    This is so that I can represent different pieces of data on my webpage tables in different colours providing status depending on the user request.
    What is the best way to write JSP code for this?
    thanks,
    Alasdair

    Double-posted:
    http://forum.java.sun.com/thread.jspa?threadID=598637

  • How to establish a MYSQL Database connection in JSP page.

    Hi People,
    Tell me how to establish mysql database connection in JSP page.
    Needed details on:
    1) what are all the mysql drivers need to be included.
    2) what is the syntax for establish a database connection

    hi,
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.htmlsee down for mysql config with tomcat

  • How to do transactions in jsp pages using Java & MySQL ?

    Hi,
    I'm a newbie..
    I'd like to know "How to do transactions in jsp pages using Java & MySQL ?"
    Platform: Windows XP, Apache Tomcat 5.5, MySQL 5, Java bean without EJB
    what are the the different types of transactions? Differences between them?Pls provide examples?
    Which among them is the best method to implement a transaction?
    Pls help me...
    thnx in advance...

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

  • Preventing local admin from changing root password

    Is it possible to prevent a local admin from changing the root password? I would like to set up a computer so that the user has admin rights, but cannot change the root password via a terminal shell to gain root access.

    I can't provide you with details, but I'm sure that all you need to do is to edit the sudoers file. It needs to be edited with <visudo> when logged in as root in a Terminal. The location is </private/etc/sudoers>, but you don't need to know that when using <visudo>. From a first look I'd suppose you only have to uncomment the %admin line, but better get some more information. I never did this myself.

Maybe you are looking for