How do I add additional versions of mysql to homebrew cellar - mysql

I used homebrew to install mysql and it installed 5.6.15. I need to have some version of 5.5 installed. Currently in usr/local/Cellar I have just 5.6.15, how can I add an older version to that so I can use the 'brew switch' command to use the version I want to?

This page details how to install older versions of a formula, using Subversion as an example. In a nutshell, to get MySQL 5.5:
$ brew tap homebrew/versions
$ brew -S mysql
automysqlbackup mysql-cluster mysql-proxy
groonga-normalizer-mysql mysql-connector-c mysqlreport
mysql mysql-connector-c++
mysql++ mysql-connector-odbc
josegonzalez/php/php53-mysqlnd_ms homebrew/versions/mysql51
josegonzalez/php/php54-mysqlnd_ms homebrew/versions/mysql55
josegonzalez/php/php55-mysqlnd_ms
$ brew install mysql55

Related

How to install MySQL 5.6 on OSX Mojave?

I need to install MySQL 5.6 on my Mac, running under Mojave. (Because AWS Aurora Serverless only allows MySQL 5.6)
That wouldn't be an issue if a .dmg was available, but there are none for MacOS for this particular version, too old I guess?
See https://dev.mysql.com/downloads/mysql/5.6.html
No Mac OS in the list. I tried to play around with the URL to see if there was a non-reference dmg file, but no luck.
Which leads me to two choices:
Install it from source (is it possible? how?)
Install it in a Docker container
I don't know what's the most simple/straightforward way to install it. It's only meant to be used locally.
To install:
brew install mysql#5.6
To have launchd start mysql#5.6 now and restart at login:
brew services start mysql#5.6
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql#5.6/bin/mysql.server start
I'd recommend using homebrew to be honest. I think it's brew install mysql#5.6 if you have homebrew installed already.
You may need to also add the install bin directory to your system path, but the command output will tell you what to do if so.
To install MySQL version 5.6
brew install mysql#5.6
MySql will be installed in below path :
/usr/local/opt/
Add MYSQL_HOME to your environment variable
MYSQL_HOME=/usr/local/opt/mysql#5.6
goto folder
/usr/local/opt/mysql#5.6/bin
mysql.server start

How do I use an alternative version of mysql with Ruby on Rails

My production server is running MySql 5.6.
If I use brew install on my local machine I get version 8.0, which is not compatible with data from MySql 5.6.
So I completely uninstalled mysql and ran brew install mysql#5.6 and then prepended /usr/local/opt/mysql#5.6/bin to my path.
The problem is that the rails' mysql2 gem will not function without running the standard brew install mysql because it cannot find some file.
Any suggestions of how to run with an older version of mysql?

How to install MySQL 5.7.x on Mac OS Sierra

I need to obtain the functionality of MySQL 5.7. I had zend server 9 (first 9 version). After reinstallation of zend server (it doesn't supports upgrade).
- Result: MySQL 5.5 !
May there exist solutions for:
Upgrade mysql inside zend framework?
Install other apache2.4+mysql5.7+php7 developer server?
some other solution.
Requirements:
PHP7.0.8 or later
MySQL 5.7
Apache 2.4 or later
Uninstall your existing version of mysql and install mysql 5.7
mysql.server stop # kill the running process
brew uninstall mysql # uninstall mysql
brew update # update brew
brew install mysql#5.7 # install mysql 5.7
Now you can start mysql.server with /usr/local/opt/mysql#5.7/bin/mysql.server start
Modify your PATH variable in ~/.bash_profile so you can start it with just mysql.server start
# ~/.bash_profile
export PATH="/usr/local/opt/mysql#5.7/bin:$PATH"
mysql.com offers a automatic dmg installer, which I find I have the most success with. It typically installs in /usr/local/mysql so you may want to try deleting any other installations you have on your system first.
You can download it here:
https://dev.mysql.com/downloads/mysql/
As for apache and php I find that I typically stick with the ones preloaded into os x, you can There are a number of articles out there on how to active these, but I believe its just a matter of uncommenting the php LoadModule line in /etc/apache2/httpd.conf
#LoadModule php5_module libexec/apache2/libphp5.so
and then starting apache in terminal with the apachectl command.
I installed https://dbngin.com/
Then after that i went to /usr/local
Then I saw a folder name for each of the MySQL versions I had installed using dbngin
Then after that I added it to path. Then that was it.
echo 'export PATH="/usr/local/path-to-mysql/bin:$PATH"' >> ~/.zshrc
You know, after MySQL is uninstalled and reinstalled via homebrew, it will prompt: 1. Upgrade to macOS 10.13; 2. Upgrade to Xcode 9.2.
If you don't want to upgrade the system or Xcode version, then request the MySQL official website to download:
https://downloads.mysql.com/archives/community/
The MySQL version suitable for macOS 10.12 ranges from 5.7.17 to 5.7.23.

Installing MySql 5.5.31 on Mac OSX 10.9?

I'm attempting to install a previous version of MySql (5.5.31) on my Mac OSX device running 10.9 Mavericks. I have been told this is possible, however, I cannot seem to locate a download for 5.5.31 Mac OSX.
I have a later version (5.6.19) installed, and I tried:
brew switch mysql 5.5.31
but I keep getting the error message:
"Error: mysql not found in the Cellar."
And I know this is because there's no 5.5.31 MySql file for it to switch to.
Anyone do this on their Mac?
Thanks
This is an old question, but I stumbled upon it through Google, so here's to anyone to stumbles upon it later.
I was trying to install MySQL 5.5 on OS X 10.10 through Homebrew.
First, you have to add homebrew/versions to your taps with:
$ homebrew tap homebrew/versions
Second, install MySQL 5.5 with:
$ homebrew install mysql55
if that doesn't work, try:
$ homebrew install homebrew/versions/mysql55
After that has successfully installed, you will get the message:
...A "/etc/my.cnf" from another install may interfere with a
Homebrew-built server starting up correctly.
To connect:
mysql -uroot
To load mysql55:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist Or, if you don't want/need launchctl, you can just run:
mysql.server start ❯ cd /usr/local/Cellar/mys
Try mysql.server start, if that doesn't work you need to update your $PATH. In my case I added /usr/local/Cellar/mysql55/5.5.40/bin to my $PATH in my .zshrc. You can find the location of your installation by using:
$ homebrew info mysql55
After that it should work after you've added that directory to your .zshrc/.bashrc/.bash_profile etc.

Does installing MySQL with homebrew include the Workbench and GUI (is it preferred to install native)?

Does installing MySQL with homebrew include MySQL workbench and GUI as if you were to run the Native installer (to be able to start and stop services)? I am trying to decide whether it is better to install using homebrew or with native.
homebrew mysql does not contain mysqlworkbench. Mysqlworkbench is another recipe that it is not exactly in homebrew but in homebrew cask (manager for GUI installs).
For GUI installs and 'other licence' installs there is a homebrew related package manager called homebrew cask.
You can find the caskroom recipes from homebrew,
$ brew search mysql
automysqlbackup
mysql ✔
mysql++
mysql-cluster
mysql-connector-c
mysql-connector-c++
mysql-sandbox
mysql-search-replace
mysqltuner
homebrew/php/php53-mysqlnd_ms
homebrew/php/php55-mysqlnd_ms
homebrew/versions/mysql51
homebrew/versions/mysql56
Caskroom/cask/mysqlworkbench
homebrew/php/php54-mysqlnd_ms
homebrew/php/php56-mysqlnd_ms
homebrew/versions/mysql55
Caskroom/cask/mysql-utilities
Caskroom/cask/navicat-for-mysql
but for install them you need to install cask.
brew tap caskroom/cask
brew cask search mysql
brew cask install mysqlworkbench
The workbench is installed in /opt so unless the installer makes an alias to Applications you are not going to find it easily.
NOTE: As of March 2018, the brew installer does make an alias to the Applications folder, so no further action is required.
If you are unable to see it in the Applications folder, you should follow the following:
In my installation the mysqlworkbench was not aliased to /Applications, but in the workbench folder there is a symlink to the Application folder so it is easy to create the link yourself.
$ ll /opt/homebrew-cask/Caskroom/mysqlworkbench/6.3.6
total 224
lrwxr-xr-x 1 pmg staff 14 31 Jan 11:55 Applications -> /Applications/
drwxr-xr-x 3 pmg staff 102 10 Dec 14:55 MySQLWorkbench.app
-rw-r--r--# 1 pmg staff 107640 10 Dec 14:55 background.tiff
make the alias
cd /opt/homebrew-cask/Caskroom/mysqlworkbench/6.3.6/
ln -s MySQLWorkbench.app Applications
You can run the application now from Apps
The Homebrew install does not include Workbench. The download and install of Workbench on OSX is pretty painless (a download and copy - no installer).
Here is some nice info on using Homebrew to install mysql http://blog.joefallon.net/2013/10/install-mysql-on-mac-osx-using-homebrew/
First of all you need to know which versions are available for MySQL:
brew search mysql
You get to know know the versions as it will display after execution of the above command. For example I get this in console: mysql#5.6. There may be multiple versions, so choose accordingly.
Then execute the below command:
brew install mysql#5.6
After installing MySQL, start the services of mysql using the below command:
brew services start mysql#5.6
After the service has started, install mysqlworkbench using the below command:
brew cask install mysqlworkbench
To update the current MySQL installation:
brew upgrade mysqlworkbench