Active5 months ago
Mysql Install Mac Os
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 Lihs2,89766 gold badges2929 silver badges5555 bronze badges
Mac Install Mysql Client
Double-click the MySQL installer package from the disk. It is named according to the version of MySQL you have downloaded. For example, for MySQL server 5.7.28 it might be named mysql-5.7.28-osx-10.13-x8664.pkg. The initial wizard introduction screen references the MySQL server version to install. 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! Cd /usr/local/mysql sudo./bin/mysqlinstalldb -user=mysql sudo chown -R mysql./var That’s it, MySQL is installed. But you’re not done yet. Auto-Starting MySQL. Now that the install is done, you need to have MySQL auto-start every time you start or reboot your Mac. The easiest way to do this is using launchd. For additional information, see Section 2.4.3, “Installing a MySQL Launch Daemon”, and Section 2.4.4, “Installing and Using the MySQL Preference Pane”. Use the MySQL Preference Pane or launchd to configure MySQL to automatically start at bootup.
hchhch1,49966 gold badges1414 silver badges2121 bronze badges
13 Answers
user1659189user16591891,52711 gold badge1010 silver badges44 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 Lihs2,89766 gold badges2929 silver badges5555 bronze badges
JackSparrowJackSparrow
Michael Lihs2,89766 gold badges2929 silver badges5555 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
caccialdocaccialdo
There is a Homebrew formulae for just a client: https://formulae.brew.sh/formula/mysql-client
Install it by:
IvanIvanbrew install mysql-client
4,33444 gold badges3838 silver badges5555 bronze badges
For installing
mysql-shell
with homebrew, runyou can then launch the mysql shell with
if you want to enter SQL mode directly, run
![Mysql Mac Install Mysql Mac Install](/uploads/1/2/4/8/124851787/591460070.png)
2,89766 gold badges2929 silver badges5555 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
Alex Wmysql
in a terminal, if not try opening a new terminal![Mac Mac](/uploads/1/2/4/8/124851787/330396549.jpg)
29.1k77 gold badges7474 silver badges8787 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
Michael Lihsmysql
from anywhere as you.2,89766 gold badges2929 silver badges5555 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)'
Mysql Install Mac Mojave
2,20444 gold badges2222 silver badges4040 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.
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 Rao♦May 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?
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.
Unlock this course with a free trial
Join today to access over 13,000 courses taught by industry experts.
Course Info
- Duration: 1h 41m 23s
- Skill Level:Intermediate
- Released:July 15, 2019
- Viewers:1,727
Learn the most in-demand business, tech and creative skills from industry experts.
Start my free monthCourse details
Whether you're a developer, a database analyst, or just someone looking to manage data for their small business, having the ability to install and configure MySQL is a professional asset. In this course, join instructor Bill Weinman as he steps through how to install and configure MySQL on various platforms. Bill shows how to install MySQL on a Mac, as well as machines running Windows and Ubuntu Linux. He demonstrates how to create user accounts, assign database access privileges, and manage passwords. Plus, he goes over the different storage engine options in MySQL, including InnoDB.Skills covered in this course
Related courses
Demystifying the server
we'll install the MySQL Server on a Mac running macOS. This computer is running macOS Mojave. The process should be the same on any modern version of macOS. First, we need to confirm that we're not already running MySQL Server on this computer. and you'll notice that nothing is highlighted here in the System Preferences. If MySQL Server was running on this computer, there would be a little highlight around one of these items for the MySQL panel, but we don't have that, and so MySQL Server is not running on this computer. So I'm going to press Command + Q to quit the System Preferences, and now we'll go ahead, and download MySQL from the website. So here I have dev.mysql.com/downloads and I've loaded this up in my browser. I'm using Chrome. You can use any modern browser. It should work just fine. And I've got DOWNLOADS here selected and Community selected. And so, we have the MySQL Community Downloads. Now, there's several different editions of MySQL. Significantly, the Enterprise and Community editions. See, Enterprise edition cost money and if you're not running an enterprise, we're just running this for yourself, and in this case, we're just using this for development, and really just for learning so the Community edition is exactly what we want. The Community edition is free and it doesn't cost anything at all. So down here under the MySQL Community Downloads, we'll notice a couple of items. MySQL Community Server and then farther along down, MySQL Workbench. And so, I've already download both of these to my desktop, but I just want to run you though this really quickly. It's the same for both of these. When you click on this, you'll see, you'll get a page with a bunch of stuff, and then down here, have an operating system selected, in this case, macOS because I'm doing this on a Mac, and you'll have a bunch of different choices here. The DMG Archive is the easiest one. And when you press Download, you get yet another page and this page asks you to login or just sign up. If you do that, you're going to get a ton of email, most of it asking you to spend money on stuff you don't need so I didn't do that. You just press No thanks, just start my download. And you notice that when I hover over that, I get the DMG file. And so, I've already downloaded that onto my desktop here and it's right here. And I'm going to go ahead and load that. And I've also downloaded the MySQL Workbench. It's the exact same process for downloading both of them. I got both of them here on my desktop. I opened up this DMG file and I get a Mac installation package, a pkg file, and so I'll double-click on that, and I get this little warning that's going to run a program to determine et cetera. And if you've installed anything on your Mac, most of this is very familiar. It uses the standard Mac installer. So I press Continue, and I press Continue, and I accept the license agreement which I have not read. And then, I just press Install. Now, it's trying to install software. I'm going to type the password for my computer here. We're going to have different passwords involved in this process so I just want to be clear. This is the password for my computer that I'm installing this on. And I say Install. And I get this choice: Use Strong Password Encryption or Use Legacy Password Encryption. And at least for our purposes here, we want to use the Strong Password Encryption, so that we can use it. Now, the command-line interface, sometimes called the CLI. It's operated from the command line so I run Terminal, the Apple macOS Terminal program. And you notice I get this UNIX command prompt. Now, this may be intimidating for some of you if you've not used the UNIX command line before. I'm going to walk you through this, literally character by character so that we don't make any mistakes. Later, we're going to install the graphical interface, the MySQL Workbench. This step is important, especially if you want to access the command-line interface in the future, and if you're taking some of my other courses on Lynda.com or on LinkedIn, you may want to have this. But a word of warning, type very carefully. Spelling and punctuation is critical here. Just be very careful and pay close attention to every character that you type. macOS, of course, is based on UNIX. In fact, it's the largest installed base of any UNIX variant and so this is a UNIX command line. The dollar sign is where you type the command, and I'm going to type a command here, and then we're going to go back, and I'll explain it before we press Return. So follow along, but don't press Return at the end. The first word is sudo. S-U-D-O. And then, L-N, dash s, and then a forward slash. I'm just going to say slash from now on because a UNIX slash is always the forward slash. U-S-R, slash, the word local, slash, mysql, slash, the word bin, B-I-N, slash, and then msql one more time, and then a space, and then slash, U-S-R, slash, local, slash, bin. Like that. So just bit by bit, sudo is a special command that means do this as the super user or as the root user. L-N dash s is the command to create a symbolic link. It's like a file alias in UNIX. And then, this long path: usr/local/mysql/bin/mysql. That's the path through the actual MySQL command line, but we don't want to have to type that every time. We want to be able to just type mysql and that's why we're creating this symbolic link. We put it in usr/local/bin which is in the default path, execution path, and so when I press Enter here, it asks for my password and this is for sudo, and so this is my login password on my Mac. I'm going to type that in. And this is an extra precaution to protect you from doing things that you might not want to do with sudo. And so now it's done, and I should be able to just type mysql like this, and press Enter, and it's running it. And I get this Access denied because I didn't type the whole command line with the password so I type mysql, dash u, and root which is the root MySQL user we're going to be using, and dash p, and it'll prompt us for a root password. When I press Enter, it says Enter password. Now, this is the password that we gave the MySQL Server upon installation so this is the MySQL root password. I'm going to type that password here and press Enter. And here is the MySQL CLI, the command-line interface for MySQL. I have this little prompt at the bottom here where I can type a SQL command. I'ma just say show databases. It's just a simple command to make sure that the installation happened and it's all working. I press Enter and I get a result. Your result might look a little different, it might not. That's okay as long as you get a database table with a bunch of databases in it. And then you can type quit, and press Enter, and we're done. So at this point, I can press Command + Q to quit my Terminal and our installation is complete. We have now successfully installed the MySQL Server on your Mac workstation so please continue to the next lesson to install the MySQL Workbench on your Mac and that's the graphical user interface that we use in most in these courses.Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.Download the exercise files for this course. Get started with a free trial today.Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.Download on the App StoreGet it on Google PlayWatch this course anytime, anywhere. Get started with a free trial today.