mysqladmin syntax error

On a fresh install of MySQL 4.1.3B, I'm running this line in the windows command shell before a password has been set:

c:\mysql\bin\mysqladmin -u root password mypassword

. . .and I get the error: "the syntax of the command is incorrect."

. . .and yet the script actually works and sets the password correctly. So why am I getting this error and how can I run the line differently so that the error is not thrown? Mysql.com documentation for mysqladmin is not helpful because they don't give actual examples for setting the initial password.
LVL 11
SweatCoderAsked:
Who is Participating?
 
Duane LawrenceConnect With a Mentor Commented:

I run a PHP MySQL user group and give lectures on how to get MySQL running, the biggest trick is doing the grant on the user in the my.ini file.

#1.
# I downloaded and installed MySQL just fine, Using it is proving
# to be difficult. It should be noted that the "HELP" is in the
# manuals and can be found on the following path:
# file:///C:/mysql/Docs/manual_toc.html

#2. Run c:\mysql\bin\winmysqladmin.exe, it will set up a user
# and a password.
# These are entered into the my.ini file by winmysqladmin.exe.
# You can look them up if you forget. For this purpose,
# the user name is John and the password is foo.

#3.
# IMPORTANT NOTE: THE '#' IS THE BEGINNING OF COMMENTS.
#using the mysql.exe shell from a command line.
#The second mysql specifies the database your connecting to.
mysql mysql -h localhost -u root -p
password
#IMPORTANT: Before I did the above command, when I did a
#'show databases;' the only one I got was the test database.


#4. now grant all to user on the PC your on.
#where testpc is the name of the computer that MySQL is on
#and where xxx is the password.
grant all privileges on *.* to john@testpc identified by 'foo' with grant option;


#5. finally create the database.
create database foo;


#FOOTNOTE:
#CANT RUN MYSQL.EXE
#Add "c:\mysql\bin" to the "path" in system variables.
# That is assuming you installed MySQL to the "c:\mysql"
# How to get there: Open the control panel in Windows,
# open the system, goto the advanced tab, click on the
# "enviornment variables" button, edit the path and add
# the above.


This can be found on
http://www.duanelawrence.com/ex_MySQL_installation_guide.shtml

Or join the group
PHP_MySQL_usergroup-subscribe@yahoogroups.com

0
 
Duane LawrenceCommented:
Its a good answer.  It took me weeks to work it out.  The largest problem being the lack of instructions on granting privelges.  This is a complete instruction on how to install MySQL and get it running to where you can actually insert data.

Duane
0
 
SweatCoderAuthor Commented:
ok, i'll buy it. a bit too general for me because it didn't specifically answer my question, but still some good info there. case closed.
0
All Courses

From novice to tech pro — start learning today.