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 20, 2019 in Big Data Hadoop by Jona
53,172 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.

Learn more about Big Data Architect and its concepts from the Data architect course.


answered Jun 20, 2019 by Gitika
• 65,910 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,210 points
14,786 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,210 points
8,045 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,210 points
560 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
1,004 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,830 points
499 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
• 65,910 points
1,567 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP