Software development, photography, jokes, ....

Sites by me

 
tas-logoTransportation Administration System
snoezelkussen-logo-kleinstSnoezelkussens voor verstandelijk gehandicapten
ikzoekeenbegeleider-logoBegeleiders voor gehandicapten
Laat uw hond het jaarlijkse vuurwerk overwinnen
Betuweroute en Kunst
logo 50x50Hey Vos! Je eigen naam@vos.net emailadres?
Kunst in huis? Nicole Karrèr maakt echt bijzonder mooie dingen
nettylogo2Kunst in huis? Netty Franssen maakt ook bijzonder mooie dingen
Professionele opvang bij Gastouderbureau
Kind-Zijn
Salarisadministratie en belastingadvies bij
De Zaak Loont
Zutphense Bomenstichting

Hosting Favorites

 
ANU Internet Services
XelMedia .internet Services
register.com

Blogroll

 
Bomenstichting
LassoSoft
MacFreak
Quality that computes
The Economy of Motion
Wheel 2.0
IntrAktv



Website Hosting bij Xel Media

Marc's Place


 

[Repair] MySQL Upgrade on Mac OS X


The following are instructions to help you repair a MySQL upgrade after running the package-installer for a newer MySQL version.
These steps can also be followed before you install a new version, just leave out the steps for the 5.6 version.

Some of these instructions can also be used on CentOS, or maybe other flavours of Linux. But on those systems, it is common practice to remove the old version and install a new version via yum.



1. Delete installation receipts:

$ su root
$ rm -rf /var/db/receipts/com.mysql.*


2. Delete current installations, except the one which /data-directory you want to keep:

$ cd /usr/local
$ ls -l
lrwxr-xr-x    1 root     wheel    27 22 feb 10:30 mysql -> mysql-5.6.29-osx10.8-x86_64
drwxr-xr-x    4 root     wheel   136 22 feb 14:08 mysql-5.1.37-osx10.5-x86
drwxr-xr-x   16 root     wheel   544 22 feb 10:30 mysql-5.6.29-osx10.8-x86_64


3. In this case, the mysql-5.1.37-osx10.5-x86 folder contains all data, i.e. my databases.
Rename this folder to something like mysql_previous:

$ ls -l
lrwxr-xr-x    1 root     wheel    27 22 feb 10:30 mysql -> mysql-5.6.29-osx10.8-x86_64
drwxr-xr-x   16 root     wheel   544 22 feb 10:30 mysql-5.6.29-osx10.8-x86_64
drwxr-xr-x    4 root     wheel   136 22 feb 14:08 mysql_previous


4. Remove the complete mysql instance and all other relevant files:

$ cd mysql-5.6.29-osx10.8-x86_64
$ rm -rf *

$ cd ..
$ rm mysql
$ rmdir mysql-5.6.29-osx10.8-x86_64

$ cd /Library/StartupItems/
$ rm -rf *MySQL*

$ cd /Library/PreferencePanes
$ rm -rf *MySQL*

$ vi /etc/hostconfig
[remove the line MYSQLCOM=….]

$ vi /Library/Receipts/InstallHistory.plist
[remove
        <dict>
                <key>date</key>
                <date>2016-02-22T09:30:17Z</date>
                <key>displayName</key>
                <string>MySQL 5.6.29-community</string>
                <key>displayVersion</key>
                <string></string>
                <key>packageIdentifiers</key>
                <array>
                        <string>com.mysql.mysql</string>
                        <string>com.mysql.prefpane</string>
                        <string>com.mysql.launchd</string>
                </array>
                <key>processName</key>
                <string>Installer</string>
        </dict>

]


$ launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist
$ launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
$ ps -ef | grep -i mysql
    0 20842 20833   0  8:14pm ttys000    0:00.00 grep -i mysql

$ cd /Library/LaunchDaemons/
$ ls -l *mysql*
-rw-r--r--  1 root  wheel   348 27 mei  2015 com.mysql.mysql.plist
-rw-r--r--  1 root  wheel  1370 15 jan 04:16 com.oracle.oss.mysql.mysqld.plist
$ rm -f *mysql*

$ cd /usr/local
$ vi copy_mysql_tables.sh
[change cq. add these copy commands:
cp -Rp mysql_previous/data/actman_pristine    mysql/data/
cp -Rp mysql_previous/data/audi            mysql/data/
cp -Rp mysql_previous/data/b1000        mysql/data/
cp -Rp mysql_previous/data/begeleider        mysql/data/
cp -Rp mysql_previous/data/BSZBlogger        mysql/data/
cp -Rp mysql_previous/data/bu2012        mysql/data/
cp -Rp mysql_previous/data/daimler        mysql/data/
cp -Rp mysql_previous/data/fcs_rgl        mysql/data
cp -Rp mysql_previous/data/fse_auth        mysql/data/
cp -Rp mysql_previous/data/fse_dta        mysql/data/
cp -Rp mysql_previous/data/fse_ttt        mysql/data/
cp -Rp mysql_previous/data/fse_ttt_if        mysql/data/
cp -Rp mysql_previous/data/handidate        mysql/data/
cp -Rp mysql_previous/data/logdict        mysql/data/
cp -Rp mysql_previous/data/lwa_fw        mysql/data/
cp -Rp mysql_previous/data/proftpd        mysql/data/
cp -Rp mysql_previous/data/sds82        mysql/data/
cp -Rp mysql_previous/data/tas            mysql/data/
cp -Rp mysql_previous/data/wht            mysql/data/
]

$ chmod a+x copy_mysql_tables.sh

$ cd /usr/local/lib/mysql
$ rm -rf *
$ cd ..
$ rmdir mysql


At this point, RESTART YOUR MAC



Install the new MySQL version


5. Download MySQL, for example the latest 5.6 and install.

6. Check if it is running via System Preferences -> MySQL (and eventually start it via this preference pane)

7. Start Navicat  or MySQL Workbench and login with user root without password and then set the password. Logout and login again with password.

8. Create the user lasso for both Lasso 8 and Lasso 9, and set passwords for other root-users

9. Run the copy script:

$ su root
$ cd /usr/local
$ ./copy_mysql_tables.sh
$ mysql_upgrade -uroot -p --force


and then restart MySQL in one of these ways:

$ /etc/init.d/mysqld restart (CentOS 6)
    of
$ service mysqld restart
    of
$ service mysql restart

10) Start Navicat  or MySQL Workbench and check if all databases show in localhost.

11) Now you can remove the previous MySQL version:

$ cd /usr/local/mysql_previous
$ rm -rf *
$ cd ..
$ rmdir mysql_previous


12) Check if both Lasso 8 and Lasso 9 have access:
- By running http://localuser/[webapp], or
- By checking in SiteAdmin (L8) and/or Lux (L9).

DONE
© 1997- Marc Vos (and others) Contact Me