Another MySQL question

Riga, Anthony Anthony.Riga at searbrown.com
Tue Oct 7 18:54:54 EDT 2003


I am running MYSQL server on Redhat linux at home and when I log on doing 
 prompt> mysql -u root -p
 enter password: 
 
This always works for me. I know if you dont have the -p switch set it will give that error. I went bonkers trying to figure out how to log onto MYSQL when I was learning and setting it up. 

-----Original Message-----
From:	rwechter at liberatortime.com [mailto:rwechter at liberatortime.com]
Sent:	Tue 10/7/2003 12:27 PM
To:	nflug at nflug.org
Cc:	
Subject:	RE: Another MySQL question
I know that this document was true for the Win32 version of MySQL - See if
this helps....


**************************
**************************

Securing A MySQL Install on Windows
The default install of MySQL on Windows allows users to:

Connect as root (with no password) from the localhost or any remote host. A
root user can perform any operation to any database, even delete them.
Connect as an anonymous user (with no username or password). If you are
connecting from localhost, you are allowed root privileges. Otherwise you
are allowed to connect to any database whose name begins with "test"

This leaves your machine in a quite vulnerable state. At the least, you'll
want to assign a password for the root user and delete the anonymous user
privileges if they aren't necessary for your setup.

First, make sure mysql is running. Navigate to your mysql/bin directory
(default is C:\mysql\bin) and click on winmysqladmin.exe. If it prompts you
for a username and password, hit cancel.

Open up a command prompt and type in the following:

C:\mysql\bin>mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('your_password') WHERE User='root';
mysql> FLUSH PRIVILEGES;

And to remove those anonymous user entries in the user table, connect to the
server as root using your new password and delete the rows.

C:\mysql\bin>mysql -p -u root
mysql> USE mysql;
mysql> DELETE FROM user WHERE User='';
mysql> DELETE FROM db WHERE User='';
mysql> FLUSH PRIVILEGES;

Posted by Matt Westgate at June 17, 2003 12:27 PM

**************************
**************************

-----Original Message-----
From: owner-nflug at nflug.org [mailto:owner-nflug at nflug.org]On Behalf Of
One Untraceable
Sent: Tuesday, October 07, 2003 12:05 PM
To: nflug at nflug.org
Subject: Another MySQL question


I have just installed MySQL and I am attempting to set
the root password and here is what I get. When I try
to run "mysqladmin" I keep getting this error:
[root at www bin]# mysqladmin -u root password
'new-password'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root at localhost'
(Using password: NO)'
[root at www bin]#


Anyone have any ideas?

Thanks

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com





-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3855 bytes
Desc: not available
Url : http://www.nflug.org/pipermail/nflug/attachments/20031007/5c7e4f7e/attachment-0001.bin


More information about the nflug mailing list