Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Sep 2002 14:54:43 -0700
From:      Blake Swensen <blake@pyramus.com>
To:        Jeff Jeter <gsfgf@softhome.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Mysql won't let me in -- Update
Message-ID:  <3D728CA3.3080203@pyramus.com>
References:  <20020831114147.39c550b7.gsfgf@softhome.net>	<3D70C959.19129.39875B56@localhost> <20020901151654.2ca551ad.gsfgf@softhome.net>

next in thread | previous in thread | raw e-mail | index | archive | help
You need to connect to the server locally then log into the MySQL server 
as root using:

% mysql -u root -p
 
then you have to grant access to the desired database to the particular 
user at the particular host... like:

 > use mysql
 > grant all on database.* to username@host identified by 'password'

You can wildcard the host name by using '%'

username@'%domainname': gives access to that username at any host on 
your domain
username@'10.10.%' : gives access to that user at any host on your 
private network.
username@'%': gives access to that user from ANY machine on the network

Two words of caution: I have noticed that granting the user access to 
specified database@localhost first makes access run a little smoother. 
 NEVER do this: grant all on *.* to root@'%' ... this will open a door 
to root access from any machine on the network.. ill advised.  In fact 
you should never grant any rights to root except root@localhost.

Finally the only user/machines that need access are your webserver and 
any development machines that connect via ODBC, etc.

Peace,
Blake

Jeff Jeter wrote:

>I got it eorking locally, but when i try to connect remotely "mysql -h server" it hangs.  How do i allow access.  I can't connect w/ ftp, nfs, or telnet to this box either.  my /etc/hosts.allow is "ALL : ALL : allow"
>
>
>On Sat, 31 Aug 2002 13:49:13 -0700
>"Corey Snow" <corey@snowpoint.com> wrote:
>
>>On 31 Aug 2002, at 11:41, Jeff Jeter wrote:
>>
>>>I installed mysql, started it with safe_mysqld, and changed the root password w/ mysql admin.  mysqladmin -u root password ********  now when i try to create a databas w/ mysql admin it won't accept a pass.
>>>
>>>mysqladmin create mini 
>>>mysqladmin: connect to server at 'localhost' failed
>>>error: 'Access denied for user: ' root@localhost' (Using password:NO)'
>>>
>>Try just 
>>
>>%mysql -u root -p
>>
>>Which should prompt you for the password. You might also try 
>>"root@servername" as the user ID, but that's a long shot.
>>
>>Corey
>>
>>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D728CA3.3080203>