How to install MySQL 5.7.x on Mac OS Sierra - mysql

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.

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 can i remove instance of mysql from brew info mysql

I am trying to remove mysql from my macbook pro to start from fresh.
I have followed guides on how to remove all instances and files of mysql, however if i run
brew info mysql
I still get info pertaining to mysql 8.0 as follows:-
mysql: stable 8.0.12 (bottled)
Open source relational database management system
https://dev.mysql.com/doc/refman/8.0/en/
Conflicts with:
mariadb (because mysql, mariadb, and percona install the same
binaries.)
mariadb-connector-c (because both install plugins)
mysql-cluster (because mysql, mariadb, and percona install the same
binaries.)
mysql-connector-c (because both install MySQL client libraries)
percona-server (because mysql, mariadb, and percona install the same
binaries.)
Not installed
From: https://github.com/Homebrew/homebrew-
core/blob/master/Formula/mysql.rb
==> Dependencies
Build: cmake ✘
Required: openssl ✘
==> Requirements
Required: macOS >= 10.10 ✔
==> Options
--with-debug
Build with debug support
--with-embedded
Build the embedded server
--with-local-infile
Build with local infile loading support
--with-memcached
Build with InnoDB Memcached plugin
--with-test
Build with unit tests
==> Caveats
We've installed your MySQL database without a root password. To secure
it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Analytics
install: 66,127 (30d), 215,889 (90d), 794,987 (365d)
install_on_request: 61,289 (30d), 185,026 (90d), 647,998 (365d)
build_error: 444 (30d)
How can i completely remove this? Thank you for any help!
mysql is already uninstalled. See these lines in the middle of your output:
Not installed
From: https://github.com/Homebrew/homebrew-
core/blob/master/Formula/mysql.rb
Homebrew is fetching this information on mysql's dependencies and usage remotely from GitHub. I do not have mysql installed either and get the same output when I run brew info mysql. If you try running mysql from the command line, you should get -bash: mysql: command not found.

Will the MAMP(PRO) mysql conflict with brew install mysql on macos

I'm trying to install a clean mysql on my macos Sierra. As I already installed brew, I decided to use this stackoverflow answer. Nevertheless, before installation, these pre-install check is done:
I have already checked the bash line with mysql command, and found no such command.
I brew info mysql, and found mysql Not Installed.
However, I still have doubt over that I might not have a clean installation environment. So I use the find / -name mysql -type d to search all the directory for mysql. And I've found there are mysql included in MAMP. As these line writes:
/Applications/MAMP/db/mysql
/Applications/MAMP/db/mysql/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/auto/DBD/mysql
/Applications/MAMP/Library/lib/perl5/site_perl/5.22.0/darwin-2level/DBD/mysql
I've installed MAMP about two years ago. Now I just want to learn mysql in command line rather than one-click environment like MAMP. And I wonder if I can install the mysql using brew to get a generic mysql environment if I don't uninstall the MAMP? And WHY is that the MAMP will/will not affect the mysql installed from brew?
Not really, they wont' be on conflict.
Mamp use another port, and brew use default mysqm port 3306
Mamp use this foder: /Applications/MAMP/Library/bin/mysql
Brew use his own folder : /usr/local/Cellar/mysql/(version...)
with brew you don't need use path to execute bin files, just type 'mysql -uroot -p' on the terminal.

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