Ask Your Question

MySQL password?

asked 2012-12-28 08:02:55 -0500

Onno gravatar image

I installed MySQL su -c 'yum groupinstall "MySQL Database"'

The install was fine, silent too. The thing now is that I would also like to know the root password. Is there a way to know the root password? Is there an easy way to reset?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-01-04 22:46:18 -0500

agajan gravatar image

When you first install a MySQL server, the root user has no password. So you can log in with the following command:

mysql -u root

To set the password for the root user in a MySQL server, run the following command:

sudo mysqladmin -u root password NEWPASSWORD
edit flag offensive delete link more


the initial root password on install can be found by running

grep 'temporary password' /var/log/mysqld.log

LKF gravatar imageLKF ( 2018-10-16 17:28:52 -0500 )edit

answered 2012-12-28 09:24:50 -0500

hhlp gravatar image

updated 2012-12-28 09:41:28 -0500

MySQL Secure Installation

This program enables you to improve the security of your MySQL installation in the following ways:

    Set (Change) root password
    Remove anonymous users
    Disallow root login remotely
    Remove test database and access to it
    Reload privilege tables

Start MySQL Secure Installation Invoke mysqlsecureinstallation without arguments:

sudo /usr/bin/mysql_secure_installation

The script will prompt you to determine which actions to perform.

Note : answer 'Y' to all question.

edit flag offensive delete link more

Question Tools


Asked: 2012-12-28 08:02:55 -0500

Seen: 10,643 times

Last updated: Jan 04 '13