Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL Changing root Password

Have Programming Question? Ask it here!
 
 
 


Victor Ajakpo
Changing root Password
1 Answer(s)      2 years and 6 months ago
Posted in : SQL


how do i change the root password in mysql


Advertisement
View Answers

February 10, 2012 at 4:03 PM


import java.sql.*;
class ChangeRootPassword
{
    public static void main(String[] args) 
    {
        try{
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
            String sql = "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('admin')";
            Statement stmt = conn.createStatement();
            stmt.executeQuery(sql);
            stmt.close();
            conn.close();
            }
        catch(Exception ex){
            ex.printStackTrace();
            }
    }
}


Related Tutorials/Questions & Answers:
Changing root Password
Changing root Password  how do i change the root password in mysql
Change root password of MYSQL using Java
of Code: Changing the root password of a MySQL database is trivial if you know...Change root password of MYSQL using Java In this tutorial, you will learn how to change the root password of MYSQL database using java code. For every
Advertisements
MySQL Creating account and changing password
MySQL Creating account and changing password   ...; root@database:~# /opt/sfw/bin/mysql -p Enter password: ROOT-PASSWORD... or  you want to change the password then make new user .This lesson you learn how
Password
Password  make a program which ask ask the username and password * in this format. in C language
Cube Root
Cube Root  Hi, Can one one please tell me how to find the cube root of any number without using any inbuilt function?? Regards: Akash
Square Root
Square Root  Hi, can any one please tell me the code to findout the square root of a given number with using built in function??? Thanks a lot in advance!! Regards: Akash
changing of data...
changing of data...  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but once... is not changing in 10 second...what should i do..?? reply fast
changing of data...
servlet.database is not changing in 10 second  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have... this servlet.database is not changing in 10 second...what should i do..?? reply fast
changing of data...
data changing in 10 second  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but... is not changing in 10 second...what should i do..?? reply fast
XML root element
XML root element  Hi..... please tell me about that Can a root element type be explicitly declared in the DTD? Thanks
Add a root element
Add a root element  i have one doubt, This is my current xml doc. â?¦ But I want add a tag at first and last line of a xml by using JDOM(SAX Builder). Like â
changing uiview background color
changing uiview background color  changing UIView background color in ios   self.view.backgroundColor = [UIColor colorWithRed:244.0f/255.0f green:230.0f/255.0f blue:183.0f/255.0f alpha:1.0f
Password validation
password and confirm password are same or not Validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Tree Root Hide in Java
Tree Root Hide in Java       In this section, you will learn to hide the root node of  a JTree.  Description of the Program: The following program helps to hide the root
forgot password?
forgot password?  forgot password
Java Square Root And Cube Root Example
Java Square Root And Cube Root Example In this section we will discuss about how to find the square root and cube root of a number. This example explains you about finding the square root and cube root of a number. This tutorial
Changing pictures - Java Beginners
Changing pictures  I found some html code that allows pictures to be changed on a web page. I copied the code and saved it as an html file. when I... Explorer that have pictures changing on them and they do not get blocked? 
Changing MySQL Port Number
Changing MySQL Port Number  How to change the MySQL port no in windows.   Hi, Open the my.ini file present in the MySQL server installation directory. Change the port number to desired port number. By default port
Username password
with the validation, so that if the username and password match it will continue... that checks whether the username and password is valid or not. If the user...("Password:"); text2 = new JPasswordField(15); SUBMIT=new JButton("SUBMIT
compute nth root - Java Beginners
compute nth root  write a program that computes the nth root of a number. given a real number X greater than 1 and less than -1 and given an integer Y, compute the nth root Z such that Z*Z*Z*Z*Z*Z*Z...(Y times)..Z*Z=X, or Z^y=X
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
changing the file content
changing the file content  I have requirement like this, a file contain maximum 1000 lines. I want to cahnage the 501 line content. I know this logic , reading the file content and changeing the 501 line content and crating one
changing selection color of <button>
changing selection color of   dear all, i have loaded image in border less button tag when button is selected with tab key i get brown color rectangle around image. how do i change color of that rectangle from brown to white
password check
password check  how to check sighup passowrd and login password
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
retype password
retype password  coding for retype password
Reset Password
Reset Password  coding for reset password
forget password
forget password  codding for forget password using spring framework
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
3D PASSWORD
3D PASSWORD  HI i would like to know abt where the 3d password in india used and also few info about the 3d password pls rply some1 as soon as possible
password change
password change  Hi , I am using jsf and trying to write a code to change the password of a user . Ihave to retrine userid fromdata base how to do that using session
Forgot password
Forgot password  hi i want to develop a code for when user clicks on forgot password then the next page should be enter his mobile no then the password must be sent to his mobile no...! Thanks in advance Nag Raj
change password - JSP-Servlet
for a user. this web page consists of changing the password for the existing user. it look like this: current password new password confirm new password SUBMIT(a submit button) now this current password is already in the database named
forget password
forget password  can i get coding for forgot password in jsp, need using javamail also cannot.. what should i do?? Thx
foget password
is user login ,second is new user and third is forget password in java using netbeans.so please help me to write the code for forget password button.forget password form have three field that is userid ,security question and answer of those
password - JDBC
password  as memeber of our site, recently he forget his password now he want a new password from us. so overcome with this problem i have to send his password to his any emailid to once again login with this new pasword so
Forget Password
Forget Password  How i get my forget password through mail?   Please visit the following links: http://www.roseindia.net/jsf/richfaces/ http://www.roseindia.net/jsf/richfaces/developing-jsp-files.shtml
password - Security
password  How can i do password encript and decript in java  Hi friend, Code to encript and decript password in java import... password= "Hello"; System.out.println("input " + password
secure password
secure password   Respected Sir We need to write a function which accepts a given password and returns ââ?¬Å?ACCEPTEDââ?¬Â? or ââ?¬Å?REJECTEDââ?¬Â? based on the following rules: Passwords must consist of a mixture
secure password
secure password   Respected Sir We need to write a function which accepts a given password and returns ââ?¬Å?ACCEPTEDââ?¬Â? or ââ?¬Å?REJECTEDââ?¬Â? based on the following rules: Passwords must consist of a mixture
Changing background color using JavaScript
Changing background color using JavaScript  Hi Sir Is there any way to change the background color using JavaScript ? Please mention code with your answer.   Hello Friend Pass the element & color in the given
Changing the message box to a specific color
Changing the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change with each input but i cant give it a specific color. Example I'm trying to change
Changing JLabel with a jcombobox - Java Beginners
Changing JLabel with a jcombobox  Hi, I have a JLabel which should change when i select an item from JCombobox.I have some calculations after i get a value from the combo,the result of which i have to display using a JLabel I
Changing Executable Jar File Icon
Changing Executable Jar File Icon  I have created an executable jar file for my java program and the icon that appears is the java icon. I will like to know if there is a way to change this to any icon of my choice.   
Delete the First Child of the Root Node
Delete the First Child of the Root Node   ... child of the Root node .Methods which are used for Deleting the child of the root node in a DOM tree are described below :- Element root
Advertisements
 

 

 

DMCA.com