Documentation
- Getting Started
- Reference
- Bundles
- Contribute
This page describes how to connect to the MySQL Server of MAMP or XAMPP running on the same computer as Sequel Pro. If you want to connect to MAMP/XAMPP running on a different computer, please see Connecting to a MySQL Server on a Remote Host.
MAMP
Connect to MAMP via a unix socket
This is the recommended way of connecting to MAMP.
In the Sequel Pro connection dialog, choose a socket connection.
- For Ubuntu users with versions 16.04 and 18.04 and Debian 9.x users, use the following commands in the terminal window to start Apache: sudo systemctl start apache2 Check status to see whether Apache is enabled with the command.
- If you want to connect to MAMP/XAMPP running on a different computer, please see Connecting to a MySQL Server on a Remote Host. MAMP Connect to MAMP via a unix socket. This is the recommended way of connecting to MAMP. In the Sequel Pro connection dialog, choose a socket connection.
- MAMP is a free, local server environment that can be installed under macOS and Windows with just a few clicks. MAMP provides them with all the tools they need to run WordPress on their desktop PC for testing or development purposes, for example. You can even easily test your projects on mobile devices.
- MAMP pro comes with loaded features, one of the main attraction is Hosts Management. Many of them who use LARAVEL or Symfony like frameworks need to start the server and restart for any small modifications in main configuration files. This is kinda frustrating.
(0.9.7 and earlier versions: Enter /Applications/MAMP/tmp/mysql/mysql.sock in the socket field. In 0.9.8 and later versions, this socket path will be checked automatically if the field is left empty.)
Type root into the username field. The default password is also root. Optionally enter a name for the connection.
Make sure that MAMP is running and click connect.
Connect to MAMP via a standard TCP/IP connection
MAMP has a basic but very complete configuration center. It is possible to customize aspects such as the type of server to use. Or the location of the projects. Choose the type of server to use.
You can also connect via a TCP/IP connection.
Enter 127.0.0.1 for the Host. Enter root for the username and for the password. The default MySQL port used by MAMP is 8889.
Just like with MAMP, you can also connect to XAMPP via a socket connection or a standard connection. Only the default settings are a little bit different:
Connect to XAMPP via a unix socket
(0.9.7 and earlier versions: The unix socket for XAMPP is /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock. In 0.9.8 and later versions, this socket path will be checked automatically if the field is left empty.)
Use root as username, and leave the password field blank.
Connect to XAMPP via a standard TCP/IP connection
Type 127.0.0.1 into the host field. Since XAMPP uses the standard MySQL port 3306, you can leave the port field blank. The user name is root, the default password is blank.
MAMP pro comes with loaded features, one of the main attraction is Hosts Management. Many of them who use LARAVEL
or Symfony
Top macbook air apps. like frameworks need to start the server and restart for any small modifications in main configuration files.
This is kinda frustrating for developers as this itself becomes big headache. If your not using MAMP Pro and looking for to setup the MAMP then you are at the right place.
Prerequisites
I hope that you might be having Laravel
/ Symfony
kind of frameworks in /Applications/MAMP/htdocs
folder. If still not then go ahead and install one now.
I am using PHP Laravel
framework as an example. Please feel free to use any other framework as per your needs.
Step 1 - Check MAMP Ports & Configuration
Start MAMP server on top left corner go to
MAMP -> Preferences -> Ports
You will something like the following configuration
As you see in the above image I am having
Apache Port
: 8888
Nginx Port
: 8888
MYSQL Port
: 8889
You can reset it to default ports by clicking on
Set Web & MYSQL ports to 80 & 3306
Then your ports will be as follows
Apache Port
: 80
Nginx Port
: 80
MYSQL Port
: 3306
I am leaving for the default one. As in my docker file our company uses port 80
& 3306
as default ports for PHP
& MYSQL
respectively.
Step 2 - Laravel .env
File Setup
Open your Laravel.env
file make sure to make the following changes
I am taking stackcoder
as laravel project and stackcoder.test for local development domain as an EXAMPLE :)
APP_URL - Observe 8888
port, And as you see http://stackcoder.test
is the domain which will be pointing to your Laravel
app in /Applications/MAMP/htdocs/stackcoder
DB_PORT - Observe 8889
port
Step 3 - httpd-vhosts.conf
File To Add Your Virtual Hosts For APACHE
Run the following command.
This will open the httpd-vhosts.conf
file where you need to add the following configuration.
The following code block is mandatory. Don't make any changes to it.
Below the above code add your project settings
DocumentRoot '/Applications/MAMP/htdocs/stackcoder/public/' this point to your Laravel project
ServerName stackcoder.test - You can add any domain name for testing
Your overall httpd-vhosts.conf
will look something like the following
You can add as many projects you need.
Step 4 - Add stackcoder.test
Virtual Host Name In /etc/hosts
Now you have added virtual hosts settings its time to setup stackcoder.test
in the /etc/hosts
file
Step 5 - Reload MAMP
Just go to MAMP and restart (stop & start servers) your MAMP sever
Which macbook pro to buy 2016.
MAMP Main Configuration Page
Step 6 - Test in browser
Now go to your browser and add the following in the url
Make sure to put 8888
port you have not set port 80
as default port
Conclusion
WHATS NEXT?
Once the development of the web application is complete you will be pushing to server. I have curated and written few articles on the same kindly read those.
How To Do Basic Server Security Setup For Ubuntu / Linux
How To Install Linux, NGINX, MYSQL, PHP (LEMP Stack) on Ubuntu
How To Install Linux, Apache, MYSQL, PHP (LAMP Stack) on Ubuntu
Comments are closed.