[x] Welcome to LinuxSolved.com Linux help forums, here we are a community of Linux users helping each other. It is helpful to both ie. new linux users as well experienced one. We always have our experts to help you and ofcourse members help each other, so you can ask for help any time by Registering.: Click to Register

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Linux Forums - Linux Help,Advice & support community:LinuxSolved.com  |  Forum  |  Linux in General  |  Linux Tutorials & How To's  |  Topic: Setting the root password for MySQL
The LinuxSolved.com GNU/Linux User Communit - Forum
Welcome to LinuxCommunity You have just arrived to a friendly linux community which is helping Linux Users from Years.. You can be its part if you have not already joined it. Registration is FREE and is gateway to unlimited help and support to all your linux related needs. If you are an GNU/Linux supporter then you have come to the right place.
Pages: [1]
  Print  
Author Topic: Setting the root password for MySQL  (Read 876 times)
0 Members and 1 Guest are viewing this topic.
vwvr9
New Member

Offline Offline

Posts: 3


View Profile
« on: January 24, 2007, 06:36:04 AM »

I just installed MySQL version 4.1.20 on my CentOS 4.4 server. The default install of MySQL server uses a blank password for root so I had to have it changed. I also set the MySQL service to start up every time my machine boots up.

This is how I did it;

Method 1
Code:

1. # yum -y install mysql-server (This will install the mysql binaries)
2. # chkconfig mysqld on (Adds mysqld to the startup services)
3. # service mysqld start (Starts the MySQL server)
4. # mysql -u root@localhost (Brings up the MySQL console)
5. #mysql> set password for root@localhost=password(’password’); (Sets the root password to “password”)
6. #mysql> reload privileges; (Reloads the grant tables)

Method 2
Code:

1. # mysql -u root@localhost (Brings up the MySQL console)
2. #mysql> use mysql (Use the mysql database)
3. #mysql> update user
              -> set password=password(”password”) (Sets the root password to “password”)
              -> where user=”root”;
4. # reload privileges; (Reloads the grant tables)

That’s it, the next time you want to get the MySQL console up you’ll have to run #mysql -u root -p to get the password prompt.

source: the danesh project tech blog
Logged
gauravbajaj
LST CareTaker
Experienced
*****
Offline Offline

Posts: 597


View Profile
« Reply #1 on: January 26, 2007, 03:01:05 PM »

Yeah

You are right ..but  we can also use this command

#mysqladmin -u root password "newpassowrd"


Thanks
Gaurav
Logged
Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
   

 Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
I forgot my root password Miscellaneous kennynoah 5 3501 Last post May 15, 2004, 03:02:22 AM
by johntaylor
redhat recover root password Miscellaneous johnsmith 1 1312 Last post October 15, 2005, 04:50:17 AM
by Ricky
SSH root password question Linux Servers Support stefan 2 616 Last post April 22, 2005, 02:16:35 PM
by dragoncity99
reset Root password General Networking Support in Linux anybody1234 2 540 Last post February 13, 2006, 11:38:22 PM
by anybody1234
problem setting own DNS; pls HELP Linux Servers Support joydeep 3 452 Last post November 30, 2007, 01:30:58 PM
by rsw686
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 08, 2008, 01:44:35 AM

Login with username, password and session length
Navigation
Recent Discussions
[September 06, 2008, 08:31:28 PM]

[September 06, 2008, 08:55:12 AM]

[September 06, 2008, 08:52:26 AM]

[September 06, 2008, 08:35:40 AM]

[September 06, 2008, 08:20:19 AM]

[September 06, 2008, 08:17:39 AM]

[September 06, 2008, 08:17:19 AM]

[September 06, 2008, 08:12:49 AM]

[September 06, 2008, 08:09:07 AM]

[September 06, 2008, 08:08:26 AM]
Members
Total Members: 6004
Latest: piyush85
Stats
Total Posts: 8138
Total Topics: 2195
Online Today: 5
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 9
Total: 9
Privacy Policy| Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Theme & TinyPortal v0.9.8 © Bloc