Shredder2500
Shredder2500

Reputation: 1085

#2002 Cannot log in to the MySQL server

I am working on a windows server 2012 and trying to get PHPMyAdmin working. I cant get it to connect to the MySQL by root user or a non root user. I have searched and searched all over google. everywhere I saw it said to set allowroot and change localhost to 127.0.0.1 in the config.inc.php file. At first I could not find this file but then I read you have to change config.default.php to it and put it in the root folder. I did that. and here is what I changed

 $cfg['Servers'][$i]['host'] = "127.0.0.1"
//already had the next one set
$cfg['Servers'][$i]['AllowRoot'] = true

I still cant get it to login from any user on MySQL, and I keep getting the error

#2002 Cannot log in to the MySQL server.

config.inc.php: http://u16626886.onlinehome-server.com/config.inc.zip

Testing PHP and MySQL: http://u16626886.onlinehome-server.com:801/test.php

I figured out the problem just need to solve it now. If I put MySQL on the C: drive it works fine but if I put it on the D: drive, which is where I want it, PHP can not connect to it. Does anyone know why that is?

Upvotes: 1

Views: 33322

Answers (4)

Johnbosco Adam
Johnbosco Adam

Reputation: 91

It may be Mysql service is not running, try to start Mysql service

Sometimes Mysql Service May Not Run..
 Try the following
   1. Remove/Unstall the service
            a) Start Cmd As Administrator
            b) Type Mysql --remove
   2. Restart Pc
   3. Install
        a) Start Cmd As Administrator
        b) Use Cd ../ To locate the path for Mysqld (For me it is in C:\xampp\mysql\bin)
        c)Type mysqld --Install
   4. Restart Pc

Upvotes: 2

user3850398
user3850398

Reputation: 11

This was solved my problem on mac.

-config.inc.php-

change

$cfg['Servers'][$i]['AllowNoPassword'] = false;

to

$cfg['Servers'][$i]['AllowNoPassword'] = true;

and then,

-go to terminal -

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

and then come back and reloaded page.

Upvotes: 1

Debasis Sabat
Debasis Sabat

Reputation: 21

This is a 2002 MySQL Socket error, we can resolve this quickly by executing following command

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

Note: Above path is based on MAC, so you can change the path according to your OS

Upvotes: 1

Nishchit
Nishchit

Reputation: 19094

Run SKYPE then using the menus do this:

Tools -> Options -> Advanced -> Connection

Un-Check the checkbox next to 'Use port 80 and 443 as alternatives for incomming connections'

Now restart SKYPE for these changes to take effect.

Upvotes: -2

Related Questions