Page 1 of 1

[Solved] MySQL DB Issues - Cannot use Root.

PostPosted: Mar 12th, '15, 02:40
by linuxdad
I am trying to update the user table with permisions for a new server. This worked on a previous MySQL DB server (perhaps a version 4?).

Anyway, when I use the mysql_setpermission utility (phpmyadmin is not available right this second, so I am reverting to the Old School method).

This is basically how this goes for now.

Code: Select all
mysql_setpermission -u root -p
Option p is ambiguous (password, port)
Password for user root to connect to MySQL:

######################################################################
## Welcome to the permission setter 1.4 for MySQL.
## made by Luuk de Boer
######################################################################
What would you like to do:
  1. Set password for an existing user.
  2. Create a database + user privilege for that database
     and host combination (user can only do SELECT)
  3. Create/append user privilege for an existing database
     and host combination (user can only do SELECT)
  4. Create/append broader user privileges for an existing
     database and host combination
     (user can do SELECT,INSERT,UPDATE,DELETE)
  5. Create/append quite extended user privileges for an
     existing database and host combination (user can do
     SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
     LOCK TABLES,CREATE TEMPORARY TABLES)
  6. Create/append full privileges for an existing database
     and host combination (user has FULL privilege)
  7. Remove all privileges for for an existing database and
     host combination.
     (user will have all permission fields set to N)
  0. exit this program

Make your choice [1,2,3,4,5,6,7,0]:
<snip>
Okay we keep it with this ...
The following host(s) will be used: 192.168.50.3.
######################################################################

That was it ... here is an overview of what you gave to me:
The database name       : *
The username            : RelayDelay2
The host(s)             : 192.168.50.3
######################################################################

Are you pretty sure you would like to implement this [yes/no]: yes
Okay ... let's go then ...

Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/mysql_setpermission line 276, <STDIN> line 10.



Code: Select all
Line #276 is the Following:

# all privileges
       $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr;



SO the problem is that I cannot add another user to the DB, what do I need to do? Should (can) I run the /usr/bin/mysql_upgrade Utility?

Re: MySQL DB Issues - Cannot use Root.

PostPosted: Mar 12th, '15, 03:04
by linuxdad
OK, because I found NOTHING on the web regarding my issue, I thought that for completeness I would respond with the answer to this issue.

While I did import the DB data from the older server I did not perform a mysql_upgrade, check the options because this tool resolved the issues I was having.

Thank you.