database returned error 1142 alter command denied to user
188.8.131.52 (talkcontribs) I was in the process of updating MediaWiki when my database crashed. I downloaded the tar of the latest release, copied the files into /var/www error 1142 42000 select command denied to user over the existing ones there, and ran /var/www/maintenance/update.php from the command line. error 1142 42000 create command denied to user The update script crashed with the error: Database returned error "1142: CREATE command denied to user 'wikiuser'@'localhost' for table select command denied to user ''@'localhost' for table 'user' mysql 'user_properties' (localhost)" Opening the wiki in my browser gives the following error: Database error A database error has occurred Query: SELECT lc_value FROM `l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'deps'
Select Command Denied To User 'root'@'localhost' For Table 'user'LIMIT 1 Function: LCStore_DB::get Error: 1146 Table 'wikidb.l10n_cache' doesn't exist (localhost) Any idea how I can fix this? My wiki is currently completely unusable. Reply 04:17, 14 December 2010 5 years ago Permalink Hide 184.108.40.206 (talkcontribs) Fixed my own issue. I'll post the fix in case anyone else is having similar problems. I'm on Ubuntu, BTW. I entered admin mode on the console with 1142 select command denied to user "sudo su", which logged me in as the user "root". In LocalSettings.php, $wgDBuser and $wgDBadminuser were set to "wikiuser". By changing them to "root" and running "sudo php5 update.php" I was able to complete the update and fix the database error. The update manual should really include this! Reply 04:26, 14 December 2010 5 years ago Permalink Hide Bryan (talkcontribs) I added a note on Manual:Upgrading#Run_the_update_script that the update script needs CREATE TABLE and ALTER TABLE permissions. Reply 21:40, 15 December 2010 5 years ago Permalink Hide Eckirchn (talkcontribs) Thanks to hexmode @ #firstname.lastname@example.org i learned that the error: Database returned error "1142: CREATE command denied to user 'wikiuser'@'localhost' for table 'user_properties' (localhost)" Could be resolved by editing LocalSettings.php to change the wikiuser to the sql administrator, then change it back after update. Reply 01:54, 28 April 2011 5 years ago Permalink Hide 220.127.116.11 (talkcontribs) Hey there. I have the same problem, but changing the Usernames does not help in any way. Also it's not possible for me to track, if update.php does anything at all, due to the lack of a console. So what can I do now
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 drop command denied to user mysql about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Select Command Denied To User For Table 'proc'Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Mysql Workbench Sql Error 1142each other. Join them; it only takes a minute: Sign up update command is denied for user up vote 8 down vote favorite 4 I've been using this free hosting site for development and testing. I couldn't use an https://www.mediawiki.org/wiki/Topic:Ppiwm67klmcv6f28 UPDATE MySQL command to change the database values, even though the user is supposed to be allowed to use all commands from cPanel. Then, I've tested the same with a default user, it still won't work. However, it works fine on my system. The MySQL error is UPDATE command denied to user 'test'@'localhost' for table 'content' Other commands are working fine. Why is this happening? And how can it be prevented? Or any solution for this? And http://stackoverflow.com/questions/7980032/update-command-is-denied-for-user I am very sure that users have permission to use the UPDATE command because I can use phpMyAdmin with the same user and modify the MySQL fields. I don't understand why some MySQL commands from PHP are denied for a user who was given all priviliges and can do everything via phpMyAdmin. Given that script, phpMyAdmin and the SQL host are on the same server. mysql shared-hosting share|improve this question edited Feb 19 '13 at 14:11 Lance Roberts 14.5k2384117 asked Nov 2 '11 at 12:09 pahnin 1,40992248 why is this question voted down? –pahnin Nov 2 '11 at 12:15 I don't see a question... –Widor Nov 2 '11 at 12:16 3 well. the question is what is the solution or fix for this. updated –pahnin Nov 2 '11 at 12:19 I think the error is self-explanatory - wherever you're running this command, test@localhost does not have UPDATE permissions on that table. The solution would be to GRANT permissions - or check with your free host that it is even permitted. –Widor Nov 2 '11 at 12:21 9 @Widor: This is valid question, just do not use mouse the way you want, use some brain.. No need to vote down straight away, if you do not have time to answer small question leave it to others , you might have good kn
Task Maniphest T38721 update.php reports ALTER command denied to wikiuser when making user_last_timestamp nullableClosed, InvalidPublicActionsEdit TaskEdit Related Tasks...Create SubtaskEdit Parent TasksEdit SubtasksMerge Duplicates InClose As DuplicateEdit Related Objects...Edit CommitsEdit https://phabricator.wikimedia.org/T38721 MocksEdit RevisionsProtect as security issueSubscribeAward TokenFlag For LaterTagsMediaWiki-Maintenance-scripts (Backlog)Subscribersdemon, maiden_taiwan, http://dba.stackexchange.com/questions/90800/whats-the-minimum-privilege-needed-to-alter-a-foreign-key-constraint/135595 wikibugs-l-listAssigned ToNoneAuthored Bymaiden_taiwan, May 10 2012DescriptionWhen updating from 1.17 to 1.19.0, I ran the maintenance/update.php script (with the --quick option) and received this database permissions message about my "wikiuser" user, whose name is "gentlegi_gguser": Making user_last_timestamp nullable... A database command denied query syntax error has occurred. The last attempted database query was: "ALTER TABLE gg_user_newtalk MODIFY user_last_timestamp varbinary(14) NULL default NULL " from within function "DatabaseBase::sourceFile( /path/w/maintenance/archives/patch-user-newtalk-timestamp-null.sql )". Database returned error "1142: ALTER command denied to user 'gentlegi_gguser'@'localhost' for table 'gg_user_newtalk' (localhost)" I've never received this kind of message command denied to from a MW database update. Did I do something wrong? Is anything misconfigured? I was able to get around the issue by temporarily granting all privileges to this database user. Version: 1.19.0 Severity: normalDetailsReference bz36721 bzimport added a project: MediaWiki-Maintenance-scripts.Nov 22 2014, 12:26 AMbzimport set Reference to bz36721.bzimport added a subscriber: Unknown Object (MLST).maiden_taiwan created this task.May 10 2012, 1:09 AMReedy added a comment.May 10 2012, 1:11 AMComment Actions(In reply to comment #0) When updating from 1.17 to 1.19.0, I ran the maintenance/update.php script (with the --quick option) and received this database permissions message about my "wikiuser" user, whose name is "gentlegi_gguser": Making user_last_timestamp nullable... A database query syntax error has occurred. The last attempted database query was: "ALTER TABLE gg_user_newtalk MODIFY user_last_timestamp varbinary(14) NULL default NULL " from within function "DatabaseBase::sourceFile( /path/w/maintenance/archives/patch-user-newtalk-timestamp-null.sql )". Database returned error "1142: ALTER command denied to user 'gentlegi_gguser'@'localhos
log in tour help Tour 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 ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top What's the minimum privilege needed to alter a foreign key constraint? up vote 1 down vote favorite What's the minimum privilege needed to alter a foreign key constraint? My migration script stopped working after MySQL 5.5.41 fixed this bug: InnoDB permitted a foreign key to be created which referenced a parent table for which the user did not have sufficient privileges. (Bug #18790730) I get this error: SQLSTATE: Syntax error or access violation: 1142 REFERENCES command denied to user 'foo'@'localhost' for table 'core.users' (SQL: alter table `user_baz` add constraint user_baz_user_id_foreign foreign key (`user_id`) references `core`.`users` (`id`) on delete cascade on update cascade) Which means I need to fix the privileges. What's the minimum privilege I need? mysql share|improve this question edited Apr 21 at 5:16 Andriy M 8,88232349 asked Feb 2 '15 at 13:40 mtmacdonald migrated from stackoverflow.com Feb 2 '15 at 13:43 This question came from our site for professional and enthusiast programmers. add a comment| 3 Answers 3 active oldest votes up vote 3 down vote You need add "REFERENCE" privilege to your role. share|improve this answer answered Apr 18 at 0:22 smoothdvd 1313 add a comment| up vote 1 down vote Firstly, if all else fails, read the documentation (Usage Notes section). To use `ALTER TABLE`, you need `ALTER`, `CREATE` and `INSERT` privileges for the table. Note that the user (billy) granted these privileges cannot drop the table. Below is an example. mysql> s