Error with M1 Native Installation of MySQL with Homebrew - mysql

I just got my first MacOS system with an M1 chip and I'm having trouble installing the native M1 version of MySQL using Homebrew. I have my terminal configured without Rosetta and I'm using the command "brew install MySQL" but I get this error:
ritvikbiswas#Ritviks-MacBook-Pro ~ % brew install mysql
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
ritvikbiswas#Ritviks-MacBook-Pro ~ %
Could anyone help me figure out why I'm getting this error? Maybe I messed up the brew installation somewhere?

You installed Homebrew into the wrong place. On x86 Mac, Homebrew uses /usr/local. On M1 Mac, Homebrew uses /opt/homebrew. I don't know where you copied and pasted the installation script. You obviously made a wrong installation.
Please go the official installation guide page. And
Uninstall your current homebrew
Reinstall homebrew back correctly following the guide.

First, uninstall (if you have wrongly installed it).
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Install:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After successful installation, you can get this message in terminal
Run these three commands in your terminal to add Homebrew to your PATH:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/userName/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/userName/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Then set the homebrew to the right path
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc

Related

Installed mysql via brew but terminal can't find it. What's the proper way to alias it on a macos?

MacOS 10.12.6
Installed mysql via brew
mysql files are in /usr/local/Cellar/mysql\#5.7/5.7.24/bin
What is the proper way to make these available from the command line and from bash?
Thank you!
The solution to your problem is given using the command:
brew info mysql#5.7
which states:
If you need to have mysql#5.7 first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql#5.7/bin:$PATH"' >> ~/.bash_profile

Error message when trying to open newly downloaded mySQL

I am running MacOS High Sierra version 10.13.2 on a MacBook Air (mid 2011).
I am trying to set up a local development environment through the command-line and I have already gone through some steps to the following point:
After downloading mySQL, I am and trying to initialize it through the command line for my localhost. I went then through the commands:
sudo mkdir /var/mysql
Followed by
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
Then went to my system preferences to start mySQL but I am encountering this error message and mySQL is not opening as a result: "Could not load MySQL preference pane."
Any help around this would be much appreciated friends! Thanks in advance.
An easier way to install (certain) apps in MacOS is to use Homebrew. There is a full step-by-step guide available here. A short version:
Install Homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install MySQL: brew install mysql
Install services: brew tap homebrew/services
Set MySQL to autostart: brew services start mysql

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.

MySQL 5.6 install on debian ERROR:

I'm trying to install MySQL 5.6 on Debian.
Here what I do:
sudo dpkg -i mysql-5.6.12-debian6.0-i686.deb
cd /usr/local
ln -s /opt/mysql/server-5.6 mysql
cd mysql
scripts/mysql_install_db.sh --user=mysql --datadir=/var/lib/mysql
And this is the error that I get:
FATAL ERROR: Could not find #bindir#/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
Could you please suggest something? I'm installing MySQL from scratch (previous version was completely removed).
Thanks.
I might not be able to help with the error you're getting. But apt-get install -f mysql-server-5.5 worked for me on Debian Wheezy. Try replacing 5.5 with 5.6 and see if it works as well, and probably precede it with sudo.

Problems with install mysql 5.5.20 with homebrew

I installed homebrew and Xcode 4.3.2 with command line tools on Mac Osx Lion and when I now try to install mysql with :
brew install mysql -v
I get the error :
Error: #<BuildError: Failed executing: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.20 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql/5.5.20/share/man -DINSTALL_DOCDIR=/usr/local/Cellar/mysql/5.5.20/share/doc/mysql -DINSTALL_INFODIR=/usr/local/Cellar/mysql/5.5.20/share/info -DINSTALL_MYSQLSHAREDIR=share/mysql -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/usr/local/etc -DWITH_UNIT_TESTS=OFF -DWITH_READLINE=yes>
Here you find the full log :
https://gist.github.com/2421381
I checked the logs but there is nothing that can help me for the moment. Brew doctor is also clean and give no errors.
Found the solution with thanks to a reply of visoft on my gist post. This solution worked for me. The problem is coming from Cmake, I need version 2.8.7 instead of 2.8.8, run this code to get it work :
cd /usr/local
brew uninstall cmake
git checkout 948c2769 Library/Formula/cmake.rb
brew install mysql
After this, mysql was installed successfully.