Koozali.org: home of the SME Server

can't log in to mysql after resetting

Offline rshiras

  • *
  • 53
  • +0/-0
can't log in to mysql after resetting
« on: July 10, 2009, 09:17:40 PM »
From a root prompt, I cannot access mysql:
#mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I had it working for a while, then it stopped again.
I tried:
cd /var/service/mysqld
sv d .
expand-template /root/.my.cnf
expand-template /var/service/mysqld/set.password
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
sv u .

I still get
# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I tried:
cd /var/service/mysqld
sv d .
echo 'use mysql;'>set.rootuser
echo -n 'INSERT INTO user VALUES("localhost","root","",'>>set.rootuser
echo '"Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","","","","",0,0,0);'>>set.rootuser
expand-template /root/.my.cnf
expand-template /var/service/mysqld/set.password
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.rootuser
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
sv u .

I still can't get in.
Even when I could get in via the shell as root, the web interface would not let me in.
What next?

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #1 on: July 10, 2009, 09:52:21 PM »
Version is 7.4

More info:
My Gallery2 is still working, so MySQL must be running.

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #2 on: July 10, 2009, 11:15:24 PM »
New info:
I can't log in from a shell as root without a password, but I can log in with my user name and password.  However, I still cannot get in via the web interface.  PHP is working (my joomla site functions just fine).

I tried installing phpmyadmin again:
yum --enablerepo=smecontribs install smeserver-phpmyadmin
signal-event post-upgrade
signal-event reboot

still no dice.  I wonder if the new installation upgraded, removed, or ignored the previous installation.  Anyway, it does not let me in.


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: can't log in to mysql after resetting
« Reply #3 on: July 13, 2009, 12:51:18 PM »
New info:
I can't log in from a shell as root without a password, but I can log in with my user name and password.  However, I still cannot get in via the web interface.  PHP is working (my joomla site functions just fine).

I tried installing phpmyadmin again:
yum --enablerepo=smecontribs install smeserver-phpmyadmin
signal-event post-upgrade
signal-event reboot

still no dice.  I wonder if the new installation upgraded, removed, or ignored the previous installation.  Anyway, it does not let me in.
This has been raised and answered multiple times, and that is why we have a FAQ. Please never mess with the MySQL root password as it has a special mechanism built in so you can seemlesly login when logged in to the console root account. The procedure to restore the password is located here: http://wiki.contribs.org/SME_Server:Documentation:FAQ#MySQL_root_password
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #4 on: July 13, 2009, 08:02:43 PM »
I have tried the restore administrative password from the FAQ numerous times now and it has not worked, which is why I posted this question.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: can't log in to mysql after resetting
« Reply #5 on: July 13, 2009, 10:12:28 PM »
I have tried the restore administrative password from the FAQ numerous times now and it has not worked, which is why I posted this question.
Then launch a bug as it should do so and present all the relevant information. Please post back a reference to the bug for future readers.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #6 on: July 14, 2009, 11:42:28 PM »
I deleted the root user and added it according to the FAQ.  Risky but it worked.
Now I can log in as admin via the web interface, but no other users can log in, even with all privileges.
How do I allow a user to log in?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #7 on: July 15, 2009, 12:40:12 PM »
rshiras

Quote
Now I can log in as admin via the web interface, but no other users can log in...How do I allow a user to log in?

If you are referring to server manager, then ONLY the admin user can log in to that ! Please read the manual !

Install the user manager contrib if you want users to access server manager functions, ie by logging in as with their username and password.

yum --enablerepo=smecontribs install smeserver-userpanel

There will be a few other packages installed too
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: can't log in to mysql after resetting
« Reply #8 on: July 15, 2009, 12:52:31 PM »
I deleted the root user and added it according to the FAQ.  Risky but it worked.
Now I can log in as admin via the web interface, but no other users can log in, even with all privileges.
How do I allow a user to log in?
The MySQL password and the server-manager have no relation what so ever, not being able to login to MySQL should not cripple the server-manager. I think you really need to get your head clear and (re-)read the manuals.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #9 on: July 15, 2009, 07:01:12 PM »
This has nothing to do with the server-manager password.  The admin password I am talking about is the MySQL admin password, Cactus.  You might want to re-read my post before flaming.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: can't log in to mysql after resetting
« Reply #10 on: July 15, 2009, 07:33:31 PM »
This has nothing to do with the server-manager password.  The admin password I am talking about is the MySQL admin password, Cactus.  You might want to re-read my post before flaming.
Sorry, but since you were mentioning a webinterface I assumed that it was the server-manager as that is the only default webinterface available on SME Server.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline rshiras

  • *
  • 53
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #11 on: July 15, 2009, 08:38:14 PM »
<url>/PHPMyAdmin allows me to log in as admin, but no other users can log in.
I have even copied the admin user to a new user name with all the same privileges, but that new user cannot even log in.  Is there a setting somewhere that I can change to allow other users to log in?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: can't log in to mysql after resetting
« Reply #12 on: July 15, 2009, 09:15:01 PM »
rshiras

You need to install the PHPMyAdmin multi user version
http://wiki.contribs.org/Phpmyadminmulti
It appears you also need to add additional users and passwords using the mysql command example given in the above howto.

Please do some more reading (particularly about accessing and using mysql databases and user access permissions) as you seem to have a lack of knowledge and understanding. See the extensive online manuals at the mysql website, google for it. While people are willing to help you out, you also need to be proactive and learn more about what you are doing and using.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.