Bug 47834

Summary: mysql-server-3.23.55 upgrade should be more informative
Product: Ports & Packages Reporter: Chris Pepper <pepper>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me CC: dirk
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Chris Pepper 2003-02-03 03:00:24 UTC
	portupgrade offers to upgrade mysql-client, but the upgrade fails in a somewhat helpful way.

--->  Upgrading 'mysql-server-3.23.53_4' to 'mysql-server-3.23.55' (databases/mysql323-server)

	produces the following:

===>  Installing for mysql-server-3.23.55
===>   mysql-server-3.23.55 depends on executable: mysql - found
===>   mysql-server-3.23.55 depends on file: /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/Mysql.pm - found
You appear to already have a mysql database directory in /var/db/mysql.

In order to preserve your existing data, you should:
        - dump all your databases
        - kill mysql if it is running
        - delete the /var/db/mysql directory
        - run 'make install'
        - start up mysql
        - re-create all of your database
        - re-load your data

If you understand the consequences of this upgrade, please re-build this
port with the environment variable OVERWRITE_DB defined.
*** Error code 1

Stop in /usr/ports/databases/mysql323-server.
*** Error code 1

Stop in /usr/ports/databases/mysql323-server.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade57445.25 make reinstall
--->  Updating dependency info
egrep: /var/db/pkg/mysql-server-3.23.53_4/+CONTENTS: No such file or directory
--->  Restoring the old version
Installing all prepared tables
030202 21:23:45  /usr/local/libexec/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/local/bin/mysqladmin -u root  password 'new-password'
/usr/local/bin/mysqladmin -u root -h www  password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/local/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /usr/local ; /usr/local/bin/safe_mysqld &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; run-all-tests

Please report any problems with the /usr/local/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

mysql:*:88:
You already have a group "mysql", so I will use it.
mysql:*:88:88::0:0:MySQL Daemon:/var/db/mysql:/sbin/nologin
You already have a user "mysql", so I will use it.
Changed home directory of "mysql" to "/var/db/mysql"
** Fix the installation problem and try again.
--->  Installation of databases/mysql323-server ended at: Sun, 02 Feb 2003 21:23:45 -0500 (consumed 00:00:05)
--->  Upgrade of databases/mysql323-server ended at: Sun, 02 Feb 2003 21:23:45 -0500 (consumed 00:07:40)
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 116 packages found (-0 +1) . done]

	1) The upgrade aborts, telling the user to dump and reload data, but doesn't provide the commands to accomplish this (a URL with export, create, and import procedures would be very helpful). Additionally, "make -DOVERWRITE_DB install" should probably be a step in the suggested procedure.

	2) After aborting, the upgrade continues to show the new-mysql-server-installed messages, which is misleading.

	3) The aborted upgrade leaves the old server in place, but not running. It would be very helpful to tell the user that the old installation is still available, but stopped. I thought it was broken at first.

Fix: 

Enhance the suggested upgrade procedure with the appropriate make command and specifics on how to export and reimport the dbs, or URLs for the information.
	In the abort message, state that the old version has been retained, and can be restarted.
	Avoid the messges on how to set up a new mysql325-server installation if it wasn't actually installed.
	Enhance portupgrade or the ports system so mysql can test for the presence of an older version without compiling the new version, to save time.
How-To-Repeat: 	Install mysql323-server and create a few dbs; then portupgrade to get the new one; tell it to upgrade, and watch the errors.
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2003-02-16 00:36:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dirk

Over to Maintainer
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2003-10-25 07:49:24 UTC
Responsible Changed
From-To: dirk->freebsd-ports-bugs

dirk no longer maintains this port, so set this PR free. 

Reviewed by: marcus.
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2004-01-16 09:27:59 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to qualified sorceror.
Comment 4 Alex Dupre freebsd_committer freebsd_triage 2004-01-17 12:50:19 UTC
State Changed
From-To: open->closed

Fixed with recent port update.