Mysql Mac Install

  1. Mac Mysql Install 5.7
  2. Mysql Mac Install Location
  3. Mysql Install Mac 5.6
  4. Mysql Mac Install Instructions
  5. Brew Install Mysql Mac

The MySQL server is installed on the Mac, but it does not load by default. Start MySQL by clicking Start using the MySQL Preference Pane, which was installed during the default installation. You can configure MySQL to automatically start when you turn on your computer using the MySQL Preference Pane. MySQL is the most popular open source database management system. It allows you to quickly download and install and run a powerful database system on almost any platform available including Linux, Windows, and Mac OS X etc. Geeks Worldwide.

I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server. Install Docker. Download the (free) Docker Community Edition for Mac (unless you’ve already got it installed on your system). This will enable you to run SQL Server from within a Docker container. To download, visit the Docker CE for Mac download page and click Get Docker. This tutorial covers mysql mac installation in SQL. This course covers the basics of working with SQL. Work your way through the videos/articles and I'll teach you everything you need to know to interact with database management systems and create powerful relational databases!

Active3 months ago

I'm trying to setup up MySQL on mac os 10.6 using Homebrew by brew install mysql 5.1.52.

Everything goes well and I am also successful with the mysql_install_db.
However when I try to connect to the server using: Psp vita games for kids.

I get:

I've tried to access mysqladmin or mysql using -u root -proot as well,
Nch switch software activation key generator. but it doesn't work with or without password.

This is a brand new installation on a brand new machine and as far as I know the new installation must be accessible without a root password. I also tried:

but I also get

Mac Mysql Install 5.7

guaka
12.3k9 gold badges52 silver badges87 bronze badges
nikolanikola
2,6633 gold badges18 silver badges18 bronze badges

14 Answers

I think one can end up in this position with older versions of mysql already installed. I had the same problem and none of the above solutions worked for me. I fixed it thus:

Used brew's remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var, deleted my existing /etc/my.cnf (leave that one up to you, should it apply) and launchctl plist

Updated the string for the plist. Note also your alternate security script directory will be based on which version of MySQL you are installing.

Step-by-step:

I then started from scratch:

  1. installed mysql with brew install mysql
  2. ran the commands brew suggested: (see note: below)

  3. Start mysql with mysql.server start command, to be able to log on it

  4. Used the alternate security script:

  5. Followed the launchctl section from the brew package script output such as,

  6. Boom.

Hope that helps someone!

Note: the --force bit on brew cleanup will also cleanup outdated kegs, think it's a new-ish homebrew feature.

Note the second: a commenter says step 2 is not required. I don't want to test it, so YMMV!

Kévin Dunglas
1,9431 gold badge10 silver badges22 bronze badges

Mysql Mac Install Location

Lorin RiversLorin Rivers
6,7641 gold badge14 silver badges9 bronze badges

Here are detailed instructions combining getting rid of all MySQL from your Mac then installing it The Brew Way as Sedorner wrote above:

Remove MySQL completely per The Tech Lab

  • ps -ax | grep mysql
  • stop and kill any MySQL processes
  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/var/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*
  • sudo rm -rf /private/var/db/receipts/*mysql*
  • sudo rm -rf /tmp/mysql*
  • try to run mysql, it shouldn't work

Brew install MySQL per user Sedorner from this StackOverflow answer

  • brew doctor and fix any errors
  • brew remove mysql
  • brew cleanup
  • brew update
  • brew install mysql
  • unset TMPDIR
  • mysql_install_db --verbose --user=whoami--basedir='$(brew --prefix mysql)' --datadir=/usr/local/var/mysql --tmpdir=/tmp
  • mysql.server start
  • run the commands Brew suggests, add MySQL to launchctl so it automatically launches at startup

mysql should now work and be running all the time as expected

Godspeed.

Sunil B N
3,5351 gold badge21 silver badges41 bronze badges
corysimmonscorysimmons
3,1531 gold badge29 silver badges36 bronze badges

Had the same problem. Seems like there is something wrong with the set up instructions or the initial tables that are being created. This is how I got mysqld running on my machine.

If the mysqld server is already running on your Mac, stop it first with:

launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist

Start the mysqld server with the following command which lets anyone log in with full permissions.

mysqld_safe --skip-grant-tables

Then run mysql -u root which should now let you log in successfully without a password. The following command should reset all the root passwords.

UPDATE mysql.user SET Password=PASSWORD('NewPassword') WHERE User='root'; FLUSH PRIVILEGES;

Now if you kill the running copy of mysqld_safe and start it up again without the skip-grant-tables option, you should be able to log in with mysql -u root -p and the new password you just set.

Alistair McMillanAlistair McMillan

If brew installed MySQL 5.7, the process is a bit different than for previous versions.In order to reset the root password, proceed as follows:

A temporary password will be printed to the console and it can only be used for updating the root password:

mruccimrucci
3,5712 gold badges25 silver badges31 bronze badges

Okay I had the same issue and solved it. For some reason the mysql_secure_installation script doesn't work out of the box when using Homebrew to install mysql, so I did it manually. On the CLI enter:

That should get you into mysql. Now do the following (taken from mysql_secure_installation):

Now exit and get back into mysql with: mysql -u root -p

Darren NewtonDarren Newton
2,0141 gold badge24 silver badges31 bronze badges

I had the same problem just now. If you brew info mysql and follow the steps it looks like the root password should be new-password if I remember correctly. I was seeing the same thing you are seeing. This article helped me the most.

It turned out I didn't have any accounts created for me. When I logged in after running mysqld_safe and did select * from user; no rows were returned. I opened the MySQLWorkbench with the mysqld_safe running and added a root account with all the privs I expected. This are working well for me now.

MarkMark
8,4716 gold badges33 silver badges39 bronze badges

Stop mysql completely.

  1. mysql.server stop <-- may need editing based on your version
  2. ps -ef | grep mysql <-- lists processes with mysql in their name
  3. kill [PID] <-- kill the processes by PID

Remove files. Instructions above are good. I'll add:

  1. sudo find /. -name '*mysql*'
  2. Using your judgement, rm -rf these files. Note that many programs have drivers for mysql which you do not want to remove. For example, don't delete stuff in a PHP install's directory. Do remove stuff in its own mysql directory.

Hopefully you have homebrew. If not, download it.

I like to run brew as root, but I don't think you have to. Edit 2018: you can't run brew as root anymore

  1. sudo brew update
  2. sudo brew install cmake <-- dependency for mysql, useful
  3. sudo brew install openssl <-- dependency for mysql, useful
  4. sudo brew info mysql <-- skim through this.. it gives you some idea of what's coming next
  5. sudo brew install mysql --with-embedded; say done <-- Installs mysql with the embedded server. Tells you when it finishes (my install took 10 minutes)
  1. sudo chown -R mysql /usr/local/var/mysql/ <-- mysql wouldn't work for me until I ran this command
  2. sudo mysql.server start <-- once again, the exact syntax may vary
  3. Create users in mysql (http://dev.mysql.com/doc/refman/5.7/en/create-user.html). Remember to add a password for the root user.
sudo rm -rf slashsudo rm -rf slash
5231 gold badge7 silver badges24 bronze badges

brew info mysql

mysql.service start

or mysql -u root

I'm looking for a solution for some time but I can not solve my problem. I tried several solutions in stackoverflow.com but no this helping me.

Felipe DuardoFelipe Duardo

TL;DR

MySQL server might not be running after installation with Brew. Try brew services start mysql or just mysql.server start if you don't want MySQL to run as a background service.

Full Story:

I just installed MySQL (stable) 5.7.17 on a new MacBook Pro running Sierra and also got an error when running mysql_secure_installation:

Say what?

According to the installation info from Brew, mysql_secure_installation should prompt me to.. secure the installation. https://fabriclucky.netlify.app/free-word-2017-activation-code.html. I figured the MySQL server might not be running and rightly so. Running brew services start mysql and then mysql_secure_installation worked like a charm.

NicholasNicholas
1,7353 gold badges20 silver badges28 bronze badges
XMenXMen
12.2k36 gold badges90 silver badges139 bronze badges

None of the above answers (or any of the dozens of answers I saw elsewhere) worked for me when using brew with the most recent version of mysql and yosemite. I ended up installing a different mysql version via brew.

Specifying an older version by saying (for example)

Worked for me. Hope this helps someone. This was a frustrating problem that I felt like I was stuck on forever.

toddmethenytoddmetheny
3,5551 gold badge11 silver badges30 bronze badges
EdisonEdison

I had the same issue after I tried to restart mysql.

I use the following two aliases in my .profile for convenience

After stoping mysql and then trying to restart I experienced the issue you were having. I looked into the launchctl load and it was reporting a “nothing found to load” error.

After a quick search I found this.

So I updated me mysql-start alias as follows

Mysql Install Mac 5.6

This solved my issue which may be useful for you.

Alexander MillarAlexander Millar

The 'Base-Path' for Mysql is stored in /etc/my.cnf which is not updated when you do brew upgrade. Just open it and change the basedir value

For example, change this:

to point to the new version:

Restart mysql with:

mrucci
3,5712 gold badges25 silver badges31 bronze badges
Bernhard ZürnBernhard Zürn

protected by CommunityAug 2 '11 at 22:17

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged mysqlmacoshomebrewmysql-error-1045 or ask your own question.

Active5 months ago

I want to install the MySQL client for the command line, not a GUI. I have searched over the web but only found instructions on installing the MySQL server.

Michael Lihs
2,8976 gold badges29 silver badges55 bronze badges
hchhch
1,4996 gold badges14 silver badges21 bronze badges

13 Answers

user1659189user1659189
1,5271 gold badge10 silver badges4 bronze badges

If you have already installed MySQL from the disk image (dmg) from http://dev.mysql.com/downloads/), open a terminal, run:

then, reload .bash_profile by running following command:

You can now use mysql to connect to any mysql server:

Credit & Reference: http://www.gigoblog.com/2011/03/13/add-mysql-to-terminal-shell-in-mac-os-x/

Michael Lihs
2,8976 gold badges29 silver badges55 bronze badges
JackSparrowJackSparrow
Michael Lihs
2,8976 gold badges29 silver badges55 bronze badges
GeekGeek

Mysql has a client-only set of utilities:

Mysql client shellhttps://dev.mysql.com/downloads/shell/

Other command line utilitieshttps://dev.mysql.com/downloads/utilities/

Mac OSX version available.

trosemantroseman

There is now a mysql-client formula.

brew install mysql-client

egzeegze

Open the 'MySQL Workbench' DMG file and

Eject the DMG disk

Directory
caccialdocaccialdo

There is a Homebrew formulae for just a client: https://formulae.brew.sh/formula/mysql-client

Install it by: brew install mysql-client

IvanIvan
4,3344 gold badges38 silver badges55 bronze badges

For installing mysql-shell with homebrew, run

you can then launch the mysql shell with

if you want to enter SQL mode directly, run

Michael LihsMichael Lihs
2,8976 gold badges29 silver badges55 bronze badges

This strictly installs a command line client, without the other overhead:

Install Homebrew (if you don't have it):

Then, install mysql-client:

Then, add the mysql-client binary directory to your PATH:

Finally, reload your bash profile:

Then you should be able to run mysql in a terminal, if not try opening a new terminal

Alex W

Mysql Mac Install Instructions

Alex W
29.1k7 gold badges74 silver badges87 bronze badges

If you installed from the DMG on a mac, it created a mysql client but did not put it in your user path.

Add this to your .bash_profile:

This will let you run mysql from anywhere as you.

Michael Lihs
2,8976 gold badges29 silver badges55 bronze badges
Paul KenjoraPaul Kenjora

As stated by the earlier answer you can get both mysql server and client libs by running

brew install mysql.

There is also client only installation. To install only client libraries run

brew install mysql-connector-c

In order to run these commands, you need homebrew package manager in your mac. You can install it by running

/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

Kimmo HintikkaKimmo Hintikka
2,2044 gold badges22 silver badges40 bronze badges

The easiest way would be to install mysql server or workbench, copy the mysql client somewhere, update your path settings and then delete whatever you installed to get the executable in the first place.

Brew Install Mysql Mac

WillaWilla

Using MacPorts you can install the client with:

You also need to select the installed version as your mysql

The server is only installed if you append -server to the package name (e.g. mysql57-server)

Alex GAlex G

protected by Bhargav RaoMay 24 '17 at 7:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged mysqlmacosterminal or ask your own question.