Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

This is a fairly simple question but I'm new to mySQL. To log on to
mySQL I need to type at the prompt:

mysql --user='username' --password='password'

as opposed to just typing mysql and being recognized without having to
type identification. Anyone know how I can change this??


Re: permissions

Either you have an anonymous user (which is registered as a user with an
empty string) or this information is already stored in the my.ini (Windows)
or my.cnf (Linux) configuration file.

To find out if there's an anonymous user, type (from an admin user)

select Host, User, Password from mysql.user;

If there's a user with an empty string, you can delete him with

delete from mysql.user where User = '';
flush privileges;

Maybe, the user and password is registered in the configuration file (by
default in Windows in the MySQL home directory or in Linux in the /etc
directory) in the section [mysql] or [client], which looks like this:

user = username
password = password

If you delete these lines, you will be prompted for the password (and have
to specify a user name).


Site Timeline