MAMP and mysql problem

slavcho

Member
Hello guys. I have a very very big problem and i am starting to get desperate.
First to introduce you to my problem.
I wanted to program some applications with PHP and do to that so i needed to install mysql server and MAMP. The problem is when i start the MAMP servers on ports 8888 for apache and 8889 for mysql and go to mysql workbench to create a new connection on port 8889 it requires me a root password which i enter it but it does not accept it. If i create new connection with 3306 port it also requires me to enter a root password and it works when i enter it.. but this way i have to change the mamp mysql port from 8889 to 3306 and restart it. When i restart mamp working now on port 3306 it won't start. it starts just the apache server.. What is the f-ing problem? Also i made a php file and copied to the mamp location and then tried to open it and it gave me this problem
Connection failed: Access denied for user 'root'@'localhost' (using password: YES).
Also to mention if you stop the mysql server in mac system preferences, then mamp will allow you to start mysql server on 3306 port but when you create the connection in mysql workbench it will show a warning: failed to connect to mysql at localhost:3306 with user root - cant connect to mysql server on '127.0.0.1' (61).
I can't understand why everything has to be so hard to make.. can someone help me how to setup this right?
 
You might have something using that port. Skype is one program that can interfere.

I'd suggest you try Xampp.
 
When i restart mamp working now on port 3306 it won't start. it starts just the apache server.. What is the f-ing problem? Also i made a php file and copied to the mamp location and then tried to open it and it gave me this problem
Connection failed: Access denied for user 'root'@'localhost' (using password: YES).
It is not a port issue, this is a common problem for MySQL. This may work:
Code:
$ sudo su mysql
$ mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pick a password';
mysql>\q
or
Code:
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo mysqld_safe --skip-grant-tables
$ mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'pick a password';
mysql> \q
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/support-files/mysql.server start
If you were to install Xampp, you would likely run into the same issue. MariaDB uses the same login permission model.
 
i made that but i figured out what was the problem.. the root password when performing the command for changing, it changes the root password for the not for the mamp mysql but the other mysql, downloaded from the oracle site, i have installed.. i figured out also the mamp mysql root password, it is the default also "root".. how can i change the root password for the mamp mysql and not for the oracle mysql which is controlled from the terminal by default? thanks
 
Should be a matter of connecting to the mamp mysql, /Applications/MAMP/Library/bin/mysql, and issue an alter user like above.
 
Back
Top