Start Mysql Server Mac Terminal

  

We try to click “Start” button on the right hand side to start MySQL Database in XAMPP on Mac OS X. The progressing are show status for “Starting” for 3-5 mins, and we think that these are abnormal situation because of the starting process will take time for 1-2 mins as normally. Question or issue on macOS: I installed mySQL for my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preference, I want to know the instruction to start from command-line. If you want to use MySQL but don’t want to install XAMPP, me too! Let’s take a look at how to do it (and other basic tools/configurations) in Mac First of all, we need to download MySQL. Start MySQL Server on Windows. On Windows, you can start the MySQL Server using the mysqld program as follows: First, open the Run dialog by pressing Windows+R keyboards: Second, type cmd and press Enter: Third, type mysqld and press Enter: mysqld. If the bin folder is not in the Windows path environment, you can navigate to the bin folder e.g. The MySQL server is installed on the Mac, but it does not load by default. Start MySQL by clicking Start using the MySQL Preference Pane, which was installed during the default installation. You can configure MySQL to automatically start when you turn on your computer using the MySQL Preference Pane.

Question or issue on macOS:

Mysql

I have MacOS Sierra. I have installed MySQL Server which has been working, however, after a reboot of the Mac Book, I cannot start the MySQL Server.

I have tried changing the port from 3306 to 3307 in the my.cnf file.

Question

I would appreciate any help on how to start the MySQL Server, and also have it so it starts automatically on MacOS Boot up.

(I am new to Mac, so apologies if this is a basic question).

UPDATE

Looking for error logs, I can’t find anything with todays (2/2/2017) timestamp.

Nothing in the data dir:

No files with “mysql” have been modified since I’ve tried to start the MySQL Server (2/2/2017 after 09:00).

How to solve this problem?

Solution no. 1:

After a discussion with Richard, the following solves the issue:

my.cnf:

Essentially, although we’d added the relevant stanza’s to the my.cnf file, we’d still missed the section heading. Adding the [mysqld] section allowed mysql to start.

Solution no. 2:

I suggest to use Terminal commands.

Start MySQL

sudo /usr/local/mysql/support-files/mysql.server start

Stop MySQL

sudo /usr/local/mysql/support-files/mysql.server stop

Start mysql server mac terminal commands

Restart MySQL

sudo /usr/local/mysql/support-files/mysql.server restart

Start mysql server linux

Solution no. 3:

In my case, I had inadvertently transferred ownership of entire /usr/local directory to myself, which resulted in snatching-away of write permission of /usr/local/mysql-5.7.20-macos10.12-x86_64/data directory from the daemon user called “_mysql“.

Restoring the ownership fixed the issue.

Solution no. 4:

After installing Mysql 8.0.12 on MacOS High Sierra, Mysql server would not start up. I tried several suggestions like removing mysql and reinstalling it, rebooting the computer and changing file permissions, all to no avail. I finally got it to work by removing /etc/my.cnf.

Solution no. 5:

In my case, First time, after installing Mysql, Mac needs a restart.


So restarting Mac, after installation, fixed the issue for me.

MacOS doesn’t come with a my.cnf file. Default settings will suffice the needs for basic usage. Once we need to override them, it makes sense to have a custom configurations.

Solution no. 6:

My problem was that due to an incorrect restart of my machine, a database was corrupted. According to their docs doing a forced InnoDB Recovery did the trick:

Solution no. 7:

In my case, ownership of the msyql directory had somehow changed to admin:admin. I use ares suggestion to run mysqld from the terminal:

Which showed a permissions error writing to a msyql file.

I fixed with this command:

from this post:

Solution no. 8:

This solution works for me.

You have to open the activity monitor up and search for mysqld service. Once selected, just click the delete button located in the up left part and you will see the memory goes down. After that, you can verify your mysql server status from System Preferences and the service is up.

With this solution you don’t have to restart your machine and get to work fast.

Solution no. 9:

My problem was that I installed MySQL a while ago with Homebrew (forgot I did) and then went the more manual route, so I think the two installs were fighting each other. I wiped my Mac of both with the help of this walkthrough: https://gist.github.com/vitorbritto/0555879fe4414d18569d

Note: Where it says to use subl – that’s Sublime, use whatever editor you like.

How to start mysql mac terminal

I was able to get things to work with a fresh install after that.

Hope this helps!

  • Trending Categories
  • Selected Reading
MySQLMySQLi Database

Let us understand how MySQL server can be started and stopped on Linux and Windows −

Linux – Start and Stop Server

On Linux, the start and stop can be done from the command line as shown below −


Linux – Service Commands

Some Linux types offer service command as well −

Start Mysql Server Mac Terminal


(or)



Windows – Start and Stop Server

Let us understand how it can be done on Windows −

  • Open ‘Run’ Window by using Win key + R

  • Type ‘services.msc’

  • Now search for MySQL service based on the version that is installed.

  • Click on ‘stop’, ‘start’ or ‘restart’ the service option.

How To Start Mysql Mac Terminal

Otherwise, the user can start/stop MySQL from the command prompt. It can be done as shown below −


Start Mysql Server Mac Terminal Command

  • Related Questions & Answers