Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: d_loayza on July 28, 2010, 05:33:50 AM

Title: MySQL and root user privileges
Post by: d_loayza on July 28, 2010, 05:33:50 AM
A few months ago I had problems with MySQL, I found a corrupt InnoDB database and    the service MySQL was down, I fixed it, but in the process the root user lost your  privileges. When the SME server starts the initial MySQL scripts don´t work indicating the error "access denied for root".

The sad thing that so far the server is running smoothly, I can create users, ibays, manage, fetchmail, sarg, etc.

I need install FreePBX, but this problem prevents me from install.

I have a lot of information on the server and do a clean install would take me a long time I wanted to avoid. I've followed the tutorials to reset passwords, etc. is not a problem of "password", because can enter the MySQL console, is a problem of privilege.

Someone can help this disgraced engineer?  :-)

Thanks in advance.

Daniel Loayza

Title: Re: MySQL and root user privileges
Post by: janet on July 28, 2010, 08:55:35 AM
d_loayza

Did you do this (for sme7.3)
http://wiki.contribs.org/MySQL#Resetting_the_MySQL_root_password
and this
http://wiki.contribs.org/MySQL#Restoring_accidently_deleted_MySQL_root_user
Title: Re: MySQL and root user privileges
Post by: CharlieBrady on July 28, 2010, 03:09:10 PM
The sad thing that so far the server is running smoothly, I can create users, ibays, manage, fetchmail, sarg, etc.

mysql in base SME server is only used to store webmail user preferences.
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 28, 2010, 05:50:07 PM
Mary and CharlieBrady.

The root user exists in MySQL, what happens is they lost their privileges. I tried to delete the root user, but since he has no privileges in MySQL will not let me delete it.

How I can delete the root user?

Thanks in advance.
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 28, 2010, 07:00:33 PM
The root user has no access to the mysql database, if I run the following conosle command:
mysql --user=root mysql

I receive the following error:
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'mysql'

I can not assign privileges with this comand:
grant all privileges on *.* to 'root'@'localhost' with grant option;

show the same access denied error.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

If I run the command:
show grants for 'root'@'localhost';

It shows:
+------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                    |
+------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*5B630A1B74B9D161A25D1EF8A32578303001CE8A' |
| GRANT ALL PRIVILEGES ON `zabbixdb`.* TO 'root'@'localhost'                                                    |
+------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

What can I do?


Title: Re: MySQL and root user privileges
Post by: CharlieBrady on July 28, 2010, 07:05:19 PM
What can I do?

You can follow the instructions you have already been given:

http://wiki.contribs.org/MySQL#Resetting_the_MySQL_root_password
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 28, 2010, 11:05:36 PM
I have followed teh two indications, had done before and I did it again. Don´t show any   error, but in the end as usual still  with the same mistakes I mentioned earlier.

What can I do?
Title: Re: MySQL and root user privileges
Post by: Stefano on July 28, 2010, 11:09:11 PM
what do you get doing
Code: [Select]
mysql
?
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 29, 2010, 01:57:17 AM
Stefano said:
Quote
  what do you get doing?

The answer:

1) install freePBX, which I can not do because the script fails to access the database with the user "root"

2) Fix the problems it generates in the webmail

3) Fix the problems it generates in the startup scripts at server start.

4) Save time by not having the need to make a backup of data and a clean installation.

Please enlighten my brain! :-D

Thanks!
Title: Re: MySQL and root user privileges
Post by: janet on July 29, 2010, 02:30:23 AM
d_loayza

Stefano is asking you to login to the Linux command prompt as root user and then type the command

mysql
then press Enter
and then observe what response the system gives you.
Advise back here what you see.
Doing this is part of diagnosing what your problem is.
Until the problem is correctly identified, no one can tell you how to fix it.
Title: Re: MySQL and root user privileges
Post by: CharlieBrady on July 29, 2010, 02:34:58 AM
Stefano is asking you to login to the Linux command prompt as root user and then type the command

mysql
then press Enter
and then observe what response the system gives you.
Advise back here what you see.

No, I'd suggest that he posts that to the bug tracker. If there is a problem in the software, it will be fixed. If there is a problem in d_loayza's actions, they will be identified and the bug will be closed INVALID.
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 29, 2010, 03:13:47 AM
I am Sorry Stefano, my English is of caveman. I love the Google´s language tools.

The command "mysql" works well, I enter the console but I can not do anything, not even create a database

Look:
Quote
[root@linux-server ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 115 to server version: 4.1.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE testing;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'testing'
mysql>
Title: Re: MySQL and root user privileges
Post by: cactus on July 29, 2010, 08:51:10 AM
Did you already try to recreate the root user following this instructions: http://wiki.contribs.org/SME_Server:Documentation:FAQ#Restoring_accidently_deleted_MySQL_root_user ?

It could be that not all steps are required as you still seem to have the root user, although there has been some changes to it's privileges as it seems from:

The command "mysql" works well, I enter the console but I can not do anything, not even create a database
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 29, 2010, 02:52:43 PM
I followed these instructions step by step, twice.

As might delete the root user of MySQL?, In order to recreate it.
How might to assign all privileges to root user?
As could create another user with sufficient privileges to give privileges to root user?

Here is some einstein? :-)
Title: Re: MySQL and root user privileges
Post by: Stefano on July 29, 2010, 02:57:49 PM
how much data have you got into mysql? do you have any db other than horde, mysql and test?
Title: Re: MySQL and root user privileges
Post by: cactus on July 29, 2010, 03:01:41 PM
I followed these instructions step by step, twice.
As might delete the root user of MySQL?, In order to recreate it.
How might to assign all privileges to root user?
As could create another user with sufficient privileges to give privileges to root user?
They should work. Do you receive any error messages or pointers when trying the instructions?
Title: Re: MySQL and root user privileges
Post by: d_loayza on July 29, 2010, 03:31:01 PM
cactus wrote:
Quote
They should work. Do you receive any error messages or pointers when trying the instructions?

No error, all instructions are executed cleanly.
Title: Re: MySQL and root user privileges
Post by: CharlieBrady on July 29, 2010, 03:36:59 PM
I followed these instructions step by step, twice.

Please open a bug report, showing exactly what commands you are running and what the result is.
Title: Re: MySQL and root user privileges
Post by: d_loayza on August 03, 2010, 02:28:28 AM
Talking to my associate, I remembered that long ago had created a user named "webmaster" with privileges on all databases.

I ejecute  the following commands to restore the situation:

a) mysql --user=webmaster --password=xxxxxxxxx
b) grant all privileges on *.* to 'root'@'localhost' with grant option;
c) use mysql;
d) grant all privileges on mysql to 'root'@'localhost' with grant option;

I will open a detailed report to explain what happened to me, it seems the scripts to restore the root user  does not work correctly.

Sincerely grateful for taking the time to solve my problem.