Skip to content

Instantly share code, notes, and snippets.

@katopz
Last active December 5, 2016 14:55
Show Gist options
  • Save katopz/c6e967ea7a93580f7ea2 to your computer and use it in GitHub Desktop.
Save katopz/c6e967ea7a93580f7ea2 to your computer and use it in GitHub Desktop.
I hate PHP, MySQL stupid install ever :(

Problem

http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/

phpmyadmin Cannot log in to the MySQL server
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Solution

sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
sudo /usr/local/mysql/bin/mysqladmin -u root -p password

you will ask for password, if not try this

mysql -u root -p

you will see below prompt, now use password that MySQL provide after install

Enter password: 

Now try to change root password, some of below work but I don't know which one

http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'foo';
Query OK, 0 rows affected (0.01 sec)

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('foo');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> UPDATE mysql.user SET authentication_string = PASSWORD('foo')
    -> WHERE User = 'root' AND Host = 'localhost';
Query OK, 0 rows affected, 1 warning (0.02 sec)
Rows matched: 1  Changed: 0  Warnings: 1

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Problem

Apache fuck up 503 Forbidden

Solution

Don't forget to set permission for localhost/foo folder, then

open -a TextEdit /private/etc/apache2/httpd.conf 

And

# Uncomment this
LoadModule php5_module libexec/apache2/libphp5.so

# And use this
DocumentRoot "/Users/katopz/bit/localhost"
<Directory "/Users/katopz/bit/localhost">
    AllowOverride All
    Options Indexes MultiViews FollowSymLinks
    Require all granted
    Allow from all
</Directory>

Problem

phpMyAdmin fuck up

Solution

open -a TextEdit /Users/katopz/bit/localhost/phpMyAdmin/config.inc.php

And

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'foo';

Problem

Mcrypt extension is not enabled

Solution

brew install homebrew/php/php55-mcrypt

To config php.ini

open -a TextEdit /usr/local/etc/php/5.5/php.ini

To restart apache

sudo apachectl restart

Edit permissions

sudo chmod -R 777 ./
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment