List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 29 2002 3:45pm
Subject:Re: MySQL 3.23.47 on MacOSX 10.1.2: Could someone help me getting
started
View as plain text  
At 16:25 +0100 1/29/02, Lutz, Helmuth wrote:
>Paul,
>
>thanks for answering. Because of my job I have to succeed this
>correspondence from within another location and machine.
>
>Could you please give some more explaination to a bloody guy to Unix and
>the terminal like me:
>
>1)
>>Kill the server (kill -9), bring it back up with -S (skip grant tables)
>>so that you can reset the root password:
>
>This is Unix I understand. Should the line look like this:
>[hlutz:/usr/local/mysql] hlutz% kill -9

Not quite.  You must specify a process id (PID).  Use ps and grep to find
the MySQL processes.  For example:

% ps ax | grep mysql
   251  ??  S      0:00.08 sh /usr/local/mysql/bin/safe_mysqld
   287  ??  S      0:01.65 /usr/local/mysql/libexec/mysqld

This tells me that I need to kill processes 251 and 287.  (If you only
kill mysqld, safe_mysqld will probably just start up a new one.)  So the
kill command looks like this, for the PIDs shown above:

% kill -9 251 287

You'll need to run this command either as root (who can kill anything) or
else as the login account used to run the server.

>
>2)
>How to "bring it back with -S (skip grant tables)" ???

Figure out where mysqld is installed (for me, that's
/usr/local/mysql/libexec/mysqld) and invoke it like this (either as
root or as the login account used to run the server):

% /usr/local/mysql/libexec/mysqld -Sg

(As someone else pointed out, the option is -Sg, not just -S.)

>
>3)
>>UPDATE user SET Password=PASSWORD('new-password')
>>WHERE User='root' AND Host='localhost';
>>FLUSH PRIVILEGES;
>
>Is this MySQL. Are this 3 lines 2 commands (because every MySQL command
>ends with a ";")

Yes, two SQL statements.  Connect to the server (you don't need any
user name or password at this point) to use the mysql database:

% mysql mysql

>
>Should the lines look like this:
>[hlutz:/usr/local/mysql] hlutz% UPDATE user SET
>Password=PASSWORD('new-password') WHERE User='root' AND Host='localhost';
>...MySQL message comes here
>[hlutz:/usr/local/mysql] hlutz% FLUSH PRIVILEGES;
>...MySQL message comes here

Run those statements from mysql.

Then quit mysql and shut down the server:

% mysqladmin -p -u root shutdown
Enter password:   <- enter your new password here

Then restart the server however you normally start it.

>
>Thanks, Helmuth

Thread
Re: MySQL 3.23.47 on MacOSX 10.1.2: Could someone help me gettingstartedHelmuth Lutz29 Jan
Re: MySQL 3.23.47 on MacOSX 10.1.2: Could someone help me gettingstartedPaul DuBois29 Jan
AW: MySQL 3.23.47 on MacOSX 10.1.2: Could someone help me gettingstartedHelmuth Lutz29 Jan
AW: MySQL 3.23.47 on MacOSX 10.1.2: Could someone help me gettingstartedHelmuth Lutz30 Jan