Page 1 of 1

[SOLVED] How to change MySQL root password

Posted: Tue Jul 15, 2014 11:51 pm
by openyk
Worked for me on Ubuntu 14.04 x64:

Code: Select all

# (Log onto or SSH access into your server's command line)
# Log into database (replace your_host with your selected host name you made during vestacp install)
mysql -h your_host -u root

# Change password for root user (replace yourpassword with your desired password, make sure to keep the quotes in though)
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');

# You are now able to log into phpmyadmin with user : root and password: yourpassword
Also update the vestacp configuration file so that the backup process can access your database with the new password:
change the file mysql.conf located in "/usr/local/vesta/conf"

Re: [SOLVED] How to change MySQL root password

Posted: Thu May 28, 2015 8:23 am
by canoodle
Hi,

it's good to know that the mysql-root password is located in:

Code: Select all

/usr/local/vesta/conf/mysql.conf
i try to detect what is causing mysql to crash frequently... like every 2 days.

server is vps@hetzner with 512MB of RAM running Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.68-1+deb7u1 i686 GNU/Linux

Code: Select all

vim /var/log/syslog

May 28 10:17:11 dwaves mysqld_safe[3623]: /usr/bin/mysqladmin -u root password 'new-password'
May 28 10:17:11 dwaves mysqld_safe[3623]: /usr/bin/mysqladmin -u root -h  password 'new-password'
why this message?

both commands seem to be wrong and fail btw :-D

is there no root password set?

it's interesting that

Code: Select all

# mysql -u root
won't ask me for a password?

changing root pwd: this is the way it works: http://www.rackspace.com/knowledge_cent ... t-password

Re: [SOLVED] How to change MySQL root password

Posted: Thu May 28, 2015 11:43 am
by skurudo
canoodle wrote: try to detect what is causing mysql to crash frequently... like every 2 days.
server is vps@hetzner with 512MB of RAM running Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.68-1+deb7u1 i686 GNU/Linux
Use modest my.cnf configuration for low memory server and happyness be with you.
If you use default my.cnf, happyless be with you and it's sad ;-)
canoodle wrote:

Code: Select all

# mysql -u root
won't ask me for a password?
You have password here - /root/.my.cnf

Re: [SOLVED] How to change MySQL root password

Posted: Sat Feb 06, 2016 9:25 am
by waleeed
try to detect what is causing mysql to crash frequently... like every 2 days.

Re: [SOLVED] How to change MySQL root password

Posted: Sun Feb 07, 2016 10:06 am
by skurudo
waleeed wrote:try to detect what is causing mysql to crash frequently... like every 2 days.
In many cases helped this - my.cnf config tuning.
How much CPU/RAM on your server?