Unix Technical Forum

Clarification please: starting the MySQL service

This is a discussion on Clarification please: starting the MySQL service within the MySQL forums, part of the Database Server Software category; --> I am a couple of simple questions that the documentation just doesn't seem straight forward about : 1. On ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2008, 02:40 PM
Topaz
 
Posts: n/a
Default Clarification please: starting the MySQL service

I am a couple of simple questions that the documentation just doesn't
seem straight forward about:

1. On a Windows MySQL post-4.0 installation, does typing:
C:\> mysqld-nt . . .
install the service and/or start the service ?

2. Is the defaults-file (my.ini) read when the service is installed or
when it is started?

3. To solve the "lost root password" problem does the method
a. run mysqld-nt --init-file= . . .
now replace the method
b. run mysqld-nt --skip-grant-tables . . .
and
c. does a. work when there IS already a (forgotten) root password?
(Note the Manual page 5.0/B.1.4.1 suggests that you may also have to
use a --defaults-file=, but it is ambiguous if this is necessary for
the --init-file run or not. It is "obviously" necessary for the
subsequent main service restart.)

Thanks in advance.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 02:40 PM
Jerry Stuckle
 
Posts: n/a
Default Re: Clarification please: starting the MySQL service

Hi, Topaz,

Answers inline...

Topaz wrote:
> I am a couple of simple questions that the documentation just doesn't
> seem straight forward about:
>
> 1. On a Windows MySQL post-4.0 installation, does typing:
> C:\> mysqld-nt . . .
> install the service and/or start the service ?
>


Neither. It starts it as a program. To install as a service, see
http://dev.mysql.com/doc/refman/5.1/...t-service.html.

> 2. Is the defaults-file (my.ini) read when the service is installed or
> when it is started?
>


When the service is started.

> 3. To solve the "lost root password" problem does the method
> a. run mysqld-nt --init-file= . . .
> now replace the method
> b. run mysqld-nt --skip-grant-tables . . .
> and
> c. does a. work when there IS already a (forgotten) root password?
> (Note the Manual page 5.0/B.1.4.1 suggests that you may also have to
> use a --defaults-file=, but it is ambiguous if this is necessary for
> the --init-file run or not. It is "obviously" necessary for the
> subsequent main service restart.)
>
> Thanks in advance.
>
>


No. --init-file just gives a series of SQL commands once the service is
started. You must still have the correct authorization to perform the
SQL statements in the file.

To access MySQL when you've forgotten your root password, you must use
--skip-grant-tables.

The --defaults-file parameter just allows you to start MySQL with a
different options file.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 02:40 PM
Topaz
 
Posts: n/a
Default Re: Clarification please: starting the MySQL service

Jerry,
Thanks Jerry, these answers clear my head a bit.

But the manual definitely implies that section B.1.4.1
http://dev.mysql.com/doc/refman/5.1/...rmissions.html
is for forgotten passwords. I paste:
"If you set a root password previously, but have forgotten what it
was, you can set a new password. The next two sections show procedures
for Windows and Unix systems, respectively."
Nowhere in this procedure does is say that you have to submit the root
password in order to change it.
The second oddity is that they stop the service, then run mysqld -init-
file. Your reply suggest that this is just running mysqld as a
program, which presumeably will exit after the SQL statements in the
init-file are executed.

Can you shed any erudite light on this ?
Topaz


On 14 mei, 18:17, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Hi, Topaz,
>
> Answers inline...
>
> Topaz wrote:
> > I am a couple of simple questions that the documentation just doesn't
> > seem straight forward about:

>
> > 1. On a Windows MySQL post-4.0 installation, does typing:
> > C:\> mysqld-nt . . .
> > install the service and/or start the service ?

>
> Neither. *It starts it as a program. *To install as a service, seehttp://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html.
>
> > 2. Is the defaults-file (my.ini) read when the service is installed or
> > when it is started?

>
> When the service is started.
>
> > 3. *To solve the "lost root password" problem does the method
> > a. run mysqld-nt --init-file= . . .
> > now replace the method
> > b. run mysqld-nt --skip-grant-tables . . .
> > and
> > c. does a. work when there IS already a (forgotten) root password?
> > (Note the Manual page 5.0/B.1.4.1 suggests that you may also have to
> > use a --defaults-file=, but it is ambiguous if this is necessary for
> > the --init-file run or not. *It is "obviously" necessary for the
> > subsequent main service restart.)

>
> > Thanks in advance.

>
> No. *--init-file just gives a series of SQL commands once the service is
> started. *You must still have the correct authorization to perform the
> SQL statements in the file.
>
> To access MySQL when you've forgotten your root password, you must use
> --skip-grant-tables.
>
> The --defaults-file parameter just allows you to start MySQL with a
> different options file.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-16-2008, 02:40 PM
Jerry Stuckle
 
Posts: n/a
Default Re: Clarification please: starting the MySQL service

Topaz wrote:
> Jerry,
> Thanks Jerry, these answers clear my head a bit.
>
> But the manual definitely implies that section B.1.4.1
> http://dev.mysql.com/doc/refman/5.1/...rmissions.html
> is for forgotten passwords. I paste:
> "If you set a root password previously, but have forgotten what it
> was, you can set a new password. The next two sections show procedures
> for Windows and Unix systems, respectively."
> Nowhere in this procedure does is say that you have to submit the root
> password in order to change it.
> The second oddity is that they stop the service, then run mysqld -init-
> file. Your reply suggest that this is just running mysqld as a
> program, which presumeably will exit after the SQL statements in the
> init-file are executed.
>
> Can you shed any erudite light on this ?
> Topaz
>
>
> On 14 mei, 18:17, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Hi, Topaz,
>>
>> Answers inline...
>>
>> Topaz wrote:
>>> I am a couple of simple questions that the documentation just doesn't
>>> seem straight forward about:
>>> 1. On a Windows MySQL post-4.0 installation, does typing:
>>> C:\> mysqld-nt . . .
>>> install the service and/or start the service ?

>> Neither. It starts it as a program. To install as a service, seehttp://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html.
>>
>>> 2. Is the defaults-file (my.ini) read when the service is installed or
>>> when it is started?

>> When the service is started.
>>
>>> 3. To solve the "lost root password" problem does the method
>>> a. run mysqld-nt --init-file= . . .
>>> now replace the method
>>> b. run mysqld-nt --skip-grant-tables . . .
>>> and
>>> c. does a. work when there IS already a (forgotten) root password?
>>> (Note the Manual page 5.0/B.1.4.1 suggests that you may also have to
>>> use a --defaults-file=, but it is ambiguous if this is necessary for
>>> the --init-file run or not. It is "obviously" necessary for the
>>> subsequent main service restart.)
>>> Thanks in advance.

>> No. --init-file just gives a series of SQL commands once the service is
>> started. You must still have the correct authorization to perform the
>> SQL statements in the file.
>>
>> To access MySQL when you've forgotten your root password, you must use
>> --skip-grant-tables.
>>
>> The --defaults-file parameter just allows you to start MySQL with a
>> different options file.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================

>
>


Ah, yes - my mistake. The --init-file seems to run before authorization
is set up. I didn't realize that.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com