- Как установить MySQL на Mac OS?
- Подготовка
- Как установить MySQL на Mac OS?
- Как пользоваться?
- Запуск
- Перезапуск
- Устанавливаем пароль на root
- Удаленный доступ к серверу
- Как удалить MySQL на Mac OS?
- Brew’ing PHP, MySQL & Nginx on Mac OS X
- Installing PHP 5.4 (with FPM) on Mac OS X
- Adding PHP-FPM to startup routine
- Installing MySQL on Mac OS X
- Adding MySQL to startup routine
- Manual Start/Stop
- Changes to MySQL Config (optional)
- For security
- For workbench
- Installing Nginx on Mac OS X
- Adding Nginx to startup routine
- Changes to Nginx Config (optional)
- Troubleshooting
- Finding default location of config/error files for PHP, MySQL & Nginx
- Share this:
- Like this:
- 15 responses to “Brew’ing PHP, MySQL & Nginx on Mac OS X”
- Как правильно установить MYSQL на Mac OSX
- jonjack / install-mysql-and-workbench-on-mac-os-using-brew.md
- This comment has been minimized.
- savio777 commented Mar 3, 2020
- This comment has been minimized.
- marcospojr commented May 7, 2020
- This comment has been minimized.
- Devcodpanda commented May 26, 2020
- This comment has been minimized.
- clemderome commented Jun 3, 2020
- This comment has been minimized.
- yosephNoh commented Jul 2, 2020
- This comment has been minimized.
- bioyeneye commented Jul 3, 2020
- This comment has been minimized.
- riapacheco commented Aug 12, 2020
- This comment has been minimized.
- TheBrown commented Dec 21, 2020
- This comment has been minimized.
- aakanksha-bb commented Feb 18, 2021 •
- How to install MySQL on macOS
- Step by step instructions to install MySQL on macOS using Homebrew
Как установить MySQL на Mac OS?
MySQL установить на компьютер с MacOS очень просто. Это сделать также просто как установить на Linux. Для установки нам понадобится пакетный менеджер brew и 5-10 минут свободного времени.
Подготовка
Как Вы уже поняли для установки MySQL на Mac OS нам понадобится brew, в котором есть все из мира Linux. Если у Вас его еще нет на Mac`е, то установить можно командой:
Многие разрабы считают, что такие вещи захламляют Mac и им нет места на их компьютере. И что предпочтительно устанавливать MysSQL через докер. Но brew очень бережно относится к вашей операционной системе и при выполнении команды на удаления, он полностью удалить MySQL из ОС.
Как установить MySQL на Mac OS?
Для установки нужно выполнить команду:
Если Вам по какой-то причине нужно установить определенную версию, то в конце указываем mysql@нужная_версия . Примерно вот так — brew install mysql@5.7
Чтобы Ваш мак «научился» работать с алиасом – mysql, нужно создать линк. Это нужно чтобы в консоли было удобно управлять через команду mysql. Для этого выполним:
Если был установлен MySQL 5.7, то команда будет такой: brew link —force mysql@5.7
Если хотите, чтобы MySQL запускался всегда при включении компа, то вот команда для этого:
Эта команда не зависит от версией установленного MySQL.
Вот и все! Сервер баз данных MySQL установлен на ваш Mac OS.
Как пользоваться?
Запуск
Если Вы не сделали автоматическую загрузку сервиса MySQL, то запустить его вручную можно вот так:
Перезапуск
Устанавливаем пароль на root
По умолчанию на root в MySQL не установлен пароль. Исправить просто! Выполняем по очереди команды:
Не забываем, что:
- password — это ваш пароль,
- localhost — это означает, что подключиться к серверу можно будет только с локальной машины. Если нужен доступ извне, то меняем это на знак % или 192.168.0.0, если для безопасности нужно ограничить подключение только из локальной сети.
Удаленный доступ к серверу
Файл конфигурации MySQL на MacOS находится по адресу /usr/local/etc/my.ini. По умлчанию доступ к серверу ограничен только локальной машиной, где он установлен. Чтобы снять это ограничение, нужно в файле конфигурации внести изменения:
Как удалить MySQL на Mac OS?
С пакетным менеджером brew также легко удалять пакеты, как их устанавливать.
Для удаления Mysql на Mac OS воспользуйтесь командой:
Источник
Brew’ing PHP, MySQL & Nginx on Mac OS X
There are many ways to install PHP, MySQL & Nginx on Mac. Here we will be doing it using brew.
Installing PHP 5.4 (with FPM) on Mac OS X
Search for available PHP formulas (formula’s in homebrews are equivalent to packages in aptitude)
It will return long list of php 5.2, 5.3, 5.4 packages. We need 5.4. Tap it using:
If you do not tap homebrew/dupes you will get Error: No available formula for zlib
Before we build PHP 5.4, you may like to exercise options using:
We have built it using:
After long wait, you can verify php & php-fpm version using php -v and php-fpm -v respectively.
Adding PHP-FPM to startup routine
Please check exact plist filename in /usr/local/Cellar/php54/
To Start PHP-FPM:
Installing MySQL on Mac OS X
Run following command:
In case you need mysql-workbench, please download it from here. It cannot be installed via brew.
Adding MySQL to startup routine
Please check exact plist filename in /usr/local/Cellar/mysql/
Manual Start/Stop
Start mysql: /usr/local/mysql/support-files/mysql.server start
Stop mysql: /usr/local/mysql/support-files/mysql.server stop
See other options – /usr/local/mysql/support-files/mysql.server -h
Changes to MySQL Config (optional)
For security
For workbench
Following changes will make it easy to use MySQL WorkBench
Installing Nginx on Mac OS X
Run following command:
Adding Nginx to startup routine
Please check exact plist filename in /usr/local/Cellar/mysql/
Changes to Nginx Config (optional)
By default, Nginx setup expects you to define all virtual hosts in /usr/local/etc/nginx/nginx.conf
Edit default config file and following line to http <..>block
Troubleshooting
Finding default location of config/error files for PHP, MySQL & Nginx
I did not get any error but after getting used to Ubuntu-conventions, I struggled to find where are config/log files and other defaults are present.
3 commands below turned out to be life-saver:
- brew list nginx
- brew list php54
- brew list mysql
Brew’s list command shows all files/folders created by a package. Once you see output, you will notice, why I was getting lost!
If you come across any other error, feel free to use our support forum. We will try to fix it there.
Share this:
Like this:
15 responses to “Brew’ing PHP, MySQL & Nginx on Mac OS X”
Not so far I have found new cool tool to work with mySQL on mac os x – Valentina Studio. Its free edition can do things more than many commercial tools!!
I very recommend check it. http://www.valentina-db.com/en/valentina-studio-overview
You can install Valentina Studio (FREE) directly from Mac App Store: https://itunes.apple.com/us/app/valentina-studio/id604825918?ls=1&mt=12
Thanks for sharing. I will have a look at it.
Yes of course. But I agree to some people from this discussion http://www.reddit.com/r/webdev/comments/1fxcyd/try_valentina_studio_a_new_free_gui_manager_for/ that Workbench sometimes is awful.
I recommend Sequel Pro, which I find to be by far the best free MySQL-manager for OSX, check it out if you haven’t tried it yet: http://www.sequelpro.com/
Looks like sourceforge mirror from which download in progress timed out. You can try again whole commands.
Such errors should be temporary!
checking for libpng… configure: error: `libpng-config’ not found;
either set the LIBPNG_CFLAGS and LIBPNG_LDFLAGS environment variables,
or pass `–without-png’ to the `configure’ script.
make: *** [setup] Error 1
—————————————————————————–
This is the error I get when I try to install php. What should I do to solve this?
Seems like it might be easy to solve but I am really new to this
From above error looks like you do not have LIBPNG library.
Try installing libpng or libpng12 package via brew first.
If it doesn’t work after that as well, just you share brew commands you have used?
Brew link is pointing to “Page not found”
Is there any detail tutorial on Brew, like what is brew, its pros/cons and how to install and use?
Fixed. There homepage is changed to http://brew.sh/
Brew is package-manager. For pros/cons, you may Google. If you are familiar with MacPorts, you can think of its a better (IMHO) replacement to MacPorts.
Источник
Как правильно установить MYSQL на Mac OSX
В предыдущей заметке я рассказывал как удалть Mysql с вашей системы, в этой же заметке давайте поговорим о том как правильно его установить. Давайте начнём с простого и согласимся что в век пакетных менеджеров устанавливать что либо в ручную это как минимум нелепо.
Так вот для усановки дополнительных пакетов в Mac Os существует прекрасный менеджер компонентов Homebrew его то мы и будет использовать. Если у вас по каким то причинам ещё не установлен данный чудесный инструмент, немедленно его установите следующей командой:
Ну а теперь вы можете одной лишь командой установить вообще всё что угодно в вашу Mac Os в том числе и MySql. Вот так вот просто и быстро:
Так как сейчас актуальная версия сейчас 8.x, а мне пока что больше по душе 5.7, если вы с числе таких-же ратроградов, вам поможет вот такая команда:
Всё наш sql сервер установлен и готов рватся в бой. Давайте теперь немного сконфигурируем его:
Для конфигурации запустите сервер:
Зададим пароль пользователю root
Если на этом этапе у вас возникнет проблема с тем что терминал не знает команды MySQL выполните линковку с версией 5.7 или той, которую вы выбрали в качестве фаворита
Для запуска последующего запуска сервера Mysql
Для администрирования баз данных в OSX я предпочитаю использовать программу Sequel Pro вместо пресловутого PhpMyadmin возможно вам будет интересно попробовать что то новое для себя =) Кстати программа бесплатная и чертовски удобная. Позволяет подключатся по SSH к вашим удалённым серверам ну и с локальным справляется просто отлично!
Источник
jonjack / install-mysql-and-workbench-on-mac-os-using-brew.md
See what formula are available.
Install a version.
Install Workbench (Pre-Catalina)
If on Catalina then skip to next section. 👇
You should see MySQLWorkbench under Applications
Guidelines for Catalina
The current version of mysqlworkbench (8.0.23) for Catalina at time of writing (June 2021) is 8.0.23 which appears to be buggy for certain updates of Catalina. Dropping down one version to 8.0.22 worked for me as follows.
If already installed then remove first.
Download formula for 8.0.22.
There is also a formula here which will install v8.0.25 compatible with Big Sur.
This comment has been minimized.
Copy link Quote reply
savio777 commented Mar 3, 2020
This comment has been minimized.
Copy link Quote reply
marcospojr commented May 7, 2020
This comment has been minimized.
Copy link Quote reply
Devcodpanda commented May 26, 2020
This comment has been minimized.
Copy link Quote reply
clemderome commented Jun 3, 2020
This comment has been minimized.
Copy link Quote reply
yosephNoh commented Jul 2, 2020
This comment has been minimized.
Copy link Quote reply
bioyeneye commented Jul 3, 2020
This comment has been minimized.
Copy link Quote reply
riapacheco commented Aug 12, 2020
This comment has been minimized.
Copy link Quote reply
TheBrown commented Dec 21, 2020
This comment has been minimized.
Copy link Quote reply
aakanksha-bb commented Feb 18, 2021 •
For me, it’s not working.
MySQLWorkbench comes under Applications, after opening it, it says «MySQLWorkbench quit unexpectedly.
log —
`
Process: MySQLWorkbench [64860]
Path: /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench
Identifier: com.oracle.workbench.MySQLWorkbench
Version: 8.0.23.CE (1)
Code Type: X86-64 (Native)
Parent Process: . [1]
Responsible: MySQLWorkbench [64860]
User ID: 501
Date/Time: 2021-02-18 09:36:39.120 +0530
OS Version: macOS 11.1 (20C69)
Report Version: 12
Bridge OS Version: 5.1 (18P3030)
Anonymous UUID: F551C371-BBD3-D52F-6EC3-50FB97A14E07
Sleep/Wake UUID: C71F0690-CB95-470A-8ADF-CCE29195939F
Time Awake Since Boot: 36000 seconds
Time Since Wake: 1400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Abort trap: 6
Termination Reason: Namespace SIGNAL, Code 0x6
Источник
How to install MySQL on macOS
Step by step instructions to install MySQL on macOS using Homebrew
Published Jan 05 2020
On macOS, you can install MySQL easily using Homebrew.
The above command should take a while, then print something like this:
You can now start the MySQL server by running:
Now we need to secure the MySQL server. By default the server comes without a root password, so we need to make sure it’s protected.
The procedure can take a while, but it gives a lot of power to make sure you get the best defaults out of the box:
Since we used brew services start mysql to start MySQL, your Mac will re-start it at reboot. You can run:
to stop this from happening, and also to immediately stop MySQL.
You can also avoid this daemon mode (that’s what we call programs that always run in the background and restart when the computer is restarted) by running:
This will start MySQL and will keep it running until the computer is shut down, or until you run:
and it will not re-start it at reboot.
It’s up to you to decide which one you prefer.
Now you can connect to the server using the command:
You will need to type the root user password after you run this command, and once you are done you should see this screen:
A great GUI (graphical) software we can use to interact with a SQLite database is TablePlus.
It comes with a free trial that’s perfect for our usage, because it’s not time-based but rather it limits the amount of concurrent connections you can make to the database.
Download it from https://tableplus.com. I know there are macOS, Windows and Linux versions.
Click “Create a new connection…” and select MySQL in the list:
then set a name for the connection, and enter “root” and the password you set previously:
Click Connect , and you should be connected to MySQL!
Note that we are connected using the root user, which should only be used for administration purposes.
Day to day use of a database should be done using a normal user. We’ll see it in a separate tutorial.
Источник