Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to setup/configure mysql on w2k? 1

Status
Not open for further replies.

cyan01

Programmer
Mar 13, 2002
143
US
I recently installed mysql-essential-4.1.9-win32 and with some friends' help at this forum, I can logon mysql server fine. Now, I have some further questions. I appreciate your attention and help very much.

1) According a book I have (Beginning JSP 2.0), I should run the following command:

mysql> delete from user where host = 'localhost' and user=''

However, when I check how many users in table user, I got:

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql -u root -p123abc
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.9-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Database changed
mysql> select host, user from user;
+-----------+------+
| host | user |
+-----------+------+
| % | |
| localhost | root |
+-----------+------+
2 rows in set (0.00 sec)

It indicates that only one user in this table. Is this normal?

2. According to the same book, I should also run the following 2 commands:

> mysqladmin reload
> mysqladim -u root password {my_new_passwd}

However, I got these error messages:

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqladmin reload
mysqladmin: reload failed; error: 'Access denied; you need the RELOAD privilege for this operation'

What should I do now?

Many thanks for your help!
 
There are two users in this table, "root" connecting from localhost, and an anonymous user connecting from anywhere (indicated by "%"). This is the table I set up for you (remember?).

You don't need to touch mysqladmin. Anything it can do can be done with SQL.

If you want to change the password for a user (root at localhost for example), you can use the following SQL:[tt]
UPDATE mysql.user
SET password=PASSWORD('456def')
WHERE user='root' AND host='localhost';[/tt]
followed by:[tt]
FLUSH PRIVILEGES;[/tt]
to commit the changes.
 
I do remember! But I didn't know '%' would mean something. :(

Thank you so much. I appreaciate your help!

In addition, I am still curious why I can not execute mysqladmin? There must be a way to run it, right?
 
To use mysqladmin to change your password, you would use the syntax:[tt]
mysqladmin -u root -p123abc password 456def[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top