mysql privileges are not working correctly - mysql

I executed,
grant all privileges on mythconverg.* to 'mythtv'#'localhost' identified by 'mythtv';
however when I execute,
mysql -u mythtv -p -h localhost mythtvconverg
I get,
ERROR 1044 (42000): Access denied for user 'mythtv'#'localhost' to database 'mythtvconverg'
It's not supposed to work this way but it is, what's wrong?

to solve, ERROR 1044 (42000): Access denied for user 'mythtv'#'localhost' to database 'mythtvconverg'
you need to reboot

Related

Database permits main user 'in' but cannot 'see' any schemas

I'm on RDS and this is the situation:
Unable to progress with my RDS instance.
RDS instance master user is 'admin'
Can connect up to the instance using the admin user (MySQL WB or commandLine):
C:\Users\xx>mysql -u 'admin' -p --host=md-blahblah-db-instance.blahblah.ap-southeast-rds.amazonaws.com
Enter password: ********
Welcome to the MySQL monitor. etc etc
Type '\c' to clear the current input statement.
Now I'm in but (on MySQL WB or commandLine) cannot 'see' schema:
mysql> use uxxx
ERROR 1044 (42000): Access denied for user 'admin'#'fxxxx.lnk.telstra.net' to database 'uxxx'
mysql> GRANT ALL PRIVILEGES ON umb.* TO 'admin'#'%' WITH GRANT OPTION;
ERROR 1044 (42000): Access denied for user 'admin'#'fxxxx.lnk.telstra.net' to database 'uxxx'
mysql> GRANT ALL PRIVILEGES ON umb.* TO 'admin'#'%' IDENTIFIED BY 'somepass';
ERROR 1044 (42000): Access denied for user 'admin'#'fxxxx.lnk.telstra.net' to database 'uxxx'
mysql> CREATE USER test identified by 'password';
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
mysql> flush privileges;
ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
Have tried using ideas from the accepted answer at User cannot see databases in mysql workbench
but can't progress as can't create another user.
MySQL ERROR 1045 (28000): Access denied for user 'bill'#'localhost' (using password: YES) suggests that I have could possibly have another user named admin#'fxxxx.lnk.telstra.net', hence this problem.
Quoting:
Hence, such an anonymous user would "mask" any other user like '[any_username]'#'%' when connecting from localhost.
'bill'#'localhost' does match 'bill'#'%', but would match (e.g.) ''#'localhost' beforehand.
The recommended solution is to drop this anonymous user (this is usually a good thing to do anyways).
Reluctant to start again as a lot of CloudFormation stacks are associated with this database.
Any ideas? Appreciate all help.

Mysql: new user access denied to database

I'm using Mysql 5.5. I logged in mysql by root and created a new user.
Then I logged in using
mysql -u newuser -p
Then in mysql I entered
GRANT ALL PRIVILEGES ON db1.tablename TO 'newuser'#'localhost';
in order to access to the databases.
But there is an error message:
ERROR 1142 (42000): SELECT,INSERT,UP command denied to user 'newuser'#'localhost' for table 'tablename'
I even tried other commands such as GRANT CREATE or GRANT DROP, the same error keep showing.
ERROR 1142 (42000): CREATE,GRANT command denied to user 'newuser'#'localhost' for table 'tablename'
Can someone please help?
You logged into MySQL as root and created the new user, but you need to grant the permissions to the new user as well while logged in as root. Then you'll be able to login as newuser and execute statements.

ERROR 1044 (42000) : Access denied for user ' '#localhost to database

Having trouble logging in and accessing my database. Currently using Windows 10 EasyPHP 13.1
I tried logging into my database. Using
"C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u jim -p;
An error message appeared saying
WARNING: Using a password on the command line interface can be insecure
ERROR 1045 (28000): Access Denied for user 'jim'#'localhost' (using password: YES).
Then I tried
"C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -u jim;
This logged me in. However, I still cannot access the database.
Whenever I type the following command.
USE publications;
I get the error
ERROR 1044 (42000) : Access denied for user ' '#localhost to database 'publications'
I have even tried the following
GRANT ALL ON publications.* TO 'jim' IDENTIFIED BY 'mypasswd';
and
GRANT ALL ON publications.* TO 'jim'#'localhost' IDENTIFIED BY 'mypasswd';
and
GRANT ALL PRIVILEGES ON *.* TO 'jim'#'localhost' WITH GRANT OPTION;
as recommended at mysql> use mysql; but ... ERROR 1044 (42000): Access denied for user '' # 'localhost' to database 'mysql'
Even Logging in as a -u root won't let me access the database. I'm at a loss as to what the problem might be. Any ideas?
Try this:
"C:\Program Files (x86)\EasyPHP 13.1\binaries\mysql\bin\mysql.exe" -ujim
Notice i remove spaces between -u and jim
Try this:
GRANT ALL ON *.* TO 'jim'#'%' IDENTIFIED BY 'mypasswd';
FLUSH PRIVILEGES;

MySQL uses empty username in the connection error message

I found a strange mysql behaviour I am struggling to explain
[vagrant#Subs ~]$ mysql -u root12 subdb
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'subdb'
It uses empty string '' as the user name in the error message even though I explicitly supplied root12. If I provide the right username it connects with no problems so I suspect it is just the way mysql reports the error.
Is this a bug or undocumented feature?
[vagrant#Subs ~]$ mysql --version
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
EDIT
People seem to be confused by the wording of this question. I am using root12 as the username, not the password. I am also saying mysql there is no password for root12. Furthermore, root12 user does not even exist. So it is a clear authentication failure. My question is why instad of saying
ERROR 1044 (42000): Access denied for user 'root12'#'localhost' to database 'subdb'
it says
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'subdb'
EDIT
Running CentOS6.5, mysql 5.1.73 here. testuser user does not originally exist
[vagrant#Subs ~]$ mysql -u testuser subdb
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'subdb'
[vagrant#Subs ~]$ mysql -u root
...
mysql> CREATE USER 'testuser'#'localhost' IDENTIFIED BY 'testpassword';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[vagrant#Subs ~]$ mysql -u testuser subdb
ERROR 1045 (28000): Access denied for user 'testuser'#'localhost' (using password: NO)
It's clear from this output that MySQL (seems like only this version) is leaking info whether the username exists or not. If it does not exist the error message resets the username to empty string. If it does, mysql keeps the username intact
try as per below-
mysql -u root12 -p
It will ask you password and you need to supply root12 password.
but if root12 is password of root user then use below command-
mysql -u root -proot12

I am logged into mysql as root but cannot grant extra privileges to users

I am logged into mysql as the root user and trying to setup MYSQL Replication. I have already setup my database as a Master but when I try the 'show master status;' command its saying:
ERROR 1227 (42000): Access denied; you need the SUPER,REPLICATION CLIENT privile
ge for this operation
When I try and add these privileges to the root user I am getting:
ERROR 1045 (28000): Access denied for user 'root'#'%' (using password: YES)
Im lost as to what I can do at this point.
Any help would be greatly appreciated,
Thanks in advance!
It might be necessary that you have to be on localhost, not on a remote machine.