0

I was able to successfully install MySQL using Brew. The server is started successfully also. I removed the password in the database table user for both root and Nora (my user). However, when I try to connect I get the message access denied.

mysqladmin shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'Nora'@'localhost' (using password: NO)'

Now when I try to enter any password in phpmyyadmin the below message displays:

        #2002 - Socket operation on non-socket — The server is not responding        
        (or the local server's socket is not correctly configured).

Though I have copied mysql.sock as below:

   sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

But the only strange thing is that I found mysql.sock with LOCK refix. mysql.sock.lock. but I copied it manually anyway, could that be the root cause?

bfontaine
  • 18,169
  • 13
  • 73
  • 107
proG
  • 111
  • 1
  • 5
  • 12
  • _I removed the password_ Is it null or an empty string now? Did you remove it correctly with an update statement, or did you just delete it? – baao Sep 02 '16 at 21:36
  • @baao UPDATE mysql.user SET authentication_string = password('') where user ='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 – proG Sep 02 '16 at 21:37
  • Is user `Nora` an existing user for your mysql installation? Which command do you use to connect to the server? Can you connect with `-u root`? Also, I don't understand this "shutdown" thing. – Monkey Supersonic Sep 02 '16 at 21:46
  • Sorry, I didn't read the query right. `authentication_string` is not the password. Try to login with the password you've set on installation. You didn't change your password at all. To change your password, the query is `set Password = PASSWORD(" – baao Sep 02 '16 at 21:48
  • I cannot connect with only -u root it gives me command not found. I use shutdown to exsit as I was setting the password to empty. – proG Sep 02 '16 at 21:50
  • I mean `mysql -u root -p` of corse :-). – Monkey Supersonic Sep 02 '16 at 21:51
  • @baao The problem is I don't now what is the password that I've set. I've followed this link instructions... can you tell me what was it ? https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks – proG Sep 02 '16 at 21:53
  • I don't know it. But you were able to login once to run the query – baao Sep 02 '16 at 21:54
  • @baao yes through the command line by default I suppose, I changed it because I could not login to phpmyadmin – proG Sep 02 '16 at 21:55
  • @MonkeySupersonic Yes the same :( – proG Sep 02 '16 at 21:57
  • I guess user `Nora` does not exist. Also, you did not answer my other questions yet. – Monkey Supersonic Sep 02 '16 at 22:12
  • @MonkeySupersonic I was trying to quite mysql in safe mode. even if Nora does not exists I also tried using root. – proG Sep 02 '16 at 22:15
  • @MonkeySupersonic I've edited the question – proG Sep 02 '16 at 22:21
  • @baao I've edited the question – proG Sep 02 '16 at 22:21
  • Since it is still unclear what you exactly try and what you did, we can't help you here. You probably messed up the password table and therefore you cannot authenticate any more. Hava a look [here](http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html). Good luck. – Monkey Supersonic Sep 02 '16 at 22:25
  • @MonkeySupersonic I have laid everything in the questions. It is not clear because it is also not clear to me what is the problem... All I need is to login and all i get is the above two messages... I think the cause is the mysql.sock as it is changed to mysql.sock.lock. – proG Sep 02 '16 at 22:33
  • @MonkeySupersonic I solved it, thank you for trying to help :) – proG Sep 03 '16 at 14:55
  • @baao I solved it, thank you for trying to help – proG Sep 03 '16 at 14:55

1 Answers1

0

in the End, I was able to log in using root without password. However, that was not the issue, the issue was with the socket location and the host name.

1- I deleted the auto-created file mysql.sock.lock.

2- I changed the location in mysql configuration using the below command:

mysql_config_editor -v set --socket=/tmp/mysql.sock

3- I change the config file in phpMyAdmin as below: (changed the password rule to accept no password, host from localhost to 127.0.0.1 and socket location)

$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = fale;
$cfg['Servers'][$i]['socket']='~/Privare/tmp/mysql.sock';

I hope my solution make it to anyone who has faced similar issue :)

proG
  • 111
  • 1
  • 5
  • 12