LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to reset the root password for mysql on fedora (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-reset-the-root-password-for-mysql-on-fedora-745833/)

cll975dll 08-07-2009 10:12 AM

Unable to reset the root password for mysql on fedora
 
I have successfully installed mysql on my fedora machine and started up the server also. To get a firm knowledge about the installation and configuration of mysql, I deliberately uninstalled it using YUM. Now when second time I have installed mysql I am unable to set the root password using
/usr/bin/mysqladmin-u root password 'new password'

I have deleted the entry for mysql from /etc/passwd. Now when it is not allowing me to install mysql totally
1) What is the problem and how to solve it?
2) Where the installatin files are stored on linux as in Windows they are stored by default on c:?
3) What are /etc/rc.d and /etc/rc.d/init.d directories used for?

Any help will be appreciated.
thanx in advance>

jstephens84 08-08-2009 09:47 PM

I would start by adding the mysql user back to the passwd file. This users is different and is used to control the mysql daemon.

to reset the lost password. do the following

1. stop the mysql server.
2. start the mysql with the following
Code:

mysqld_safe --skip-grant-tables &
3. connect to mysql
Code:

mysql -u root
4. use mysql database
5. use the following query
Code:

update user set password=PASSWORD('new password') where user=root
6 Now flush the privileges and quit
Code:

flush privileges
quit

7. stop mysql
8. Now restart mysql in normal mode
Code:

/etc/init.d/mysqld start
and that should get your going again.


All times are GMT -5. The time now is 11:56 PM.