Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

[SOLVED] How to change MySQL root password

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Locked
  • Print view
Advanced search
5 posts • Page 1 of 1
openyk
Posts: 14
Joined: Tue Jul 15, 2014 8:52 pm

[SOLVED] How to change MySQL root password

Post by openyk » Tue Jul 15, 2014 11:51 pm

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"
Top

canoodle
Posts: 48
Joined: Thu Nov 27, 2014 9:34 am

Re: [SOLVED] How to change MySQL root password

Post by canoodle » Thu May 28, 2015 8:23 am

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
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [SOLVED] How to change MySQL root password

Post by skurudo » Thu May 28, 2015 11:43 am

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
Top

waleeed
Posts: 1
Joined: Sat Feb 06, 2016 9:23 am

Re: [SOLVED] How to change MySQL root password

Post by waleeed » Sat Feb 06, 2016 9:25 am

try to detect what is causing mysql to crash frequently... like every 2 days.
Last edited by skurudo on Tue Feb 16, 2016 7:04 pm, edited 2 times in total.
Reason: links
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [SOLVED] How to change MySQL root password

Post by skurudo » Sun Feb 07, 2016 10:06 am

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?
Top


Locked
  • Print view

5 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password