Error Establishing A Database Connection Xampp WordPress Mac

Joseph Scott

Show menu Hide menu

MAMP Start Page Error

A few months back I installed MAMP on my MacBook Pro to do local development. I found it a lot easier to manage than a regular MySQL install on Mac. Until things went south. Out of no where my MAMP start page broke and would only return this error:

You don’t have permission to access /MAMP/ on this server.

With an HTTP 403 Forbidden error. The Apache error log provided some additional details:

Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /Applications/MAMP/bin/mamp/

That was enough for me to start looking through the Apache config file – /Applications/MAMP/conf/apache/httpd.conf – to see what needed to be fixed. The Options directive for the start page, and the related pages like /phpMyAdmin, was limited to “Indexes MultiViews”. I didn’t want to bother with spelling out each option that might need to be turned on so I went with “Options All”.

If you have run into this problem then check the Options directive for the following directories: /Applications/MAMP/Library/icons, /Applications/MAMP/bin/phpMyAdmin, /Applications/MAMP/bin/SQLiteManager and /Applications/MAMP/bin/mamp. Change the “Options Indexes MultiViews” line to “Options All” under each of the Directory sections. In my config file that area starts on line 621.

After making those changes re-start MAMP’s Apache and you should be good to go.

Belajar Ngeblog bersama Iskael

Tutorial Ngeblog, Bikin Template Sendiri, Kreativitas dengan CSS

Cara Membuat Blog WordPress Offline

Biasanya aktivitas blogging dilakukan online. Namun, kali ini saya akan membahas bagaimana aktivitas blogging yang dilakukan secara offline. Banyak keuntungan melakukan aktivitas blogging secara offline ini. Salah satunya adalah kamu tidak memerlukan koneksi internet. Selain itu, kamu juga tidak perlu membeli domain dan hosting sebagaimana aktivitas blogging online lazimnya.

Beberapa kasus, seseorang sangat membutuhkan ngeblog offline ini. Salah satunya apabila ingin membuat WordPress theme. Maka tidak mungkin dia harus repot-repot online, karena localhost jauh lebih nyaman daripada online.

Ada beberapa langkah yang harus dilakukan untuk dapat menikmati blogging menggunakan WordPress secara offline. Berikut ini adalah langkah-langkahnya.

1. Download dan Install XAMPP

Untuk melakukan blogging secara offline, kita membutuhkan web server yang terpasang di komputer. Untuk itu kita memerlukan XAMPP yang melayani web server dan juga database yang nantinya dibutuhkan untuk instalasi WordPress. Aplikasi XAMPP ini gratis, kamu bisa men-download-nya di situs resmi XAMPP. XAMPP ini juga tersedia untuk Windows, Mac OS, dan Linux. Kamu bisa memilih sesuai kebutuhanmu.

Setelah selesai download, install XAMPP di komputermu. Untuk Windows, klik ganda installer XAMPP-nya. Lalu ikuti petunjuk selanjutnya, klik Next dan Next. Untuk Mac OS, klik installer .dmg lalu pindahkan XAMPP ke folder Applications. Untuk Linux bisa kamu baca dokumentasi instalasinya di situs resminya.

Langkah selanjutnya adalah mengaktifkan XAMPP. Jalankan aplikasi di komputermu. Untuk Windows dan Mac OS, klik dua kali program XAMPP; secara otomatis akan muncul window aplikasi XAMPP. Lalu aktifkan Apache dan MySQL. Jika sudah aktif, buka browser lalu ketik URL: localhost atau 127.0.0.1. Biasanya kamu akan dibawa ke halaman seperti di bawah ini.

Untuk pengguna Linux, mengaktifkan XAMPP melalui Terminal dengan command line: sudo /opt/lampp/lampp start.

2. Download WordPress

WordPress adalah CMS blog yang paling digandrungi oleh banyak pengguna blog di dunia. WordPress ini bisa kamu dapatkan secara gratis di situs resminya. Untuk men-download WordPress, kamu bisa ikuti tautan ini. Kemudian pilih Download WordPress 3.6.1 (versi terbaru) seperti gambar di bawah ini.

Sebenarnya kamu bisa men-download WordPress versi sebelumnya, namun saya sarankan untuk men-download versi terbaru. Hal ini agar kamu bisa menikmati fitur-fitur terbaru yang disediakan oleh WordPress.

3. Buat Database dan User

Setelah mengaktifkan XAMPP dan men-download WordPress, langkah selanjutnya adalah membuat database dan user-nya. Caranya amatlah mudah. Di browser, ketik URL: localhost/phpmyadmin. Kamu akan melihat tampilan seperti di bawah ini.

Setelah tampilan itu muncul, buatlah database untuk blog WordPress offline-mu. Caranya adalah dengan Create new database. Misalkan nama database-nya adalah blog_db. Kemudian klik Create.

Jika berhasil membuat database, akan muncul notifikasi seperti di bawah ini.

Langkah selanjutnya adalah membuat user untuk mengakses database blog_db yang telah dibuat. Klik pada tab Privileges. Klik Add new User. Lalu isi form sesuai yang dicontohkan di bawah ini.

A question can only have one accepted answer. Are you sure you want to replace the current answer with this one?

You previously marked this answer as accepted. Are you sure you want to unaccept it?

Scalable compute services.

Worry-free setup & maintenance.

Simple object storage.

Run managed Kubernetes clusters.

Easily distribute traffic.

Attach scalable volumes.

Deploy pre-built applications.

Connect, share and learn

DevOps and development guides

Development and systems Q&A

by Justin Ellingwood

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 "No such file or directory")

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 "No such file or directory")

After following all the steps of a tutorial to make a cluster with galley and mariadb.
Everything worked fine until I made a copy and then create a new drop.

No matter what I do I always encounter this error when restarting mysql.

If I never turn off the drop or never recover with a previous image does not give the bug.

But I turn off the drop to make it bigger.
Or I just turn it off and on.

It gives me this error and I did not step from this step.

Did anyone else tube this error?

I had the same problem. I just need to run
sudo service mysql start
it happen to me and worked on it for 15 mins and then I wanted to kick myself in the butt once I figure I need to start mysql. Sometimes it doesn’t always start. 🙂

One of the most common issues I’ve ran in to is the systemd or init script is passing a different path than is defined in your my.cnf file for the socket, thus when you attempt to start or restart MySQL, it fails.

So the best thing to do would be to check my.cnf and the associated configuration files to see what is being defined for the socket. If your MySQL configuration is defining something other than what the startup script is asking for, change socket= to /var/run/mysqld/mysqld.sock , save + exit, and then try to restart MySQL/MariaDB again.

Otherwise, you could do the reverse. Check the startup script and change the path of the socket to match that of what’s defined in your MySQL configuration.

Install WordPress on a Localhost

I’m creating a massive WordPress Theme and Plugin Tutorial, so I will first show you how to install WordPress on a Localhost for development purposes.

If you’re on a PC, you’ll probably want to get the Microsoft Web Platform Installer or Wamp Server. I prefer to install Apache, MySQL and PHP outside of a package system, but I leave that to you.

If you’re on a Mac or UNIX type system the following steps will work easily for you.

Video Tutorial

You can watch a Video Tutorial, or follow the steps that follow the video below?

Download WordPress Here and then open up MySQL, by typing something like mysql5 -u root -p. Then enter your password for MySQL.

Then enter the following to create the WordPress database and WordPress user.

CREATE DATABASE wordpress;

GRANT ALL PRIVILEGES ON wordpress.* TO “your_username“@”localhost” IDENTIFIED BY “your_password“;

Edit the WP-Config-Sample.php File

Then locate the WordPress folder you downloaded and open wp-config-sample.php in a plain text editor.

  • PC – Notepad, Notepad++, etc. (Not Microsoft Word)
  • Mac- Text Wrangler
  • UNIX / Linux – Vim

Look for the following lines of text and enter your Database Name, User Name and Password.

define(‘DB_NAME’, ‘Database Name‘);

/** MySQL database username */

define(‘DB_USER’, ‘Your Username‘);

/** MySQL database password */

define(‘DB_PASSWORD’, ‘Your Password‘);

Then go to this url and get your secret keys WordPress Secret Keys. Copy everything you find there and past it over the space provided in the wp-config-sample.php file.

Now save that file as wp-config.php.

Installing WordPress

Copy the WordPress folder to the location of you Web Server. Then go to the following location in a browser for example if you installed it on your web server in a folder called wordpress.

  • Give Your Development Blog a Title
  • Enter a Username for the WordPress Administrator
  • Enter a Password for the Admin
  • Enter Your Email Address
  • Uncheck Allow My Site to Appear for Search Engines (If this is a Development WordPress Site that you Don’t want the public to see)
  • Click the Install Button and You’re Done

If you have any questions or comments leave them below.

Leave a Reply

Your email address will not be published. Required fields are marked *