From owner-freebsd-questions@FreeBSD.ORG Mon Sep 22 20:56:31 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8DEDE16A4B3 for ; Mon, 22 Sep 2003 20:56:31 -0700 (PDT) Received: from hotmail.com (bay8-f79.bay8.hotmail.com [64.4.27.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03EA343FEA for ; Mon, 22 Sep 2003 20:56:31 -0700 (PDT) (envelope-from unixtools@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 22 Sep 2003 20:56:30 -0700 Received: from 203.199.109.165 by by8fd.bay8.hotmail.msn.com with HTTP; Tue, 23 Sep 2003 03:56:30 GMT X-Originating-IP: [203.199.109.165] X-Originating-Email: [unixtools@hotmail.com] From: "Sunil Sunder Raj" To: shawn@guillemette.org, kdk@daleco.biz Date: Tue, 23 Sep 2003 09:26:30 +0530 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 23 Sep 2003 03:56:30.0839 (UTC) FILETIME=[AC093070:01C38186] cc: questions@freebsd.org Subject: Re: error with mysql when doing mysql -u root X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2003 03:56:31 -0000 Hi, Hi, If you have set a root password, but forgot what it was, you can set a new password with the following procedure: 1) Take down the mysqld server by sending a kill (not kill -9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory: shell> kill `cat /mysql-data-directory/hostname.pid` You must be either the Unix root user or the same user mysqld runs as to do this. 2) Restart mysqld with the --skip-grant-tables option. 3) Set a new password with the mysqladmin password command: shell> mysqladmin -u root password 'mynewpassword' 4) Now you can either stop mysqld and restart it normally, or just load the privilege tables with: shell> mysqladmin -h hostname flush-privileges 5) After this, you should be able to connect using the new password. Alternatively, you can set the new password using the mysql client: 1) Take down and restart mysqld with the --skip-grant-tables option as described above. 2) Connect to the mysqld server with: shell> mysql -u root mysql 3) Issue the following commands in the mysql client: mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root'; mysql> FLUSH PRIVILEGES; 4) After this, you should be able to connect using the new password. 5) You can now stop mysqld and restart it normally. Regards SSR Regards SSR >From: "Shawn Guillemette" >To: "Kevin Kinsey" >CC: questions@freebsd.org >Subject: Re: error with mysql when doing mysql -u root >Date: Sat, 20 Sep 2003 10:00:39 -0700 > >like this ? > ># mysql -u root -p password >Enter password: >ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES) > > >if so is there a way I can reset the "root"' passwd for mysql? >I have tried mysqladmin -u root passowrd newpassword and get this > > > >Shawn > > >----- Original Message ----- >From: "Kevin Kinsey" >To: "Shawn Guillemette" >Cc: >Sent: Saturday, September 20, 2003 6:42 AM >Subject: Re: error with mysql when doing mysql -u root > > > > On Sat, Sep 20, 2003 at 08:55:30AM -0700, Shawn Guillemette wrote: > > > After setting the mysql root user passwd I get this when trying to log >in. > > > > > > # mysql -u root > > > ERROR 1045: Access denied for user: 'root@localhost' (Using password: >NO) > > > > > > Just after the install of mysql I had created a database as a test >successfully.. > > > > > IIRC, it's: 'mysql -u root -p mypassword' > > > > HTH, > > > > Kevin Kinsey > > > >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to >"freebsd-questions-unsubscribe@freebsd.org" _________________________________________________________________ A chance to meet Aishwarya Rai. http://www.myenjoyzone.com/msn/knk.php3 Win lucky prizes.