Opened 6 years ago

Closed 2 years ago

#10803 closed New feature (wontfix)

dbshell should try 'mysql5' as well for executable name

Reported by: hwaara@… Owned by: hakanw
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Many of us who install mysql through MacPorts on OS X have the mysql executable named "mysql5". So when I try to do {{( python manage.py dbshell }} , I get this error:

./manage.py dbshell
Error: You appear not to have the 'mysql' program installed or on your path.

I propose that django should also try to use the client with this executable name ("mysql5") rather than just failing if it can't find "mysql".

Attachments (2)

db_executable_name.diff (6.1 KB) - added by hwaara@… 6 years ago.
Make the different backends' clients share the code for executing the dbshell, and make it possible to specify a list of executable names to try.
db_executable_name.2.diff (5.7 KB) - added by hakanw 6 years ago.
Better diff

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by Alex

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Changed 6 years ago by hwaara@…

Make the different backends' clients share the code for executing the dbshell, and make it possible to specify a list of executable names to try.

comment:2 Changed 6 years ago by Alex

Please create diffs relative to the root of the Django source tree, not your filesystem.

comment:3 Changed 6 years ago by hakanw

  • Has patch set
  • Owner changed from nobody to anonymous
  • Status changed from new to assigned

New patch coming up.

comment:4 Changed 6 years ago by hakanw

  • Owner changed from anonymous to hakanw
  • Status changed from assigned to new

Changed 6 years ago by hakanw

Better diff

comment:5 Changed 6 years ago by Alex

  • Triage Stage changed from Unreviewed to Design decision needed

comment:6 Changed 5 years ago by mtredinnick

  • Triage Stage changed from Design decision needed to Accepted

Haven't reviewed the patch in too much detail for subtle problems (it commits the sin of doing two things in one patch, making life harder for reviewers), but the concept is sound. If that binary name is going to be common for a large set of users, then it's worth supporting, since trying one extra binary name is hardly challenging.

comment:7 Changed 4 years ago by adamnelson

Most developers are using HomeBrew for Mac development now and I've never run into any other installation that uses 'mysql5' for the mysql CLI. I propose that this be dropped if there isn't momentum to write a test and for anybody else to mark this as ready for checkin.

comment:8 Changed 4 years ago by SmileyChris

  • Patch needs improvement set
  • Severity set to Normal
  • Type set to New feature

It'd also be nicer if the change continued to respect executable_name as other backends may rely on this.

comment:9 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:10 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:11 Changed 2 years ago by claudep

  • Resolution set to wontfix
  • Status changed from new to closed

I don't think this is Django's task to try various executable names. This can be solved at system level by aliasing commands.

Note: See TracTickets for help on using tickets.
Back to Top