Opened 7 years ago

Closed 3 years ago

#10803 closed New feature (wontfix)

dbshell should try 'mysql5' as well for executable name

Reported by: hwaara@… Owned by: Håkan W
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@… 7 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 Håkan W 7 years ago.
Better diff

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by Alex Gaynor

Component: UncategorizedDatabase layer (models, ORM)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Changed 7 years ago by hwaara@…

Attachment: db_executable_name.diff added

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 7 years ago by Alex Gaynor

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

comment:3 Changed 7 years ago by Håkan W

Has patch: set
Owner: changed from nobody to anonymous
Status: newassigned

New patch coming up.

comment:4 Changed 7 years ago by Håkan W

Owner: changed from anonymous to Håkan W
Status: assignednew

Changed 7 years ago by Håkan W

Attachment: db_executable_name.2.diff added

Better diff

comment:5 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

comment:6 Changed 6 years ago by Malcolm Tredinnick

Triage Stage: Design decision neededAccepted

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 6 years ago by Adam Nelson

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 5 years ago by Chris Beaven

Patch needs improvement: set
Severity: Normal
Type: 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 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:10 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:11 Changed 3 years ago by Claude Paroz

Resolution: wontfix
Status: newclosed

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