Macworld Forums: Root Password and Mysql - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Root Password and Mysql

#1 User is offline   mark_G4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-May 01

Posted 17 November 2003 - 09:27 AM

I have tried to install Mysql on my Mac running 10.2. I can get it going, but can never set the root password. I am always denied permission. I install while in my administrator account.
Here is what I get...
/usr/local/mysql/bin/mysqladmin -u root password xxxxx
/usr/local/mysql/bin/mysqladmin: unable to change password; error: 'Access denied for user: '@localhost' to database 'mysql''
0

#2 User is offline   d00d Icon

  • Advanced Member
  • Icon
  • Group: Mac User
  • Posts: 12,149
  • Joined: 24-April 01

Posted 18 November 2003 - 06:37 AM

Two things. I believe you'll need to make sure the root user is set up, and try running the command with sudo.

#3 User is offline   MrPerfect Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 44
  • Joined: 19-November 03

Posted 20 November 2003 - 02:41 PM

The root password in a new mysql installation is unrelated to your root user on the operating system. The password is blank by default.
From the error message, it thinks for some reason you were trying to use the user "@localhost" to connect. The syntax on the command is fine though. Try to run a "mysql -u root -p", press enter when it asks for the password and see if it works.
0

#4 User is offline   mark_G4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-May 01

Posted 20 November 2003 - 03:17 PM

Well sudo did not work however I did get into mysql through the terminal using /usr/local/mysql/bin/mysql -u root -p and then just hit return at the password. I went to help h to find how to set the password, but it did not show how. Also I can not get PHPmyadmin to gain access to anything other than the test database using localhost as the server and root as the user with password empty. I am lost at what to do, you have been a tremendous help so far.
0

#5 User is offline   MrPerfect Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 44
  • Joined: 19-November 03

Posted 20 November 2003 - 07:57 PM

The password is actually stored in the database itself which you have to run a few update commands, that's why mysqladmin is a prefered method of changing the password. Anyway, I looked at the syntax for mysqladmin...
try "mysqladmin -u root -p password NEWPASSWORDHERE"
when it askes you for the password, again, just hit enter.
That should do it.
0

#6 User is offline   mark_G4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-May 01

Posted 21 November 2003 - 06:24 AM

I tried, but here is what I got...
[xxxx-Computer:~] xxxx% /usr/local/mysql/bin/mysqladmin -u root -p password xxxxxx
Enter password:
/usr/local/mysql/bin/mysqladmin: unable to change password; error: 'Access denied for user: '@localhost' to database 'mysql''
how come it always see me as @localhost and not as the root user?
0

#7 User is offline   MrPerfect Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 44
  • Joined: 19-November 03

Posted 21 November 2003 - 11:11 AM

Well, that's your problem. I couldn't tell you why though. It seemingly only effects mysqladmin. It may have something to do with your environment variables. You could try logging in with a different user in OS X and trying the same command.
0

#8 User is offline   mark_G4 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-May 01

Posted 22 November 2003 - 07:29 PM

What I did was uninstall mysql with Marc Liyanage uninstall script. I re-downloaded the mysql package and installed. This time I did none of Marc's install instruction, but just enter the new password and it WORKED! I restarted my machine and it still works, what a relief!
0

#9 User is offline   GaryReece Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 01-January 05

Posted 01 January 2005 - 06:05 AM

Hi Mark,
I located your posts by doing an Google search on the exact same error message you were getting. I have been trying to get mysql running on my system all day. The tidbit in your last post was invaluable, "This time I did none of Marc's install instruction..." By ignoring Marc's stuff and using information from http://developer.app...ource/osdb.html it was working in minutes. Now to see what brick wall I hit next.
Gary
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users