I love Homebrew, but sometimes it really gets me down, you know?Especially when I have to deal with launchctl.

The utility is located in the MongoDB bin directory (eg, /mongodb/bin). When you run the utility, provide the name of the database, the collection, and the file you want it to be exported to. To export data, first open a new Terminal/Command Prompt window, then type the applicable command. Export a Collection to a JSON File. We've installed your MySQL database without a root password. To secure it run: mysqlsecureinstallation MySQL is configured to only allow connections from localhost by default To connect run: mysql -uroot. Please use -explicitdefaultsfortimestamp server option (see documentation for more details). 2016-04-14T14:86Z 0 ERROR -initialize specified but the data directory has files in it. 2016-04-14T14:05Z 0 ERROR Aborting. But I have solved it using some command below. Sudo rm -rf /usr/local/var/mysql sudo rm.

launchctl loads and unloads services that start at login. In OS X, theseservices are represented by files ending with .plist (which stands for“property list”). These plists are usually stored in either~/Library/LaunchAgents or /Library/LaunchAgents. You load them (i.e. tellthem to start at login) with launchctl load $PATH_TO_LIST and unload them withlaunchctl unload $PATH_TO_LIST. Loading a plist tells the program itrepresents (e.g. redis) to start at login, while unloading it tells theprogram not to start at login.

This post-install message from Homebrew may look familiar:

Doing all that takes too long, and I can never remember where Homebrew plistsare. Fortunately, Homebrew includes a lovely interface for managing this withoutusing ln, launchctl or knowing where plists are.

brew services

First, install brew services by tapping homebrew/services (one time):

Here’s an example usage:

Behind the scenes, brew services start is doing everything in the post-installmessage above. First it runs ln -sfv ... for you. Then it runs launchctl load~/Library/LaunchAgents/homebrew.mxcl.mysql.plist. It Just Works.

Let’s say MySQL’s acting funky. We can easily restart it:

DataBrew Mysql Data Directory

Now let’s see everything we’ve loaded:

Note that the list of services includes services you started with launchctlload, not just services you loaded with brew services.

Let’s say we uninstalled MySQL and Homebrew didn’t remove the plist for somereason (it usually removes it for you). There’s a command for you:


Hidden Homebrew commands

Homebrew ships with a whole bunch of commands that don’t show up in brew--help. You can see a list of them in the Homebrew git repo. Each fileis named like brew-COMMAND, and you run them with brew command. I recommendbrew beer.

What’s next

If you liked this, I recommend reading through Homebrew’s Tips andTricks. You can also try out another Homebrew extension forinstalling Mac apps: homebrew-cask.

In order to import a database via the command line, you will first need to ensure that you have the database and database user created. You can do so with the following steps:
  1. Login to cPanel with the cPanel username and password.
  2. Click on the MySQL Databases icon.
  3. Enter a database name and click Create Database.
  4. Scroll down to 'MySQL Users'.
  5. Enter a MySQL username and password, click Create User.
  6. Scroll Down to the 'Add User To Database' section.
  7. Select your new user and new database and click Add.
  8. Put a check next to ALL PRIVILEGES.
  9. Click Make Changes.
Now that you have a database and user, you can use one of the following options to import the database.
Upload, Then Import (Any Operating System)
: To use this method, you must ensure that Shell Access has been enabled for the account.
NOTE: To use the Terminal icon, the Terminal feature must be enabled for your account. You can enable this feature via the Feature Manager in WHM if needed.
You will first need to upload the SQL file to your cPanel account by using FTP or SFTP access.
When uploading the file, avoid putting the file in the /home/cpanelusername/public_html directory. Preferably, you should place the file in a directory that is not publicly accessible such as:
Once you have the file uploaded, you can either use the Terminal icon in cPanel to execute the import command, or you can use SSH.
To connect via SSH you would issue the following command on your Mac or Linux computer:
You would then need to enter your cPanel password. That should bring you to the bash prompt on your cPanel server.
To get to the Bash prompt via the terminal icon (Recommended for Windows users) use the following steps:
  1. Login to your cPanel account via your browser
  2. Click on the Terminal icon
Now that you are at the bash prompt issue the following command to import the database that you have previously uploaded:
Preparation for Importing Directly with the MySQL ClientBrew mysql data directory tutorialMysql
Importing directly with the MySQL client requires that MySQL is listening publicly. Enabling public access to the MySQL server can be a security risk. Please consult with a qualified systems or security administrator before allowing MySQL to listen publicly.

Brew Mysql Data Directory Tutorial

If you would like to allow MySQL to listen publicly you must update or add the bind-address directive to the /etc/my.cnf file and restart the MySQL server.
An example of this directive is shown below:
You would need to edit the /etc/my.cnf file with a text editor such as vi or nano:
Once you have made the edit, you must restart the MySQL server with the following command:
You can check to ensure that MySQL is listening properly with the following command:
NOTE: The above output shows that mysqld is listening on tcp6. This includes the IPv4 protocol as well.
You must also ensure that your workstation's IP address is whitelisted in cPanel >> Remote MySQL.
Importing Directly with MySQL Client On MacOS
First install Brew on you Mac workstation: Homebrew
Then, using brew, install MySQL. This installs the MySQL server on your mac computer in addition to the MySQL client. If you prefer to install only the MySQL shell, you'll need to use different instructions. I prefer to use the normal MySQL client because it uses the standard command syntax.
You can issue the following command via Terminal to install MySQL via brew:

Mysql Data Directory Windows

You can then issue the following command to import the sql file from your local worstation to the database on your cPanel server:
You should replace databasehost with the domain name or the IP address of the server where your database server is hosted. You should replace mysqluser and databasename with the user and database name that you created above. And finally you should enter the path on your computer where the sql file is stored that contains your database to import.
Importing Directly with MySQL Client On Linux
Use the following to install the MySQL client for the version of Linux that is running on your local workstation (not your server):
Then issue the following command to import the sql file from your local workstation to the database on your cPanel server:

Brew Mysql Data Directory Database


Brew Mysql Data Directory List

Feel free to click on the

Homebrew Mysql Data Folder


Brew Mysql Data Directory

tab to let us know if you have any trouble with the instructions in this tutorial, or have additional questions and feedback.