Date: Tue, 23 Sep 2003 09:26:30 +0530 From: "Sunil Sunder Raj" <unixtools@hotmail.com> To: shawn@guillemette.org, kdk@daleco.biz Cc: questions@freebsd.org Subject: Re: error with mysql when doing mysql -u root Message-ID: <BAY8-F79jNIjmMPqngL0000d542@hotmail.com>
next in thread | raw e-mail | index | archive | help
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" <shawn@guillemette.org> >To: "Kevin Kinsey" <kdk@daleco.biz> >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" <kdk@daleco.biz> >To: "Shawn Guillemette" <shawn@guillemette.org> >Cc: <questions@freebsd.org> >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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY8-F79jNIjmMPqngL0000d542>