Edgewall Software
Modify

Opened 7 years ago

Closed 7 years ago

#12698 closed enhancement (wontfix)

Using ~/.my.cnf instead of Database connection string

Reported by: arcadius <arcadius@…> Owned by:
Priority: normal Milestone:
Component: general Version: 1.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

On FreeBSD, I try to backup enviroment:

# trac-admin path/to/enviroment hotcopy path/to/backup
Hotcopying path/to/enviroment to path/to/backup ...
Backing up database ...
TracError: mysqldump failed: mysqldump: Got error: 1045: Access denied for user 'trac'@'localhost' (using password: YES) when trying to connect

When I remove (rename) ~/.my.cnf which describes some other MySQL user, not 'trac'@'localhost' (who is the only one having access to Trac's database), hotcopying succeeds.

trac-admin should prefer data in Database connection string, not in ~/.my.cnf.

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 7 years ago

No. Trac Environment, tracd, trac-admin, … shouldn't depend on $HOME/.my.cnf file (Whose home directory? root? apache? someone?). Use read_default_file parameter if you want to use .my.cnf. See DatabaseBackend#MySQL.

However, mysqldump via hotcopy have to work even if ~/.my.cnf is existent or not.

comment:2 by anonymous, 7 years ago

There's no read_default_file in my project's trac.ini and parameters in [inherit] section are empty.

trac-admin ends with error when:

  1. FreeBSD user, who has run it, has .my.cnf in his home directory, and
  2. MySQL credential specified there has no access to Trac's database.

comment:3 by Jun Omae, 7 years ago

Resolution: wontfix
Status: newclosed
Type: defectenhancement

read_default_file is in database connection string.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.