Koozali.org: home of the SME Server

MySQL and root user privileges

Offline d_loayza

  • **
  • 37
  • +0/-0
MySQL and root user privileges
« 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


Offline janet

  • *****
  • 4,812
  • +0/-0
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: MySQL and root user privileges
« Reply #2 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.

Offline d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #3 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.

Offline d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #4 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?



Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: MySQL and root user privileges
« Reply #5 on: July 28, 2010, 07:05:19 PM »

Offline d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #6 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?

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: MySQL and root user privileges
« Reply #7 on: July 28, 2010, 11:09:11 PM »
what do you get doing
Code: [Select]
mysql
?

Offline d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #8 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!

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: MySQL and root user privileges
« Reply #9 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.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: MySQL and root user privileges
« Reply #10 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.

Offline d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #11 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>

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: MySQL and root user privileges
« Reply #12 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
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 d_loayza

  • **
  • 37
  • +0/-0
Re: MySQL and root user privileges
« Reply #13 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? :-)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: MySQL and root user privileges
« Reply #14 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?