Opened 15 years ago

Last modified 10 years ago

#20949 assigned defect

mysql5: mysql_upgrade5 expects 'mysql' instead of 'mysql5'

Reported by: ora.et.labora@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: gamperl@…, contact@…, lhunath@…, d@…
Port: mysql5

Description (last modified by nerdling (Jeremy Lavergne))

$ mysql_upgrade5
Looking for 'mysql' as: mysql
FATAL ERROR: Can't execute 'mysql'

Change History (13)

comment:1 Changed 15 years ago by nerdling (Jeremy Lavergne)

Description: modified (diff)
Owner: changed from macports-tickets@… to ryandesign@…
Port: @5.0.85 removed

comment:2 Changed 14 years ago by gamperl@…

Cc: gamperl@… added

Cc Me!

comment:3 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned
Summary: mysql_update5 expects 'mysql' instead of 'mysql5'mysql5: mysql_upgrade5 expects 'mysql' instead of 'mysql5'

Confirmed in mysql5 @5.1.41_0. Need to check if mysql5-devel @5.4.x is also affected.

comment:4 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

A workaround for now is to call the script by its full canonical name:

/opt/local/lib/mysql5/bin/mysql_upgrade

comment:5 Changed 14 years ago by dweber@…

How about symlinks?

for f in /opt/local/bin/mysql*; do
  symlink=$(echo $f | sed s/5$//);
  echo "ln -s $symlink $f";
done

Gives:

ln -s /opt/local/bin/mysql /opt/local/bin/mysql5
ln -s /opt/local/bin/mysql_client_test /opt/local/bin/mysql_client_test5
ln -s /opt/local/bin/mysql_client_test_embedded /opt/local/bin/mysql_client_test_embedded5
ln -s /opt/local/bin/mysql_config /opt/local/bin/mysql_config5
ln -s /opt/local/bin/mysql_convert_table_format /opt/local/bin/mysql_convert_table_format5
ln -s /opt/local/bin/mysql_find_rows /opt/local/bin/mysql_find_rows5
ln -s /opt/local/bin/mysql_fix_extensions /opt/local/bin/mysql_fix_extensions5
ln -s /opt/local/bin/mysql_fix_privilege_tables /opt/local/bin/mysql_fix_privilege_tables5
ln -s /opt/local/bin/mysql_install_db /opt/local/bin/mysql_install_db5
ln -s /opt/local/bin/mysql_secure_installation /opt/local/bin/mysql_secure_installation5
ln -s /opt/local/bin/mysql_setpermission /opt/local/bin/mysql_setpermission5
ln -s /opt/local/bin/mysql_tzinfo_to_sql /opt/local/bin/mysql_tzinfo_to_sql5
ln -s /opt/local/bin/mysql_upgrade /opt/local/bin/mysql_upgrade5
ln -s /opt/local/bin/mysql_waitpid /opt/local/bin/mysql_waitpid5
ln -s /opt/local/bin/mysql_zap /opt/local/bin/mysql_zap5
ln -s /opt/local/bin/mysqlaccess /opt/local/bin/mysqlaccess5
ln -s /opt/local/bin/mysqladmin /opt/local/bin/mysqladmin5
ln -s /opt/local/bin/mysqlbinlog /opt/local/bin/mysqlbinlog5
ln -s /opt/local/bin/mysqlbug /opt/local/bin/mysqlbug5
ln -s /opt/local/bin/mysqlcheck /opt/local/bin/mysqlcheck5
ln -s /opt/local/bin/mysqld_multi /opt/local/bin/mysqld_multi5
ln -s /opt/local/bin/mysqld_safe /opt/local/bin/mysqld_safe5
ln -s /opt/local/bin/mysqldump /opt/local/bin/mysqldump5
ln -s /opt/local/bin/mysqldumpslow /opt/local/bin/mysqldumpslow5
ln -s /opt/local/bin/mysqlhotcopy /opt/local/bin/mysqlhotcopy5
ln -s /opt/local/bin/mysqlimport /opt/local/bin/mysqlimport5
ln -s /opt/local/bin/mysqlshow /opt/local/bin/mysqlshow5
ln -s /opt/local/bin/mysqlslap /opt/local/bin/mysqlslap5
ln -s /opt/local/bin/mysqltest /opt/local/bin/mysqltest5
ln -s /opt/local/bin/mysqltest_embedded /opt/local/bin/mysqltest_embedded5

Maybe only for a stable version of mysql?

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

No, we don't want symlinks in /opt/local/bin without the major version number; if we wanted the files in there without the major version number we'd just remove all the munging we do in the port to add the major version number in the first place. Presumably we want the major version number appended so that we can install multiple versions of MySQL simultaneously. Installing mysql4 and mysql5 is no longer very interesting since MySQL 4 is so old now, but installing MySQL 5.0, 5.1 and 5.5 simultaneously is interesting and has already been requested a couple times. The mysql5 port should be renamed mysql51, a new mysql50 port should be created, the mysql5-devel port should be renamed mysql55, and they should all not conflict with one another and should install files with the appropriate suffixes. See #4115 and #22251.

For this ticket, we want a solution that allows running mysql_upgrade5 to work.

comment:7 Changed 14 years ago by contact@…

Cc: contact@… added

Cc Me!

comment:8 Changed 13 years ago by lhunath@…

Cc: lhunath@… added

Cc Me!

comment:9 Changed 13 years ago by d@…

The problem with a lack of things like "mysql_config" is that other utilities and build scripts that depend on there being a central mysql installation, often fail. There should definitely be a way to set ONE mysql installation as the default, just like you can select a default python version. If there already is such a thing, I have not found it, and for this I apologize. Even if the macports scripts all work, other installations often fail and cause serious pains. The only solution I've found is to put /opt/local/lib/mysql5/bin into the $PATH, which is not a solution IMHO.

comment:10 Changed 13 years ago by d@…

Cc: d@… added

Cc Me!

comment:11 in reply to:  9 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to d@…:

There should definitely be a way to set ONE mysql installation as the default,

That's requested in #29907.

comment:12 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #29991.

comment:13 in reply to:  12 Changed 10 years ago by cooljeanius (Eric Gallager)

Replying to ryandesign@…:

Has duplicate #29991.

And now also #40606 with mysql56.

Note: See TracTickets for help on using tickets.