Error 1142 Update Command Denied To User
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn error 1142 42000 select command denied to user more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Error 1142 42000 Create Command Denied To User
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, error 1142 42000 select command denied to user localhost for table user helping each other. Join them; it only takes a minute: Sign up Resetting MySQL root password up vote 16 down vote favorite 5 I have inherited a server that has mysql installed on it. I don't have
Syntax Error Or Access Violation 1142 Select Command Denied To User
the mysql password for any user, not even root (although I have the linux root password). Plus, I am only aware of one other user account besdies root, and that one does not have privileges to perform any action, not even SELECT. I tried stopping the mysql servicw, restarting with the skip grant tables option, and just logging in without password: service mysqld stop service mysqld start --skip-grant-tables & mysql -u root But get the following 1142 insert command denied to user error: Access denied for user 'root'@'localhost' (using password: NO) I then tried resetting the password: mysqladmin -u root password 'newpw' But that also gives an access denied error. I also tried logging in as the other user (without pw) and executing the following command: UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; and got this error: ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' I have also tried removing mysql and reinstalling, but I get the same errors. Any suggestions? mysql share|improve this question asked Apr 26 '12 at 17:00 Bad Programmer 1,41882846 2 Try these instructions from the manual. –Michael Mior Apr 26 '12 at 17:03 1 Note that if you want to use --skip-grant-tables you may need to start mysqld directly as the options aren't necessarily passed along through the init script. –Michael Mior Apr 26 '12 at 17:04 1 This question really belongs on Database Administrators or Super User, not SO. –eggyal Apr 26 '12 at 17:06 @Michael Mior: Thanks, got it working again! –Bad Programmer Apr 26 '12 at 20:02 @Michael Mior: Do you want to post an answer, so that I can select it as the correct one and give you rep? –Bad Programmer Apr 26 '12 at 20:02 | show 3 more comments 5 Answers 5 active oldest votes up vot
here for a quick overview of the site Help Center Detailed answers to any questions
Mysql Update Command Denied To User
you might have Meta Discuss the workings and policies of this
Update Command Denied To User @'localhost' For Table
site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers select command denied to user ''@'localhost' for table 'user' mysql or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/10338015/resetting-mysql-root-password of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL Error: #1142 - SELECT command denied to user up vote 13 down vote favorite 3 I'm having troubles with a certain query on one of my servers. On all other places I've tested http://stackoverflow.com/questions/10956195/mysql-error-1142-select-command-denied-to-user it it works completely fine but on the server i want to use it it isn't working. It's about the following SQL: SELECT facturen.id AS fid, projecten.id AS pid, titel, facturen.totaal_bedrag AS totaal, betaald, datum FROM facturen, projecten WHERE facturen.project_id = projecten.id AND projecten.eigenaar = '1' ORDER BY datum DESC This is the error code I get from it: SELECT command denied to user 'marco'@'localhost' for table 'projecten' The tables: facturen: CREATE TABLE IF NOT EXISTS `facturen` ( `id` int(11) NOT NULL auto_increment, `project_id` int(11) NOT NULL, `datum` int(11) NOT NULL, `lever_datum` int(11) NOT NULL, `totaal_bedrag` decimal(9,2) NOT NULL, `btw` decimal(9,2) NOT NULL, `bedrijf` varchar(40) NOT NULL, `contactpersoon` varchar(60) NOT NULL, `adres` varchar(60) NOT NULL, `postcode` varchar(7) NOT NULL, `plaats` varchar(30) NOT NULL, `betaald` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=201200006 ; projecten: CREATE TABLE IF NOT EXISTS `projecten` ( `id` int(11) NOT NULL auto_increment, `titel` varchar(80) NOT NULL, `eigenaar` int(11) NOT NULL, `creatie_datum` int(1
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting http://serverfault.com/questions/553896/mysql-update-command-denied-to-user-localhost ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can https://forums.opensuse.org/showthread.php/426171-Mysql-probelm-when-trying-to-log-in-as-root ask a question Anybody can answer The best answers are voted up and rise to the top MySQL: “UPDATE command denied to user ''@'localhost'” [duplicate] up vote 2 down vote favorite This question already has an answer here: How to reset or command denied recover admin account password for MySQL? 4 answers For some reason when I installed MySQL on my machine (a Mac running OS X 10.9) the 'root' MySQL account got messed up and I don't have access to it, but I do have access to the standard MySQL account 'sean@localhost' which I use to log into phpMyAdmin. I am trying to reset the 'root' password by starting the mysqld daemon using the command mysqld --skip-grant-tables and then running the following lines in the mysql> command denied to shell. mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') -> WHERE User='root'; mysql> FLUSH PRIVILEGES; Problem is when I try to run that MySQL string the daemon spits back a ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' as if I didn't use the -u argument when I started the mysql shell, either though I did. Any help is muchly appreciated as I am lost at this point. :/ mysql mac-osx share|improve this question asked Nov 9 '13 at 21:50 Uncle Nerdicus 4815 marked as duplicate by Dennis Kaarsemaker, cole, Rex, Ward, Falcon Momot Nov 13 '13 at 2:36 This question was marked as an exact duplicate of an existing question. add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Well, you say you have access via: sean@localhost But then you say you are denied access via: ''@'localhost' So you are clearly have MySQL running with user grants. Which won’t help in a case like this. So the key should be too circumvent the user grants by stopping MySQL & re-launcing via (this is what I do on Ubuntu): sudo mysqld --skip-grant-tables & On a Mac it could be as simple as doing it without sudo: mysqld --skip-grant-tables & Then when that is running, login as root; you can do that now since the use grants are skipped: mysql -u root mysql Then run a query like this replacing with your own settings: UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE user='root'; FLUSH PRIVIL
Help Here Applications Mysql probelm when trying to log in as root Welcome! If this is your first visit, be sure to check out the FAQ. You will have to register before you can post in the forums. (Be aware the forums do not accept user names with a dash "-") Also, logging in lets you avoid the CAPTCHA verification when searching . Select Articles, Forum, or Blog. Posting in the Forums implies acceptance of the Terms and Conditions. Results 1 to 8 of 8 Thread: Mysql probelm when trying to log in as root Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 17-Nov-2009,22:04 #1 TheDelChop View Profile View Forum Posts View Blog Entries View Articles Newcomer Join Date Mar 2009 Posts 48 Mysql probelm when trying to log in as root Guys, Just installed 11.2 and am loving it. However, I need mysql working and have run into the following problem. First I start up the server: Code: Chopper@chopper:~> sudo /etc/init.d/mysql start root's password: Starting service MySQL done Then I open up the command line and try to log in as the root user: Code: $ mysql -u root -p Then, since I have yet set up the root password, I just press enter and I am logged into mysql and see the following: Code: Chopper@chopper:~> mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.36-log SUSE MySQL RPM Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.00 sec) mysql> As you can see, I don't seem to have privileges to the mysql table with users and what not. This is confirmed when I try to select the mysql database as the active database: Code: mysql> use mysql; ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql' mysql> Anybody know why this is happening? I ran mysql in openSUSE 11.1 fine, and have it running on my ubuntu server as well. FWIW, if I try to run the mysql_secure_installation script, my output is the following: Code: Chopper@chopper:~> mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need