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



Home Answers Viewqa SQL Changing root Password
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Victor Ajakpo
Changing root Password
1 Answer(s)      2 years and 10 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...
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
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
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
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
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
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
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 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
forgot password?
forgot password?  forgot password
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
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
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
Advertisements
 

 

 

DMCA.com