Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th March 2012, 19:52
kwickcut kwickcut is offline
Senior Member
 
Join Date: Nov 2005
Location: nj usa
Posts: 223
Thanks: 14
Thanked 11 Times in 10 Posts
Default mysql password problem again

after installing ubuntu perfect server 10.04
Code:
http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-3
and everything was up and running after a few small tweaks with the email and ftp server i have just run up against a lost password for mysql. everything was working just fine on Wednesday but when i went to log into phpmyadmin as root yesterday i could not gain access. for some reason the root password has changed again for the second time once on the old server and once on the new server.

when trying to log into mysql command line i used this
Code:
root@server1:~# mysql -u root -p
and this is the output
Code:
root@server1:~# mysql -u root -p
Enter password:my password used during setup 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@server1:~#
so i am tried to change the root password for mysql i run this command

Code:
root@server1:~# sudo /etc/init.d/mysql stop
and this is the output of said command

Code:
root@server1:~# sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
root@server1:~#
i have searched google and have not come across an answer to this issue has anyone had this happen and how did you overcome it



kwick
__________________
Operating system Ubuntu Linux 10.04.4
ISPConfig Version: 3.0.4.3
Webmin version 1.580
Kernel and CPU Linux 2.6.32-40-server on x86_64
Processor information AMD Phenom(tm) II X4 945 Processor, 4 cores
Real memory 4.0 GB total

Last edited by kwickcut; 9th March 2012 at 19:58.
Reply With Quote
Sponsored Links
  #2  
Old 10th March 2012, 14:43
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by kwickcut View Post
Code:
root@server1:~# sudo /etc/init.d/mysql stop
and this is the output of said command

Code:
root@server1:~# sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
root@server1:~#
i have searched google and have not come across an answer to this issue has anyone had this happen and how did you overcome it



kwick
You can ignore this - Ubuntu wants you to use
Code:
service mysql stop
instead of
Code:
/etc/init.d/mysql stop
but both commands do the same.

Does
Code:
mysql -u root -prootmysqlpassword
work? Please note that there's no space between -p and rootmysqlpassword.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 10th March 2012, 20:34
kwickcut kwickcut is offline
Senior Member
 
Join Date: Nov 2005
Location: nj usa
Posts: 223
Thanks: 14
Thanked 11 Times in 10 Posts
Default

Quote:
Originally Posted by falko View Post
You can ignore this - Ubuntu wants you to use
Code:
service mysql stop
instead of
Code:
/etc/init.d/mysql stop
but both commands do the same.

Does
Code:
mysql -u root -prootmysqlpassword
work? Please note that there's no space between -p and rootmysqlpassword. i have tried every password that i have ever used
this is the output of mysql -u root -prootmysqlpassword i have tried every password that i have ever used and none work.
Code:
root@server1:~# mysql -u root -pmyrootpassword
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@server1:~#
__________________
Operating system Ubuntu Linux 10.04.4
ISPConfig Version: 3.0.4.3
Webmin version 1.580
Kernel and CPU Linux 2.6.32-40-server on x86_64
Processor information AMD Phenom(tm) II X4 945 Processor, 4 cores
Real memory 4.0 GB total
Reply With Quote
  #4  
Old 11th March 2012, 20:30
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Looks like you need to reset your MySQL root password: http://www.howtoforge.com/reset-forg...-root-password
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 12th March 2012, 04:23
kwickcut kwickcut is offline
Senior Member
 
Join Date: Nov 2005
Location: nj usa
Posts: 223
Thanks: 14
Thanked 11 Times in 10 Posts
Default

i dont know if this is correct but this is what i am getting

Code:
root@server1:~# service mysql stop
stop: Unknown instance:
root@server1:~# mysqld_safe --skip-grant-tables
120311 23:17:01 mysqld_safe Logging to syslog.
120311 23:17:01 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql --user=root mysql
update user set Password=PASSWORD('mynewrootpassword') where user='root';
flush privileges;
exit;
i then stopped mysql and restarted it

Code:
service mysql stop
service mysql start
nothing changed i still can not log in
__________________
Operating system Ubuntu Linux 10.04.4
ISPConfig Version: 3.0.4.3
Webmin version 1.580
Kernel and CPU Linux 2.6.32-40-server on x86_64
Processor information AMD Phenom(tm) II X4 945 Processor, 4 cores
Real memory 4.0 GB total
Reply With Quote
  #6  
Old 12th March 2012, 18:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Can you check your mysql.user table if there's a user called root?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 13th March 2012, 05:28
kwickcut kwickcut is offline
Senior Member
 
Join Date: Nov 2005
Location: nj usa
Posts: 223
Thanks: 14
Thanked 11 Times in 10 Posts
Default

i have searched and can not find the command to list mysql.user


kwick
__________________
Operating system Ubuntu Linux 10.04.4
ISPConfig Version: 3.0.4.3
Webmin version 1.580
Kernel and CPU Linux 2.6.32-40-server on x86_64
Processor information AMD Phenom(tm) II X4 945 Processor, 4 cores
Real memory 4.0 GB total
Reply With Quote
  #8  
Old 15th March 2012, 00:46
kwickcut kwickcut is offline
Senior Member
 
Join Date: Nov 2005
Location: nj usa
Posts: 223
Thanks: 14
Thanked 11 Times in 10 Posts
Default

update i have run this command
Code:
root@server1:~# cat /usr/local/ispconfig/server/lib/mysql_clientdb.conf
and this is the output
Code:
root@server1:~# cat /usr/local/ispconfig/server/lib/mysql_clientdb.conf
<?php

$clientdb_host                  = 'localhost';
$clientdb_user                  = 'root';
$clientdb_password              = '1967mypassword';
now even with this info i can not log into phpmyadmin of mysql database on the server through command line

any thoughts
__________________
Operating system Ubuntu Linux 10.04.4
ISPConfig Version: 3.0.4.3
Webmin version 1.580
Kernel and CPU Linux 2.6.32-40-server on x86_64
Processor information AMD Phenom(tm) II X4 945 Processor, 4 cores
Real memory 4.0 GB total
Reply With Quote
  #9  
Old 15th March 2012, 08:23
TiTex TiTex is offline
Senior Member
 
Join Date: Aug 2011
Location: Cluj-Napoca,Romania
Posts: 125
Thanks: 0
Thanked 18 Times in 17 Posts
Send a message via Skype™ to TiTex
Default

this should have been worked , i've just tested it on a virtual machine

Stop the MySQL Server.
Code:
sudo /etc/init.d/mysql stop
Start the mysqld configuration.
Code:
sudo mysqld --skip-grant-tables &
Login to MySQL as root.
Code:
mysql -u root mysql
Replace YOURNEWPASSWORD with your new password!
Code:
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
FLUSH PRIVILEGES; 
exit;
if you still can't solve your problem i would suggest to remove mysql server and install it again , if you have some databases that needs to be backed up you can copy the folder where the mysql data is stored to somewhere else and after you installed it again copy back just the databases you need , i think they should be in separate folders in the folder tree.

Last edited by TiTex; 15th March 2012 at 08:26.
Reply With Quote
  #10  
Old 16th March 2012, 15:25
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
 
Default

Quote:
Originally Posted by kwickcut View Post
i have searched and can not find the command to list mysql.user


kwick
Just start MySQL as follows:

Code:
mysqld_safe --skip-grant-tables
Then do this:
Code:
mysql
Code:
use mysql;
SELECT * FROM user;
Does the last command show a record where the user is root?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Major recovery Toucan Installation/Configuration 18 9th August 2011 11:45
Problem installing MySQL on suse 10.3 Txchaser Installation/Configuration 20 18th April 2008 01:05
Perfect Setup Ubuntu 7.04: MySQL host password problem cheros HOWTO-Related Questions 6 10th January 2008 16:30
Ubuntu 6.06 LTS during ISPConfig MySQL root password error...stuck?? Randall Hoffman General 5 13th March 2007 15:01
ISPConfig Mysql root password issue ?? Stuck at install Randall Hoffman Installation/Configuration 1 16th January 2007 20:53


All times are GMT +2. The time now is 22:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.