Hi,

On 3/5/08 5:58 AM, "Thufir" <[EMAIL PROTECTED]> wrote:

> On Tue, 04 Mar 2008 08:44:47 -0500, Dan Rogart wrote:
> 
>> You can have a file called .my.cnf in your home directory that stores
>> it.
> 
> 
> Ah, thanks.  I don't have a .my.cnf file in my home directory, but I do
> have something in /etc which seems to be what I'm after.  I can get it
> working for logging into MySQL as the root db admin but can't add the
> "rails" MySQL user so that user thufir can login to MySQL as "rails"
> passing the password from /etc/my.cnf (too many pronouns for that to make
> sense).
> 
> Some success:
> 
> [EMAIL PROTECTED] ~ $
> [EMAIL PROTECTED] ~ $
> [EMAIL PROTECTED] ~ $ mysql -u root
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 20
> Server version: 5.0.44-log Gentoo Linux mysql-5.0.44
> 
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
> 
> mysql> quit
> Bye
> [EMAIL PROTECTED] ~ $ head /etc/mysql/my.cnf -n 7
> # /etc/mysql/my.cnf: The global mysql configuration file.
> # $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.1,v 1.3
> 2006/05/05 19:51:40 chtekk Exp $
> 
> # The following options will be passed to all MySQL clients
> [client]
> user                                            = root
> password                                        = password
> [EMAIL PROTECTED] ~ $
> 
> 
> 
> do I need to create a local .my.cnf file?
> 
> 
> thanks,
> 
> Thufir
> 

/etc/my.cnf sets things globally, so if you put your root password in there
then anyone who logs on to that box can just type 'mysql' and log on to your
database instance with root privileges.  That may or may not be a problem
for you.

If you want to easily log in as the user 'rails' when you have logged in to
the box as thufir, then yes, you should create a local .my.cnf file in
~/thufir with the rails credentials.

I think that should do it for you.

-Dan


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to