Presuming you are using Redhat or CentOS and yam command is available .
- yum install mysql-server
-
/etc/init.d/mysqld start
-
mysqladmin -u root password ‘{password}’, if it gives issue try to reset default password in this manner
- /etc/init.d/mysqld stop
mysqld_safe –skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD(“newrootpassword”) where User=’root’;
mysql> flush privileges;
mysql> quit
/etc/init.d/mysqld stop
/etc/init.d/mysqld start