- Mysql Workbench For Mac Os
- How To Use Mysql Workbench
- Mysql Workbench Download For Windows 10
- Install Mysql Workbench
Recommend switching to Docker
I finally switched to using Docker for local development on macOS. While the following tutorial works for macOS Mojave, it will not for future versions of macOS. I recommend following my latest tutorial on installing Apache, MySQL, and PHP on macOS using Docker.
Note: This post assumes you followed installing Apache, PHP, and MySQL on Mac OS X Sierra and have since upgraded to macOS Mojave. If you did not follow the original post, you should follow installing Apache, PHP, and MySQL on macOS Mojave.
A versatile and user-oriented visual tool specially designed for database developers, architects, as well as database administrators. MySQL Workbench is a fully-featured macOS application that helps you manage, model, generate and design databases with extreme ease. MySQL Workbench provides. Now, my MySQL workbench (6.3.9) is behaving weirdly after this OS update. 1) When opened a fresh and executed simple select statement, workbench does not show results grid after query is executed. 2) When same/another select query is executed again, nothing comes up.
When Mac OS X upgrades it overwrites previous configuration files. However, before doing so it will make backups. The backup files often have a suffix of
previous
or pre-update
. Most of the time, configuring your system after updating Mac OS X is simply a matter of comparing the new and old configurations.This post will look at the differences in Apache, PHP, and MySQL between Mac OS X Sierra and macOS Mojave.
Updating Apache
Mac OS X Sierra and macOS Mojave both come with Apache pre-installed. As noted above, your Apache configuration file is overwritten me when you upgrade to macOS Mojave.
There were a few differences in the configuration files. However, since both Sierra and Mojave run Apache 2.4, you could simply backup the configuration file from Mojave and overwrite it with your Sierra version.
However, I encourage you to stay up-to-date. As such, you should take the time to update Mojave's Apache configuration. First, create a backup and compare the two configuration files for differences.
Now edit the Apache configuration. Feel free to use a different editor if you are not familiar with vi.
Uncomment the following line (remove
#
):In addition, uncomment or add any lines you noticed from the
diff
above that may be needed. For example, I uncommented the following lines:Finally, I cleaned up some of the backups that were created during the macOS Mojave upgrade. This will help avoid confusion in the future.
Note: These files were not changed between versions. However, if you changed them, you should compare the files before running the commands.
Restart Apache:
Updating PHP
Mac OS X Sierra came with PHP version 5.6 pre-installed. This PHP version has reached its end of life. macOS Mojave comes with PHP 7.1 pre-installed. If you added any extensions to PHP you will need to recompile them.
Also, if you changed the core PHP INI file it will have been overwritten when upgrading to macOS Mojave. You can compare the two files by running the following command:
Note: Your file may note be named
/etc/php.ini.default.pre-update
. You can see which PHP core files exist by running ls /etc/php.ini*
.I would encourage you not to change the PHP INI file directly. Instead, you should overwrite PHP configurations in a custom PHP INI file. This will prevent Mac OS X upgrades from overwriting your PHP configuration in the future. To determine the right path to add your custom PHP INI, run the following command:
Updating MySQL
MySQL is not pre-installed with Mac OS X. It is something you downloaded when following the original post. As such, the macOS Mojave upgrade should not have changed your MySQL configuration.
You're good to go.
Find this interesting? Let's continue the conversation on Twitter.
Recommend switching to Docker
I finally switched to using Docker for local development on macOS. While the following tutorial works for macOS Mojave, it will not for future versions of macOS. I recommend following my latest tutorial on installing Apache, MySQL, and PHP on macOS using Docker.
Note: This post is for new installations. If you have installed Apache, PHP, and MySQL for Mac OS Sierra, read my post on Updating Apache, PHP, and MySQL for macOS Mojave.
I am aware of the web server software available for macOS, notably MAMP, as well as package managers like
brew
. These get you started quickly. But they forego the learning experience and, as most developers report, can become difficult to manage.The thing is macOS runs atop UNIX. So most UNIX software installs easily on macOS. Furthermore, Apache and PHP come preinstalled with macOS. To create a local web server, all you need to do is configure Apache and install MySQL.
Running Commands
First, open the Terminal app and switch to the
root
user so you can run the commands in this post without any permission issues:Enable Apache on macOS
Verify It works! by accessing http://localhost
Enable PHP for Apache
First, make a backup of the default Apache configuration. This is good practice and serves as a comparison against future versions of macOS.
Now edit the Apache configuration. Feel free to use a different editor if you are not familiar with vi.
Uncomment the following line (remove
#
):Restart Apache:
You can verify PHP is enabled by creating a
phpinfo()
page in your DocumentRoot
.The default
DocumentRoot
for macOS Mojave is /Library/WebServer/Documents
. You can verify this from your Apache configuration.Now create the
phpinfo()
page in your DocumentRoot
:Verify PHP by accessing http://localhost/phpinfo.php
Install MySQL on macOS Mojave
Download and install the latest MySQL generally available release DMG for macOS. While MySQL 8 is the latest version, many of my projects still use MySQL 5.7. So I still prefer installing the older version.
Mysql Workbench For Mac Os
When the install completes it will provide you with a temporary password. Copy this password before closing the installer. You will use it again in a few steps.
The README suggests creating aliases for
mysql
and mysqladmin
. However there are other commands that are helpful such as mysqldump
. Instead, you can update your path to include /usr/local/mysql/bin
.Note: You will need to open a new Terminal window or run the command above for your path to update.
Finally, you should run
mysql_secure_installation
. While this isn't necessary, it's good practice to secure your database. This is also where you can change that nasty temporary password to something more manageable for local development.Connect PHP and MySQL
How To Use Mysql Workbench
You need to ensure PHP and MySQL can communicate with one another. There are several options to do so. I like the following as it doesn't require changing lots of configuration:
Additional Configuration (optional)
The default configuration for Apache 2.4 on macOS seemed pretty lean. For example, common modules like
mod_rewrite
were disabled. You may consider enabling this now to avoid forgetting they are disabled in the future.Mysql Workbench Download For Windows 10
I edited my Apache Configuration:
I uncommented the following lines (remove
#
):If you develop multiple projects and would like each to have a unique url, you can configure Apache VirtualHosts for macOS.
If you would like to install PHPMyAdmin, return to my original post on installing Apache, PHP, and MySQL on macOS.
Install Mysql Workbench
Find this interesting? Let's continue the conversation on Twitter.