Mysql Error 1142 Alter Command Denied
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 select command denied to user ''@'localhost' for table more about Stack Overflow the company Business Learn more about hiring developers or posting
Error 1142 (42000)
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community mysql error 1142 create command denied to user Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL wont let me add column up vote 3 down error 1142 (42000): grant command denied to user vote favorite This should be a really simple process but for whatever reason, I am unable to add a column to an MySQL table. Here's my syntax: $query = "ALTER TABLE game_licenses ADD lifetime VARCHAR(255) AFTER expire_date"; $result = mysql_query($query); if (!$result) { echo "it failed"; } else { echo "success"; } I've tried multiple little changes like adding COLUMN to the query after ADD. There are no MySQL
Trigger Command Denied To User
errors but finishes the script and echos "it failed". The error is: ALTER command denied to user 'webuser'@'localhost' Is it possible to lock a table from being altered? mysql alter-table share|improve this question edited Nov 10 '11 at 15:04 Johan 48.9k16106202 asked Nov 10 '11 at 14:52 user1034772 171211 4 What says mysql_error()? –vbergae Nov 10 '11 at 14:53 1 How do you know there are no errors? echo mysql_error(); –Michael Berkowski Nov 10 '11 at 14:53 I added echo mysql_error() and got this: ALTER command denied to user 'webuser'@'localhost' for table 'game_licenses' –user1034772 Nov 10 '11 at 14:58 Well, there you have it, the user you are connected to the server with is not allowed to execute alter queries on that table. –Lex Nov 10 '11 at 14:59 pretty clear, you don't have permissions for user "webuser", enter with an admin user and give him permissions to alter the table "game_licenses" –Dippi Nov 10 '11 at 15:00 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted You don't have the privileges to do so. Make sure you have the alter privilege on that table. Have the superuser
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 alter command denied to user more about Stack Overflow the company Business Learn more about hiring developers or posting mysql grant all privileges to root ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Grant All Privileges Mysql
Overflow is a community of 6.2 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 http://stackoverflow.com/questions/8081394/mysql-wont-let-me-add-column 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 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 = http://stackoverflow.com/questions/10956195/mysql-error-1142-select-command-denied-to-user '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(11) NOT NULL, `eind_datum` int(11) NOT NULL, `totaal_bedrag` decimal(9,2) NOT NULL, `btw` decimal(9,2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=201200004 ; The strange part is that every other query on both the 'projecten' table and the 'facturen' table works completely fine, also this query works fine on two other servers of mine. mysql select command denied share|improve this question edited Jun 8 '12 at 21:30 asked Jun 8 '12 at 21:22 Seph 1371111 what is bt2 in bt2.projecten ? –Raphaël Althaus Jun 8 '12 at
Reporter: Daniel Ore Email Updates: Status: Not a Bug Impact https://bugs.mysql.com/bug.php?id=49949 on me: None Category:MySQL Server: Security: Privileges Severity:S2 (Serious) Version:5.1.41 OS:Linux (Fedora 12) Assigned to: View Add Comment Files Developer Edit Submission View Progress http://queforum.com/mysql/1016935-mysql-error-1142-42000-alter-command-denied.html Log Contributions [28 Dec 2009 6:38] Daniel Ore Description: A user that is supposed to have all privileges but then gets a "command denied command denied to user" for ALTER and INDEX This happened on Fedora Core 12 but not on Ubuntu 9.10. I have NO idea why. How to repeat: as root, create a user like this: CREATE USER 'valire'@'%' IDENTIFIED BY 'valire'; GRANT ALL PRIVILEGES ON *.* TO 'valire'@'%' WITH GRANT OPTION; mysql> command denied to show grants for valire@'%'; +---------------------------------------------------------------------------------------+ | Grants for valire@% | +---------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'valire'@'%' IDENTIFIED BY PASSWORD '4d4bf4e974831b43' | +---------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) Login to mysql: mysql - u valire -p run the following: CREATE DATABASE VM DEFAULT CHARSET utf8; CREATE TABLE VM.RULE_DEF ( ID INTEGER NOT NULL, DEFINITION_XML TEXT, NAME VARCHAR(255) )TYPE=INNODB; now, try to run: mysql> ALTER TABLE VM.RULE_DEF ADD CONSTRAINT RULE_DEF_PK PRIMARY KEY (ID); ERROR 1142 (42000): ALTER command denied to user 'valire'@'localhost' for table 'RULE_DEF' [28 Dec 2009 7:36] Sveta Smirnova Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php You add privileges to user 'valire'@'%', but connect as 'valire'@'localhost' [28 Dec 2009 7:37] Sveta Smirnova Se
- ERROR 1142 (42000): ALTER command denied LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 10-25-2015,08:00 AM #1 alex Senior Member Join Date Jul 2013 Posts 65,077 Mysql - ERROR 1142 (42000): ALTER command denied I have strange behavior on my MySQL server. I'm sure I have an account with all privileges. Here's the proof : mysql> show grants; +-------------------------------------------------------------------------+ | Grants for ***@localhost | +-------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO '***'@'localhost' IDENTIFIED BY PASSWORD '***' | | GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' | | GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' | | GRANT ALL PRIVILEGES ON `***`.* TO '***'@'localhost' | +-------------------------------------------------------------------------+ 4 rows in set (0.04 sec) but why I always get error message when I'm executing this syntax : mysql> ALTER TABLE outbox_multipart.ID AUTO_INCREMENT = 12; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 13924219 Current database: *** ERROR 1142 (42000): ALTER command denied to user '***'@'localhost' for table 'ID' I can do almost everything (INSERT, UPDATE, DELETE, TRUNCATE, etc) but ALTER with that account. any idea what's wrong with it? I tried to do same thing with phpmyadmin and php script, but got same result. seems that I can't ALTER that column. Check Solution Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote « Previous Thread | Next Thread » Similar Threads Mysql - ERROR 1143 (42000): SELECT command denied By alex in forum Mysql Replies: 0 Last Post: 09-14-2015, 08:00 AM Mysql - ERROR 1044 (42000):