Mysql Client For Mac

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. MySQL Utilities is now covered under Oracle Lifetime Sustaining Support Per Oracle's Lifetime Support policy, as of May 30, 2018, MySQL Utilities is covered under Oracle Sustaining Support. SQLPro for MySQL is the Premier application for editing and viewing MySQL databases on mac os x. Getting Started with 'Terminal' - MUST READ Before You Start Programming. Programmers use 'Terminal' to issue commands, instead of the graphical user interface - which is meant for common users.

macOS Update: While these instructions still work, there are new posts for recent versions of macOS, the latest being Install Apache, PHP, and MySQL on macOS Mojave.

HeidiSQL is a powerful and easy client for MySQL, MariaDB, Microsoft SQL Server and PostgreSQL. Open source and entirely free to use.

PHP Update: Mac OS X El Capitan comes pre-installed with PHP version 5.5 which has reached its end of life. After you complete this post, you should upgrade PHP on Mac OS X.

Note: This post is for new installations. If you have installed Apache, PHP, and MySQL for Mac OS X Yosemite, read my post on Updating Apache, PHP, and MySQL for Mac OS X El Capitan.

Mac OS X runs atop UNIX. So most UNIX software installs easily on Mac OS X. Furthermore, Apache and PHP come packaged with Mac OS X. To create a local web server, all you need to do is configure Apache and install MySQL.

I am aware of the web server software available for Mac OS X, notably MAMP. These get you started quickly. But they forego the learning experience and, as most developers report, can become difficult to manage.

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 Mac OS X

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 Mac OS X.

Now edit the Apache configuration. Feel free to use TextEdit if you are not familiar with vi.

Client

Uncomment the following line (remove #):

For

Restart Apache:

You can verify PHP is enabled by creating a phpinfo() page in your DocumentRoot.

The default DocumentRoot for Mac OS X El Capitan 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 Mac OS X El Capitan

Download and install the latest MySQL generally available release DMG for Mac OS X.

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.

Connect PHP and MySQL

Mysql Server 5.7 Download

You need to ensure PHP and MySQL can communicate with one another. There are several options to do so. I do the following:

Additional Configuration (optional)

The default configuration for Apache 2.4 on Mac OS X 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.

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 Mac OS X.

If you would like to install PHPMyAdmin, return to my original post on installing Apache, PHP, and MySQL on Mac OS X.

Find this interesting? Let's continue the conversation on Twitter.

Active1 year ago

Mysql Client For Mac

I'd like to be able to manage my MySQL databases from my iPad. I currently use Sequel Pro on my Mac, and I love it.

The app must

  • Support connecting to remote databases
  • Support tunneling over SSH
  • Make a command line (I.e. to issue SELECT * FROM WHERE... and INSERT INTO... type things) available
  • Allow access to all databases that my current user has access to.
  • Show a nice GUI for creating and modifying table schema

Nice to have:

  • Free is always nice, but I'm absolutely willing to shell out some dollars.
  • iPhone support, but that's rather far-fetched for something this advanced.

Is there an app that meets these criteria?

Undo
UndoUndo
2,7228 gold badges29 silver badges63 bronze badges

2 Answers

Below is a list of SQL clients that I have tried in the past, all seem to have a limitation in one area, whilst being stronger in others. MySQL Editor Pro seems to be your best bet, IMHO. Hope this helps.

MySQL ODBC (FREE, but basic and limited)

Description

With MySQL ODBC you can finally manage MySQL servers any where , any time . This software was designed to provide all functionalities that you can have in your computer .

MySQL QueryDB Client (FREE)

Description

The easiest way to view data from your MySQL databases on your iPhone or iPad! Optimized for flakey cellular connection, QueryDB provides the best way to mine your databases away from your desktop. Easily create queries using the schema viewer or export CSV data to external apps.

MySQL QueryDB SSH Client (SSH version of the previous client - not FREE)

Description

The easiest way to view data from your MySQL databases on your iPhone or iPad over an SSL tunnel! Optimized for flakey cellular connection, QueryDB provides the best way to mine your databases away from your desktop. Easily create queries using the schema viewer or export CSV data to external apps.

MySQL Editor Pro (Seems to fulfill your requirements, but the most expensive)

Description

MYSQL EDITOR IS A FULLY FEATURED MYSQL CLIENT

Features:

  1. MySQL over SSH connections
  2. Manage MySQL DATABASES
  3. View Server variables
  4. Manage USERS and PRIVILEGES
  5. Manage TABLES, VIEWS, TRIGGERS, KEYS
  6. VIEW, ADD, UPDATE, DELETE, FILTER, ORDER rows of TABLES and VIEWS in an awesome Table View
  7. RUN, SAVE, OPEN, EXPORT & IMPORT (Via iTunes) SQL scripts
  8. Script Editor with a great SYNTAX HIGHLIGHTING support
  9. GENERATE DDL SCRIPT for the entire DATABASE and for TABLES, VIEWS, TRIGGERS, and KEYS in a particular
  10. Contains FULL MYSQL SYNTAX REFERENCE and allows to SEARCH in it
  11. Supports iPhone, iPod and iPad
  12. Supports iOS 4.3 to 5.0
GreenonlineGreenonline
2961 gold badge4 silver badges14 bronze badges

You might like my app SQLPro for MySQL

  • It allows you to connect to remote database servers.
  • It allows for SSH Tunnelling (currently only password authentication is supported, but I will be adding public key authentication soon).
  • It allows you to run inserts, selects, etc.
    • The query editor contains syntax highlighting and autocomplete.
    • Multiple queries can be run at once, allowing you to navigate between multiple results.
    • You can also save queries for future use.
  • It displays database entries, allowing you to pick tables, views, stored procedures, etc and get quick direct access.
  • It supports both iPhone and iPad (and has specific iPad Smart Keyboard support as well).
  • Its completely free for a single database connection.

I believe the only thing not listed in your list is:

Mysql Client For Mac Os X

  • Show a nice GUI for creating and modifying table schema.

I plan on this in the future (my macOS version of SQLPro for MySQL supports a GUI, but I haven't finished adapting to the iOS platform yet).

Some extra features that you may also like:

  • Query results can be edited or even deleted (with confirmation) directly.
  • Images stored in a database are detected and can be previewed or exported.
  • Query results can be exported in multiple formats such as CSV, JSON or XML. Exported files can be opened directly into other application such as Numbers or Excel.

To make it very clear, I am the developer of this app. I love any feedback positive or negative about the app.

Mysql Client For Mac

KyleKyle

Best Mysql Client For Mac

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