From xyz at visca.com Mon Sep 7 12:40:21 2009 From: xyz at visca.com (Lou Hevly) Date: Mon, 07 Sep 2009 12:40:21 +0200 Subject: mysql access problem Message-ID: <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> Hello: I'm running MYSQL mysql-server-5.0.51a on 4.3. One of my users called this morning and said he could no longer connect to his database. It was working fine last Tuesday and he claims to have made no changes. The error is "Access denied". So I tried regranting his privileges (the obuch database exists at /var/mysql/obuch): ************************************************************** $ mysql -u root -p Enter password: ******* Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 516738 Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> grant ALL on obuch.* to obuch at localhost identified by 'xxxxxxx'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> quit Bye $ mysql -u obuchfot -p Enter password: xxxxxxx ERROR 1045 (28000): Access denied for user 'obuchfot'@'localhost' (using password: YES) ****************************************************************** -- All the best (Ad?u-siau), Lou Hevly xyz at visca.com http://visca.com From xyz at visca.com Mon Sep 7 17:49:20 2009 From: xyz at visca.com (Lou Hevly) Date: Mon, 07 Sep 2009 17:49:20 +0200 Subject: mysql access problem In-Reply-To: <0MKpCa-1MkdrE0YBq-000Cc9@mrelay.perfora.net> References: <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> Message-ID: <5.1.0.14.2.20090907154739.00eddb74@69.94.110.70> At 08:02 AM 9/7/2009 -0500, Tony Aberenthy wrote: >obuch at localhost grant ALL on obuch.* to obuch at localhost >identified >by 'xxxxxxx'; >obuchfot at localhost mysql -u obuchfot -p >?? the user name No, sorry, that should have been obuch; I miscopied. >See what you get from: >SELECT Host, User, Password, Select_priv FROM mysql.user; >SELECT Host, Db, User, Select_priv FROM mysql.db; SELECT Host, User, Password, Select_priv FROM mysql.user; ... localhost | obuch | 130a5f060ae5aee8 | N localhost | obuch | 0ec6a87e091493c8 | N mysql> SELECT Host, Db, User, Select_priv FROM mysql.db; ... localhost | obuch | obuch | Y localhost | obuch | obuch | Y This seems to be it. The "obuch" user (and database) are listed twice, and the user has 2 different passwords. Now I've run: /usr/local/bin/mysql_upgrade and everything goes fine until it gets to here: Running 'mysql_fix_privilege_tables'... ERROR 1062 (23000) at line 94: Duplicate entry 'localhost-simi' for key 1 ERROR 1062 (23000) at line 163: Duplicate entry 'localhost-simi' for key 1 ERROR 1062 (23000) at line 202: Duplicate entry 'localhost-simi' for key 1 ERROR 1062 (23000) at line 207: Duplicate entry 'localhost-simi' for key 1 FATAL ERROR: Upgrade failed And it's true that there is also a duplicate entry for 'simi'. When I ran /usr/local/bin/mysql_fix_privilege_tables --password=xxxxxx no error showed. So I tried to drop the user obuch: mysql> drop user obuch at localhost; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> drop user obuch at localhost; Query OK, 0 rows affected (0.00 sec) It says 0 rows affected, which is the case, since both obuch entries are still in the mysql.user table. In fact, I can't drop any users at all using that syntax. I suppose this is something pretty basic, but I haven't been able to Google anything useful. I can't seem to drop users. Thanks for your help. Lou > > -----Original Message----- > > From: openbsd-newbies-bounces at sfobug.org > > [mailto:openbsd-newbies-bounces at sfobug.org] On Behalf Of Lou Hevly > > Sent: Monday, September 07, 2009 5:40 AM > > To: openbsd-newbies at sfobug.org > > Subject: mysql access problem > > > > Hello: > > > > I'm running MYSQL mysql-server-5.0.51a on 4.3. > > > > One of my users called this morning and said he could no > > longer connect to his database. It was working fine last > > Tuesday and he claims to have made no changes. The error is > > "Access denied". So I tried regranting his privileges (the > > obuch database exists at > > /var/mysql/obuch): > > > > ************************************************************** > > $ mysql -u root -p > > Enter password: ******* > > Welcome to the MySQL monitor. Commands end with ; or \g. > > Your MySQL connection id is 516738 > > Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a > > > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > > > mysql> grant ALL on obuch.* to obuch at localhost identified by > > 'xxxxxxx'; > > Query OK, 0 rows affected (0.00 sec) > > > > mysql> flush privileges; > > Query OK, 0 rows affected, 1 warning (0.00 sec) > > > > mysql> quit > > Bye > > > > $ mysql -u obuchfot -p > > Enter password: xxxxxxx > > ERROR 1045 (28000): Access denied for user 'obuchfot'@'localhost' > > (using password: YES) > > ****************************************************************** > > > > -- > > All the best (Ad?u-siau), > > Lou Hevly > > xyz at visca.com > > http://visca.com > > > > _______________________________________________ > > Openbsd-newbies mailing list > > Openbsd-newbies at sfobug.org > > http://mailman.theapt.org/listinfo/openbsd-newbies -- All the best (Ad?u-siau), Lou Hevly xyz at visca.com http://visca.com From fbax at sympatico.ca Mon Sep 7 15:49:31 2009 From: fbax at sympatico.ca (Frank Bax) Date: Mon, 07 Sep 2009 09:49:31 -0400 Subject: mysql access problem In-Reply-To: <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> References: <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> Message-ID: <4AA50F6B.8010603@sympatico.ca> It could be a change you made. Does using ip address in place of "localhost" work? I've seen this before, but I don't remember how to fix it properly when it happens. Lou Hevly wrote: > Hello: > > I'm running MYSQL mysql-server-5.0.51a on 4.3. > > One of my users called this morning and said he could no longer connect > to his database. It was working fine last Tuesday and he claims to have > made no changes. The error is "Access denied". So I tried regranting > his privileges (the obuch database exists at /var/mysql/obuch): > > ************************************************************** > $ mysql -u root -p > Enter password: ******* > Welcome to the MySQL monitor. Commands end with ; or \g. > Your MySQL connection id is 516738 > Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > mysql> grant ALL on obuch.* to obuch at localhost identified by 'xxxxxxx'; > Query OK, 0 rows affected (0.00 sec) > > mysql> flush privileges; > Query OK, 0 rows affected, 1 warning (0.00 sec) > > mysql> quit > Bye > > $ mysql -u obuchfot -p > Enter password: xxxxxxx > ERROR 1045 (28000): Access denied for user 'obuchfot'@'localhost' (using > password: YES) > ****************************************************************** > From soc at visca.com Mon Sep 7 17:53:30 2009 From: soc at visca.com (soc at visca.com) Date: Mon, 07 Sep 2009 17:53:30 +0200 Subject: mysql access problem In-Reply-To: <4AA50F6B.8010603@sympatico.ca> References: <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> <5.1.0.14.2.20090907122229.00ea72e4@69.94.110.70> Message-ID: <5.1.0.14.2.20090907175300.00eb33a4@69.94.110.70> At 09:49 AM 9/7/2009 -0400, Frank Bax wrote: >It could be a change you made. Does using ip address in place of >"localhost" work? I've seen this before, but I don't remember how to >fix it properly when it happens. Thanks for your comments, but no joy. Lou >Lou Hevly wrote: >>Hello: >>I'm running MYSQL mysql-server-5.0.51a on 4.3. >>One of my users called this morning and said he could no longer >>connect to his database. It was working fine last Tuesday and he >>claims to have made no changes. The error is "Access denied". So I >>tried regranting his privileges (the obuch database exists at >>/var/mysql/obuch): >>************************************************************** >>$ mysql -u root -p >>Enter password: ******* >>Welcome to the MySQL monitor. Commands end with ; or \g. >>Your MySQL connection id is 516738 >>Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a >>Type 'help;' or '\h' for help. Type '\c' to clear the buffer. >>mysql> grant ALL on obuch.* to obuch at localhost identified by >>'xxxxxxx'; >>Query OK, 0 rows affected (0.00 sec) >>mysql> flush privileges; >>Query OK, 0 rows affected, 1 warning (0.00 sec) >>mysql> quit >>Bye >>$ mysql -u obuchfot -p >>Enter password: xxxxxxx >>ERROR 1045 (28000): Access denied for user 'obuchfot'@'localhost' >>(using password: YES) >>****************************************************************** > >_______________________________________________ >Openbsd-newbies mailing list >Openbsd-newbies at sfobug.org >http://mailman.theapt.org/listinfo/openbsd-newbies -- All the best (Ad?u-siau), Lou Hevly soc at visca.com http://visca.com From tony at servacorp.com Mon Sep 7 19:16:53 2009 From: tony at servacorp.com (Tony Abernethy) Date: Mon, 7 Sep 2009 12:16:53 -0500 Subject: mysql access problem In-Reply-To: <5.1.0.14.2.20090907154739.00eddb74@69.94.110.70> Message-ID: <2EF17371267E44AFB71CC5FCB3E2E76E@TONY> Try: DELETE FROM mysql.user WHERE User='obuch'; DELETE FROM mysql.db WHERE User='obuch'; REPAIR TABLE mysql.user, mysql.db; FLUSH PRIVILEGES; Which should maybe get both entries in both tables. After all the entries are deleted, do the GRANT ALL ON obuch.* to ... > -----Original Message----- > From: openbsd-newbies-bounces at sfobug.org > [mailto:openbsd-newbies-bounces at sfobug.org] On Behalf Of Lou Hevly > Sent: Monday, September 07, 2009 10:49 AM > To: tony at servasoftware.com; openbsd-newbies at sfobug.org > Subject: RE: mysql access problem > > At 08:02 AM 9/7/2009 -0500, Tony Aberenthy wrote: > >obuch at localhost grant ALL on obuch.* to obuch at localhost > >identified > >by 'xxxxxxx'; > >obuchfot at localhost mysql -u obuchfot -p > >?? the user name > > No, sorry, that should have been obuch; I miscopied. > > > >See what you get from: > >SELECT Host, User, Password, Select_priv FROM mysql.user; > >SELECT Host, Db, User, Select_priv FROM mysql.db; > > > SELECT Host, User, Password, Select_priv FROM mysql.user; > ... > localhost | obuch | 130a5f060ae5aee8 | N > localhost | obuch | 0ec6a87e091493c8 | N > > mysql> SELECT Host, Db, User, Select_priv FROM mysql.db; > ... > localhost | obuch | obuch | Y > localhost | obuch | obuch | Y > > This seems to be it. The "obuch" user (and database) are > listed twice, > and the user has 2 different passwords. > > Now I've run: > /usr/local/bin/mysql_upgrade > and everything goes fine until it gets to here: > > Running 'mysql_fix_privilege_tables'... > ERROR 1062 (23000) at line 94: Duplicate entry > 'localhost-simi' for key > 1 > ERROR 1062 (23000) at line 163: Duplicate entry 'localhost-simi' for > key 1 > ERROR 1062 (23000) at line 202: Duplicate entry 'localhost-simi' for > key 1 > ERROR 1062 (23000) at line 207: Duplicate entry 'localhost-simi' for > key 1 > FATAL ERROR: Upgrade failed > > And it's true that there is also a duplicate entry for 'simi'. > > When I ran /usr/local/bin/mysql_fix_privilege_tables --password=xxxxxx > no error showed. > > So I tried to drop the user obuch: > > mysql> drop user obuch at localhost; > Query OK, 0 rows affected (0.00 sec) > > mysql> flush privileges; > Query OK, 0 rows affected (0.00 sec) > > mysql> drop user obuch at localhost; > Query OK, 0 rows affected (0.00 sec) > > It says 0 rows affected, which is the case, since both obuch entries > are still in the mysql.user table. In fact, I can't drop any > users at > all using that syntax. > > I suppose this is something pretty basic, but I haven't been able to > Google anything useful. I can't seem to drop users. > > Thanks for your help. > > Lou > > > > > -----Original Message----- > > > From: openbsd-newbies-bounces at sfobug.org > > > [mailto:openbsd-newbies-bounces at sfobug.org] On Behalf Of Lou Hevly > > > Sent: Monday, September 07, 2009 5:40 AM > > > To: openbsd-newbies at sfobug.org > > > Subject: mysql access problem > > > > > > Hello: > > > > > > I'm running MYSQL mysql-server-5.0.51a on 4.3. > > > > > > One of my users called this morning and said he could no > > > longer connect to his database. It was working fine last > > > Tuesday and he claims to have made no changes. The error is > > > "Access denied". So I tried regranting his privileges (the > > > obuch database exists at > > > /var/mysql/obuch): > > > > > > ************************************************************** > > > $ mysql -u root -p > > > Enter password: ******* > > > Welcome to the MySQL monitor. Commands end with ; or \g. > > > Your MySQL connection id is 516738 > > > Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a > > > > > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > > > > > mysql> grant ALL on obuch.* to obuch at localhost identified by > > > 'xxxxxxx'; > > > Query OK, 0 rows affected (0.00 sec) > > > > > > mysql> flush privileges; > > > Query OK, 0 rows affected, 1 warning (0.00 sec) > > > > > > mysql> quit > > > Bye > > > > > > $ mysql -u obuchfot -p > > > Enter password: xxxxxxx > > > ERROR 1045 (28000): Access denied for user 'obuchfot'@'localhost' > > > (using password: YES) > > > ****************************************************************** > > > > > > -- > > > All the best (Ad?u-siau), > > > Lou Hevly > > > xyz at visca.com > > > http://visca.com > > > > > > _______________________________________________ > > > Openbsd-newbies mailing list > > > Openbsd-newbies at sfobug.org > > > http://mailman.theapt.org/listinfo/openbsd-newbies > > -- > All the best (Ad?u-siau), > Lou Hevly > xyz at visca.com > http://visca.com > > _______________________________________________ > Openbsd-newbies mailing list > Openbsd-newbies at sfobug.org > http://mailman.theapt.org/listinfo/openbsd-newbies > From soc at visca.com Mon Sep 7 19:27:36 2009 From: soc at visca.com (soc at visca.com) Date: Mon, 07 Sep 2009 19:27:36 +0200 Subject: mysql access problem In-Reply-To: <2EF17371267E44AFB71CC5FCB3E2E76E@TONY> References: <5.1.0.14.2.20090907154739.00eddb74@69.94.110.70> Message-ID: <5.1.0.14.2.20090907192643.038c5ef0@69.94.110.70> At 12:16 PM 9/7/2009 -0500, Tony Abernethy wrote: >Try: >DELETE FROM mysql.user WHERE User='obuch'; >DELETE FROM mysql.db WHERE User='obuch'; >REPAIR TABLE mysql.user, mysql.db; >FLUSH PRIVILEGES; > >Which should maybe get both entries in both tables. > >After all the entries are deleted, do the >GRANT ALL ON obuch.* to ... That did it! Thanks so much. Lou > > > > -----Original Message----- > > From: openbsd-newbies-bounces at sfobug.org > > [mailto:openbsd-newbies-bounces at sfobug.org] On Behalf Of Lou Hevly > > Sent: Monday, September 07, 2009 10:49 AM > > To: tony at servasoftware.com; openbsd-newbies at sfobug.org > > Subject: RE: mysql access problem > > > > At 08:02 AM 9/7/2009 -0500, Tony Aberenthy wrote: > > >obuch at localhost grant ALL on obuch.* to obuch at localhost > > >identified > > >by 'xxxxxxx'; > > >obuchfot at localhost mysql -u obuchfot -p > > >?? the user name > > > > No, sorry, that should have been obuch; I miscopied. > > > > > > >See what you get from: > > >SELECT Host, User, Password, Select_priv FROM mysql.user; > > >SELECT Host, Db, User, Select_priv FROM mysql.db; > > > > > > SELECT Host, User, Password, Select_priv FROM mysql.user; > > ... > > localhost | obuch | 130a5f060ae5aee8 | N > > localhost | obuch | 0ec6a87e091493c8 | N > > > > mysql> SELECT Host, Db, User, Select_priv FROM mysql.db; > > ... > > localhost | obuch | obuch | Y > > localhost | obuch | obuch | Y > > > > This seems to be it. The "obuch" user (and database) are > > listed twice, > > and the user has 2 different passwords. > > > > Now I've run: > > /usr/local/bin/mysql_upgrade > > and everything goes fine until it gets to here: > > > > Running 'mysql_fix_privilege_tables'... > > ERROR 1062 (23000) at line 94: Duplicate entry > > 'localhost-simi' for key > > 1 > > ERROR 1062 (23000) at line 163: Duplicate entry 'localhost-simi' > for > > key 1 > > ERROR 1062 (23000) at line 202: Duplicate entry 'localhost-simi' > for > > key 1 > > ERROR 1062 (23000) at line 207: Duplicate entry 'localhost-simi' > for > > key 1 > > FATAL ERROR: Upgrade failed > > > > And it's true that there is also a duplicate entry for 'simi'. > > > > When I ran /usr/local/bin/mysql_fix_privilege_tables > --password=xxxxxx > > no error showed. > > > > So I tried to drop the user obuch: > > > > mysql> drop user obuch at localhost; > > Query OK, 0 rows affected (0.00 sec) > > > > mysql> flush privileges; > > Query OK, 0 rows affected (0.00 sec) > > > > mysql> drop user obuch at localhost; > > Query OK, 0 rows affected (0.00 sec) > > > > It says 0 rows affected, which is the case, since both obuch > entries > > are still in the mysql.user table. In fact, I can't drop any > > users at > > all using that syntax. > > > > I suppose this is something pretty basic, but I haven't been able > to > > Google anything useful. I can't seem to drop users. > > > > Thanks for your help. > > > > Lou > > > > > > > > -----Original Message----- > > > > From: openbsd-newbies-bounces at sfobug.org > > > > [mailto:openbsd-newbies-bounces at sfobug.org] On Behalf Of Lou > Hevly > > > > Sent: Monday, September 07, 2009 5:40 AM > > > > To: openbsd-newbies at sfobug.org > > > > Subject: mysql access problem > > > > > > > > Hello: > > > > > > > > I'm running MYSQL mysql-server-5.0.51a on 4.3. > > > > > > > > One of my users called this morning and said he could no > > > > longer connect to his database. It was working fine last > > > > Tuesday and he claims to have made no changes. The error is > > > > "Access denied". So I tried regranting his privileges (the > > > > obuch database exists at > > > > /var/mysql/obuch): > > > > > > > > ************************************************************** > > > > $ mysql -u root -p > > > > Enter password: ******* > > > > Welcome to the MySQL monitor. Commands end with ; or \g. > > > > Your MySQL connection id is 516738 > > > > Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a > > > > > > > > Type 'help;' or '\h' for help. Type '\c' to clear the buffer. > > > > > > > > mysql> grant ALL on obuch.* to obuch at localhost identified by > > > > 'xxxxxxx'; > > > > Query OK, 0 rows affected (0.00 sec) > > > > > > > > mysql> flush privileges; > > > > Query OK, 0 rows affected, 1 warning (0.00 sec) > > > > > > > > mysql> quit > > > > Bye > > > > > > > > $ mysql -u obuchfot -p > > > > Enter password: xxxxxxx > > > > ERROR 1045 (28000): Access denied for user > 'obuchfot'@'localhost' > > > > (using password: YES) > > > > > ****************************************************************** > > > > > > > > -- > > > > All the best (Ad?u-siau), > > > > Lou Hevly > > > > xyz at visca.com > > > > http://visca.com > > > > > > > > _______________________________________________ > > > > Openbsd-newbies mailing list > > > > Openbsd-newbies at sfobug.org > > > > http://mailman.theapt.org/listinfo/openbsd-newbies > > > > -- > > All the best (Ad?u-siau), > > Lou Hevly > > xyz at visca.com > > http://visca.com > > > > _______________________________________________ > > Openbsd-newbies mailing list > > Openbsd-newbies at sfobug.org > > http://mailman.theapt.org/listinfo/openbsd-newbies > > > >_______________________________________________ >Openbsd-newbies mailing list >Openbsd-newbies at sfobug.org >http://mailman.theapt.org/listinfo/openbsd-newbies -- All the best (Ad?u-siau), Lou Hevly soc at visca.com http://visca.com