ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'

0 votes

Hi,

When I set the privilege with the help of this command:

mysql> select Host,User from mysql.user;

I came up with this error: 

ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'

Can anyone suggest how can I come up with this error?

Jun 19, 2019 in Big Data Hadoop by Jona
7,589 views

1 answer to this question.

0 votes

Hey,

This is a mysql command line error message, this Means you are logged into mysql with a default null user with just about zero privileges.

You can follow some steps to remove the error:

Run the mysql command which will bring you to mysql promt:

mysql -u root

Run the command

select user();


Then run another command:

select user from mysql.user;

I hope you won't get the error anymore.


answered Jun 19, 2019 by Gitika
• 29,330 points

i can t use this command

select user from mysql.user;
And showed this error
ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'

Hi

You need to give SELECT permissions to the MySQL user who is connecting to MySQL. I think that's where you went wrong.

Related Questions In Big Data Hadoop

0 votes
1 answer

Hadoop hdfs "permission denied" error when I try to make new directory

This is because you dont have enough ...READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 69,060 points
4,765 views
+1 vote
1 answer

Hadoop: "DEPRECATED: Use of this script to execute hdfs command is deprecated." error

The use of dfs in your command is "Deprecated". ...READ MORE

answered Nov 26, 2018 in Big Data Hadoop by Omkar
• 69,060 points
1,858 views
0 votes
1 answer

Update hdfs data before stroring in MySql

Yes, you can update the data before ...READ MORE

answered Jan 27, 2019 in Big Data Hadoop by Omkar
• 69,060 points
71 views
0 votes
1 answer

Configure Oozie to use MySQL

To configure Oozie to use MySQL, open ...READ MORE

answered Jun 4, 2019 in Big Data Hadoop by Karan
122 views
0 votes
1 answer

Using Hadoop for Data Analytics.

Yes, your approach is correct - you ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,810 points
65 views
0 votes
1 answer
0 votes
1 answer

error: Access denied for user 'sample'@'localhost'.

This kind of error occurs when we ...READ MORE

answered Apr 15, 2019 in Big Data Hadoop by Gitika
• 29,330 points
304 views