How to reset mysql root password

Pratical and best guide that i have tried from many that i have found on web about to reset mysql root password on linux server.

When you have this error, on you Ubuntu or Centos server (I have tried on Centos, and the user in the original post tried on Ubuntu):

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

This is the guide to reset your mysql password:

$ sudo -s

# /etc/init.d/mysql stop

# mysqld_safe –skip-grant-tables &

# mysql -u root

mysql> use mysql;

mysql> update user set password=PASSWORD(’__NEW__PASSWORD__’) where User=’root’;

mysql> flush privileges;

mysql> \q

# /etc/init.d/mysql start

 

And then, remember take a backup!!

mysqldump -u root -p --all-databases > alldb.sql

Thank you to http://forum.ubuntu-it.org/viewtopic.php?t=293129

VestaCP upgrade PHP 5 to PHP 7 on CentOS 6

Hi guys,
today i will show to you how to upgrade on VestaCP PHP 5.x to a 2x faster PHP 7!

At start will upgrade EPEL, remember that we use the Centos 6, so EPEL must to be the 6 version.
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
# rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

See what PHP version will have:
# yum list installed php*
Installed Packages
php55w.x86_64 5.5.38-1.w6
php55w-cli.x86_64 5.5.38-1.w6

See what PHP version will be available in our package:
# yum list available php* | grep php7
php70w.x86_64 7.0.11-1.w6 webtatic
php70w-bcmath.x86_64 7.0.11-1.w6 webtatic
php70w-cli.x86_64 7.0.11-1.w6 webtatic

remove the actual php 5 version:
# yum remove php*

Install the new php 7 version:
# yum install php70w php70w-cli php70w-common php70w-gd php70w-mbstring php70w-mysql php70w-pdo php70w-xml

Verify that all is good:
# php -v
PHP 7.0.11 (cli) (built: Sep 17 2016 12:52:22) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Restart the web server:
# service httpd restart

Thank you to Shay Anderson for his guide.