MySQL is a relational database management system. MySQL is the widely used database server in the world. This tutorial helps you to install MySQL database server on macOS Sierra 10.12 and High Sierra 10.13 and other supported versions using Homebrew.
Step 1 – Prerequisites
To install MySQL using the package installer: Download the disk image (.dmg) file (the community version is available here) that contains the MySQL package installer. Double-click the file to mount the disk image and see its contents. Double-click the MySQL installer package.
- How to Install MySQL. But versions are available for Mac. Enter “exit” at the mysql prompt to stop the command line client. You should now shut down MySQL with the following command.
- Just like Windows, MySQL installer for Mac doesn’t add MySQL executable to the PATH environment variable. Consequently, we have to execute MySQL by specifying the full path to it in the terminal. We are now ready to start the server. Open System Preference and click on the MySQL icon. This will open MySQL preference pane.
- How to Install and Configure MySQL Database Server on macOS Mac OS X mysql server client download setup Sierra,Mojave Apple macbook pro Please Subscribe my C.
- Install MySQL 5.7 on macOS Sierra. Xcode must be installed. It can be installed from the App Store here. MySQL should not already be installed on your system. If you have installed or attempted to install it before, you will need to make sure MySQL is completely removed along with all of its files and directories. Let’s get started –.
Before starting the installation of MySQL using this tutorial you must have the following prerequisites
- Terminal: You must have Mac Terminal access and little knowledge about working with the terminal application.
- Homebrew: Homebrew is a popular package management tools used for installing most open source software like Node. Here is the Homebrew installation tutorial
Step 2 – Install MySQL on macOS
At this time of writing this tutorial, Homebrew has MySQL 5.7.21 version in its main repository. Start a terminal and run command to install MySQL:
Wait for the installation process finish. Now you just need to configure things so that your MySQL server is auto-started
Also, you have to set a strong password for the MySQL root account. Use the following command to set a new password. Make sure to use a strong password.
Step 3 – MySQL Configuration
MySQL server has been installed on your system. The binary files are installed under /usr/local/bin directory and all the MySQL related files are created under “/usr/local/var/mysql” directory. The main confiugration file is created at:
You can use above file to customize your MySQL server. Now, Connect to MySQL server using the command:
Step 4 – Manage MySQL Service
There are mysql.server command available under /usr/local/bin directory, which is used to manage MySQL service. You can use mysql.server command with options status, stop, start, or restart MySQL service on your system.
All done. You have running MySQL server on your system. What next? Visit our MySQL tutorial section to create and manage databases from the command line.
Install MySQL on macOS Sierra
Install Mysql Client On Mac Os
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
Install Homebrew
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
- Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
Install MySQL
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
- Enter the following command :
$ brew info mysql
- Expected output: mysql: stable 5.7.15 (bottled)
To install MySQL enter :
$ brew install mysql
Mac Install Mysql Client
Additional configuration
Homebrew
- Install brew services first :
$ brew tap homebrew/services
- Load and start the MySQL service :
$ brew services start mysql
.
Expected output : Successfully startedmysql
(label: homebrew.mxcl.mysql) - Check of the MySQL service has been loaded :
$ brew services list
1 - Verify the installed MySQL instance :
$ mysql -V
.
Expected output : Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)
MySQL
Open Terminal and execute the following command to set the root password:
mysqladmin -u root password 'yourpassword'
Pip Install Mysql Client Mac
Important : Use the single ‘quotes’ to surround the password and make sure to select a strong password!
Database Management
To manage your databases, I recommend using Sequel Pro, a MySQL management tool designed for macOS.
Current version available: 1.1.2
Current version available: 1.1.2
Comments
1 The
brew services start mysql
- instruction is equal to :