How to configure phpMyAdmin from the MAMP installation to use an actual MySQL root password?
After changing the default password for the MySQL root user, we should not forget to edit the phpMyAdmin configuration file. But how do this if we use the MAMP app from appsolute GmbH for local web development on our macOS device. In this tutorial, I’ll show you how to configure phpMyAdmin from the MAMP installation to use an actual password of the MySQL root user.
I’m using version 5.1 of the MAMP app, but in your case there can be any other version of the MAMP app. If you use the non-standard version of the app, but the PRO one, then in the following steps, replace “MAMP” with “MAMP PRO”, respectively.
Let’s begin
All we need to do is edit the phpMyAdmin configuration file from the MAMP installation. This is a really easy process. To do this we have two methods. The first method is using Finder and the TextEdit app, and the second is using the Terminal app. Use the one that is convenient for you. Now, step by step guide.
In this solution we will use the Finder and the TextEdit app. You do not need to download and install anything, because it is already built into every macOS.
If the MAMP app is running, click the Stop Servers button and quit the app.
In the Finder, go to the folder Applications -> MAMP -> bin -> phpMyAdmin .
Open the file config.inc.php in a text editor. As a text editor, I use the TextEdit app, but you can use any other editor. The contents of the file may seem complicated in understanding, but do not worry, we will not change a lot of things.
Replace ‘root’ with an actual password of the MySQL root user.
Save the changes and close the file config.inc.php .
Launch MAMP and click the Start Servers button.
The phpMyAdmin web page located at localhost/phpMyAdmin/index.php .
This is another method to do the same thing as in the previous solution (№1), but with use the Terminal app. You do not need to download and install anything, because it is already built into every macOS.
If the MAMP app is running, click the Stop Servers button and quit the app.
Launch the Terminal app from the Utilities folder of your Applications folder, or use Spotlight to find it.
The contents of the file may seem complicated in understanding, but do not worry, we will not change a lot of things.
Replace ‘root’ with an actual password of the MySQL root user.
Save the changes and close the file config.inc.php .
Launch MAMP and click the Start Servers button.
The phpMyAdmin web page located at localhost/phpMyAdmin/index.php .
Conclusion
That’s it, you’re done. Now you have configured phpMyAdmin to use an actual password of the MySQL root user. So simple isn’t it?
I hope this article has helped you learn how to configure phpMyAdmin from the MAMP installation to use an actual password of the MySQL root user. If this article has helped you then please leave a comment
Thanks for reading!
If this post helped you out and you’d like to show your support, please consider fueling future posts by buying me a coffee cup!
getting to phpmyadmin with mamp
I’m using MAMP, and trying to get to phpmyadmin. loaclhost/phpmyadmin isn’t working.. the sql light is green so it is enabled.
I have changed the Document Root to /Users/troycosentino/Sites/easyuniv/ and when i open the start page from MAMP it is a page created by apple it looks like, not MAMP.
9 Answers 9
If i go to localhost:8888/MAMP it gives me the MAMP screen, from which i can go to phpmadmin.
If MAMP has MySQL Server and Apache Server running.
You can go to phpMyAdmin via url http://localhost/phpMyAdmin/
Try this localhost:8888/MAMP/?language=English
Click on phpMyAdmin tab and you have it.
On Windows pay attention to capital letters:
You can directly access it at the link below, make sure that it contains the same uppercase letters.
Or if you prefer
On macOS MAMP, you need to go to
and from nav-menu choose: tools>PhpMyAdmin
My htdocs folder was only filled with personal projects.
I have no idea WHY this works, but it did for me:
In the httpd.conf folder (do a command + space and search for that if you don’t know what it is already), change your root folder to:
Comment out your OLD document root with a ‘#’, such that it will look like:
Then, repeat those changes for the Directory path:
Stop/Restart MAMP. For good measure, try loading local server in your browser, it shouldn’t work.
Then, undo everything above and change your document and directory roots back to their originals.
Stop/Restart MAMP. Try navigating to localhost/phpmyadmin or localhost:8888/phpmyadmin again.
Not sure exactly why, but it seems to trigger MAMP to behave itself. Hope that helps
Mac OS X: установка и настройка mamp (apache/mysql/php) + phpmyadmin
Для включения apache нужно пройти в «Системные настройки — Общий Доступ» и там установить галочку «Общий веб-доступ».
Так же я столкнулся с проблей отсутствия папки «Сайты» в чистой установке OS X Lion. Если для вас это такая же трагедия как и для меня, то будет достаточно нажать «Создать папку персонального сайта» в «Общий веб-доступ» и все станет хорошо.
С apache’ем в принципе все. Если вам потребуется доставить какие-либо библиотеки то это можно будет сделать при помощи homebrew (о нем посже)
Пункт 2: Настройка PHP
Для начала будет необходимо клчить потдержку php в конфигурационном файле апача (просто раскоментировать строчку).
Для этого (показано на примере TextMate’а)
Далее снять комментарий в строке #111
Для отображения номеров строк в TextMate можно воспользоваться комбинацией клавиш «Option + Command + L (Alt + Яблоко + L)»
Далее немного поправим наш DocumentRoot в httpd.conf для того чтобы localhost ссылался на нашу домашнию дерикторию а не на DocumentRoot «/Library/WebServer/Documents» для этого через find&replace
Find&Replace в Textmate’е вызывается сочетанием Command + F (Яблоко + F)
Все, сохраняем и перезагружаем apache.
Кстати,
Если вы совсем что-то напортачили с httpd.conf вы всегда можете откатиться к настройкам по умолчанию. Для этого необходимо выполнить всего 2 команды.и перезагрузить apache
Далее создадим тестовый info.php файл для проверки работоспособности php
Я вот забыл честно говоря чудную команду, поэтому создадим в mate’е файл info.php след. содержания
И проверим его работоспособность (http://localhost/info.php)
Пункт 3: MySQL (великий и ужасный)
В Mac OS X путей установки MySQL всего два (два оптимальных) — это установк из бинарного dmg пакета и установка через системы управления пакетами.
Пункт 3.1: Установка MySQL в Mac OS X Lion из dmg пакета
Все что нужно для данной установки скачать dmg образ с официального сайта и установить.
Для удобства привожу ссылку на страницу скачки
Хочу обратить ваше внимание на то что все текущие версии Mac OS X имеют x64 архитектуру, поэтому скачивать необходимо пакет с припиской x86_64
И выполним несколько команд:
Пункт 3.2: Установка MySQL в Mac OS X при помощи системы управления пакетами (homebrew)
Какие бывают системы управления пакеты и что с ними делать вы можете прочитать в моем обзорчике (Mac OS X Lion: системы управленияя пакетами (macPorts, homeBrew, etc..))
Пока же отолкнемся от того что вы знаете что это такое и уже имеете установленный и настроенный homebrew
По старой UNIX’вой привычке перед установке сделаем обновление
Если у вас возникли ошибки (у меня возникли) дублирую ссылку на Mac OS X Lion: системы управленияя пакетами (macPorts, homeBrew, etc..)
Далее произведем установку MySQL пакета
Для настройки выполним несколько команд:
Для запуска достаточно ввести команду
В принципе на этом установку MySQL в Mac OS X моно считать законченной. Все должно хорошо работать
Пункт 4: Интерфейс доступа к базам данных phpmyadmin
Тут тоже все достаточно несложно. Достаточно скачать архив с сайта разработчика и распаковать его в нашей домашней директории (директории веб сервера имеется ввиду).
Привожу ссылку для загрузки phpmyadmin
Если вы использовали название папки phpmyadmin и разместили ее в корневой директории вашего веб сервера (/Users/&username%/Sites/phpmyadmin), то доступ к интерфейсу можно получить по адресу http://localhost/phpmyadmin
Решение проблемы с ошибкой #2002 в phpmyadmin на Mac OS X Lion
Наблюдается только в новой версии Mac OS X, раньше с таким не сталкивался.
How to setup phpMyAdmin on a Mac with OSX 10.8 + (MAMP Part 3)
Welcome to part 3 of the MAMP tutorial. In this post we will go over setting up phpMyAdmin on your Mac’s localhost. Part 2 walks you through installing mysql on your localhost read. Part 1 shows you how to setup up Apache on your Mac.
What green means: any lines that you need to replace in this tutorial will be in green.
Step 1
Fix socket error:
Step 2
Download phpMyAdmin:
Go to phpMyAdmin download page and choose the file in your language. I usually download phpMyAdmin-3.5.6-english.tar.gz
Unzip the file, rename it to phpMyAdmin, and move it into your Sites folder. You may need to create a Sites folder in your users directory.
/Users/ username /Sites/phpMyAdmin
Step 3
Setup phpMyAdmin config:
1. Make the config folder
2. Change the permissions
Go to the new phpMyAdmin localhost URL in your browser and run the phpMyAdmin setup
Step 4
Setup phpMyAdmin settings:
1. Open your browser and go to the url
3. The new page will load and click on the “Authentication” Tab
4. Enter the Mysql root user and password (this was set in the previous mysql setup tutorial)
5. Click “Save” – This will take you back to the previous screen.
6. Scroll to the bottom of the page and click “Save” to finish
7. A new file called config.inc.php is now created in the /config directory that we created previously. Move this file from phpMyAdmin/config/ to phpMyAdmin/
8. Delete the /config folder
Step 5
Go to your newly created phpMyAdmin:
1. Make sure your Mysql is running
2. Open your browser and go to the your phpMyAdmin url
3. Login using your mysql username and password
Congratulations! You have now installed phpMyAdmin to run on your Mac’s localhost. Pat on the back.
Share this:
Related
- Tags
By Jonathan Whiting
I enjoy sharing what I am learning and hopefully it’s of interest and help to you. I live in Canada with my wife. Follow me on Twitter.
52 replies on “How to setup phpMyAdmin on a Mac with OSX 10.8 + (MAMP Part 3)”
Hey, this is indeed the simplest, clearest guide to setting up MAMP I have found. Much appreciation for your work.
I worked through Parts 1, 2 and 3 without problems, until I get to Part 3,
Step 5 and cannot log into http://localhost/
richard/phpMyAdmin/
-Though I see “Welcome to phpMyAdmin” page and enter my username/password, I only receive ‘waiting for localhost…’ browser message; the login screen doesn’t change; no error message.
-Cookies are enabled.
-I’ve checked my /Sites/phpMyAdmin/config.inc.php file for username (‘root’ without quote marks) and password; I’m using them in the login screen (though I did try ‘richard’ as username, got same response).
-I’ve restarted Apache & and stopped/started Mysql (in that order).
-I’ve changed the config.inc.php as suggested:
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
to
$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;
-I checked Apache for errors with sudo apachectl -t and received the following:
“httpd: Could not reliably determine the server’s fully qualified domain name, using Richard-Prices-Computer-4.local for ServerName
Syntax OK.” I don’t know if this means anything is wrong or not.
-I’ve tried everything except resetting the mysql password (your first reply to a question). i’m afraid I’m command line ignorant; I couldn’t get those commands to work in Terminal.
-I’m at wits end. Any help?
Thanks,
Richard
Argh. Okay. Figured it out. Disregard my post of yesterday.
I had left my “User for config auth” in the Authentication tab of the “Add a new server” screen set to ‘root’ (failed to change it to my username). Now all is well to this point!
Amazing what a few hours break will do, that plus a 2nd walk thru the steps.
Richard
Sorry for the late response. It is amazing what a couple hours away will do. I’m constantly surprised by that myself. Thanks for taking the time to comment. Have a great day.
Thanks very much for the great tutorial.
I have a problem
Not able to login to phpMyAdmin
I have already changed
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
to
$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;
as per your previous posts. But still it doesn’t work
Can you help me to solve this. I have an interview coming up within 3 days, so I trying to setup and learn php and mysql. Please help me. This is going to be a life saver for me
Thanks Jonathan
Will send you a private email tonight, hopefully will be able to help you resolve this.