Problem executing 'import mysql.connector' w/ python (MAC OS Mojave 10.14.6) Ask Question Asked 14 days ago. Active 14 days ago. Viewed 64 times -1. I am trying to connect an existing piece of python code to MySQL DB. Now, upon more research, I download pyenv using brew to see if I can manage the versions myself and come to a.

  1. Download Mysql Mac Os Mojave Installer
  2. Download Mysql Mac Os Mojave 10.10
  3. Download Mysql Mac Os Mojave 10.14
  4. Download Mac Os Mojave Installer

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

Installer

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.

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

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: Office mac os x download.

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.

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.

Disk utility for mac. System Disk Utility 2.6.2 for Mac OS X Server 1.2 is a Mac OS program that allows you to select which hard disk your computer will start up from. Mar 12, 2020. Dec 21, 2017. Aug 20, 2007. Aug 08, 2011.

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


Can't start/connect to localhost server, Mac OS Mojave.
Posted by: Jason Kwong
Date: August 15, 2019 09:06PM

Hi all,
I'm getting quite frustrated having spent hours and hours trying to get MySQL and workbench working. I'd deeply appreciate it if any can help. I've downloaded the MySQL 8.0.17 and Workbench 8.0.17. I am running on Mac OS Mojave 10.14.6.
PROBLEM:
I have the MySQL server RUNNING (it says running in Systems Preference -> MySQL) and yet start a local server on my laptop. After I connect to the default local instance 3306, it says server status is stopped and there is no connection. When I try pressing the start server button in 'Instance' -> 'Startup/Shutdown', it says 'Command to start the server is not configured. Please set the command that must be used to start the server in the remote management section of this connections settings.'
I have also tried Setting up my own connection, using Standard TCP/IP, Hostname-127.0.0.1, port 3306, username -root. When I test connection, it says 'Can't connect to MySQL server on '127.0.0.1' (61)'.
Things I've Tried/Useful information:
I've tried many things by following things online. Here are some information that may help:
1) On terminal, I've typed in '/usr/local/mysql/bin/mysql' and it brought me to 'MySQL>'. I typed in 'SHOW GLOBAL VARIABLES LIKE 'PORT';' and it says
Variable_name Value
+---------------+-------+
port 0
I looked this up and apparently it may have to do with skip network.
I then typed 'SHOW VARIABLES LIKE 'skip_networking';' and it says
+-----------------+-------+
Variable_name Value
+-----------------+-------+
skip_networking ON
+-----------------+-------+
Apparently I should turn it off, but I don't know how. There's some stuff about typing 'sudo nano /etc/mysql/my.cnf' and editing the file, but I've tried many many different locations, /../my.cnf but it always comes up with a blank 'new file'. I also don't seem to have a /etc/ file in general.
2) After typing in 'defaults read /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist'
It reads:
{
Disabled = 0;
EnvironmentVariables = {
'MYSQLD_PARENT_PID' = 1;
};
ExitTimeOut = 600;
GroupName = '_mysql';
KeepAlive = {
AfterInitialDemand = 1;
SuccessfulExit = 0;
};
Label = 'com.oracle.oss.mysql.mysqld';
LaunchOnlyOnce = 0;
ProcessType = Interactive;
Program = '/usr/local/mysql/bin/mysqld';
ProgramArguments = (
'/usr/local/mysql/bin/mysqld',
'--user=_mysql',
'--basedir=/usr/local/mysql',
'--datadir=/usr/local/mysql/data',
'--plugin-dir=/usr/local/mysql/lib/plugin',
'--log-error=/usr/local/mysql/data/mysqld.local.err',
'--pid-file=/usr/local/mysql/data/mysqld.local.pid',
'--keyring-file-data=/usr/local/mysql/keyring/keyring',
'--early-plugin-load=keyring_file=keyring_file.so'
);
RunAtLoad = 1;
SessionCreate = 1;
UserName = '_mysql';
WorkingDirectory = '/usr/local/mysql';
}
I've seen when other people do this they show a line towards the end after the 'pid-file' line that tells you the port ID. It doesn't in mine and instead gives me the 'keyring-file' and 'early plugin' line.
3) Whenever I connect to a server (be it localhost / 127.0.01), it doesn't ask me for a password, but it seems to do so on other people's computers.
Thanks very much. Any help is deeply appreciated.

Options:Reply•Quote

Written By
Can't start/connect to localhost server, Mac OS Mojave.
August 15, 2019 09:06PM
Re: Can't start/connect to localhost server, Mac OS Mojave.
August 16, 2019 10:21AM

Download Mysql Mac Os Mojave Installer

Re: Can't start/connect to localhost server, Mac OS Mojave.
August 17, 2019 12:24AM
Re: Can't start/connect to localhost server, Mac OS Mojave.
August 17, 2019 11:16AM

Download Mysql Mac Os Mojave 10.10

Re: Can't start/connect to localhost server, Mac OS Mojave.
August 17, 2019 01:07AM

Download Mysql Mac Os Mojave 10.14

Sorry, you can't reply to this topic. It has been closed.

Download Mac Os Mojave Installer

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.