[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 913 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 3529 Last post May 15, 2004, 03:02:22 AM
by johntaylor
redhat recover root password Miscellaneous johnsmith 1 1326 Last post October 15, 2005, 04:50:17 AM
by Ricky
SSH root password question Linux Servers Support stefan 2 631 Last post April 22, 2005, 02:16:35 PM
by dragoncity99
reset Root password General Networking Support in Linux anybody1234 2 555 Last post February 13, 2006, 11:38:22 PM
by anybody1234
problem setting own DNS; pls HELP Linux Servers Support joydeep 3 475 Last post November 30, 2007, 01:30:58 PM
by rsw686
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 10, 2008, 03:50:01 PM

Login with username, password and session length
Navigation
Recent Discussions
[Today at 03:18:26 PM]

[October 09, 2008, 05:17:47 PM]

[October 08, 2008, 04:32:08 AM]

[October 07, 2008, 05:16:33 AM]

[October 06, 2008, 03:09:51 AM]

[October 04, 2008, 03:33:03 AM]

[October 03, 2008, 06:21:18 AM]

[October 03, 2008, 05:31:19 AM]

[October 03, 2008, 05:28:14 AM]

[October 03, 2008, 05:27:13 AM]
Members
Total Members: 6099
Latest: totwire
Stats
Total Posts: 8203
Total Topics: 2224
Online Today: 12
Online Ever: 111
(June 28, 2007, 06:47:29 AM)
Users Online
Users: 0
Guests: 13
Total: 13
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