mroonga / homebrew-mroonga

The homebrew formula for Mroonga.
7 stars 13 forks source link

Add brew switch to README #9

Closed ogom closed 7 years ago

ogom commented 7 years ago

"Can't open shared library" ERROR in plugin installation. So I'm added brew switch to README.

mysql> INSTALL PLUGIN Mroonga SONAME 'ha_mroonga.so';
ERROR 1126 (HY000): Can't open shared library '/usr/local/Cellar/mysql56/5.6.34/lib/plugin/ha_mroonga.so' (errno: 2 dlopen(/usr/local/Cellar/mysql56/5.6.34/lib/plugin/ha_mroonga.so, 2): image not found)

process of brew switch

$ brew install homebrew/versions/mysql56
==> Installing mysql56 from homebrew/versions
==> Downloading https://homebrew.bintray.com/bottles-versions/mysql56-5.6.34.el_capitan.bottle.tar.gz
$ mysql --version
mysql  Ver 14.14 Distrib 5.6.34, for osx10.11 (x86_64) using  EditLine wrapper
$ mysql -uroot
mysql> show variables like 'version';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| version       | 5.6.34 |
+---------------+--------+
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist
$ mysql.server stop
$ brew install https://raw.github.com/mroonga/homebrew/master/mroonga.rb --use-homebrew-mysql
==> Downloading http://packages.groonga.org/source/mroonga/mroonga-6.10.tar.gz
Already downloaded: /Users/ogom/Library/Caches/Homebrew/mroonga-6.10.tar.gz
==> Downloading https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.16.tar.gz
Already downloaded: /Users/ogom/Library/Caches/Homebrew/mysql-5.7.16.tar.gz
$ brew switch mysql 5.7.16
$ brew link --overwrite mysql
$ mysql --version
mysql  Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using  EditLine wrapper
$ mysql_upgrade -u root
$ mysql.server start
$ mysql -uroot
mysql> show variables like 'version';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| version       | 5.7.16 |
+---------------+--------+

mysql> INSTALL PLUGIN Mroonga SONAME 'ha_mroonga.so';
mysql> show variables like 'mroonga_version';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| mroonga_version | 6.10  |
+-----------------+-------+
ogom commented 7 years ago

It is a new process to unlink before installing.

process of brew unlink

$ brew install homebrew/versions/mysql56
$ brew services start mysql56
$ mysql -uroot
mysql> show variables like 'version';
$ brew services stop mysql56
$ brew unlink mysql56
$ mv /usr/local/var/mysql /usr/local/var/mysql_56
$ brew install https://raw.github.com/mroonga/homebrew/master/mroonga.rb --use-homebrew-mysql
$ brew services start mysql
$ mysql -uroot < '/usr/local/Cellar/mroonga/6.10/share/mroonga/install.sql'