PHP connection problems with MySQL (Access denied for user) [closed]

1

I'm a beginner in the area that refers to programming and computers. I'm having a problem that I can not get the solution anywhere.

I have a Linux virtual machine with a MySQL server to supply the Zabbix Server monitoring tool (which is already installed on the virtual machine). From my physical machine (Windows) I created an SSH tunnel through Putty, so I can connect PHP (which I installed via Xampp) to MySQL from the virtual machine:

<?php
   $link = mysql_connect('127.0.0.1:3310','root','senha');
?>

The connection is made, however MySQL returns me that the password or user is wrong:

  Warning: mysql_connect (): Access denied for user 'root' @ 'srv-gui'   (using password: YES) in C: \ xampp \ htdocs \ zabbix \ index.php on line 2

The user and password are correct, this is fact, since I can access the MySQL console with them.

Thanks for the help!

    
asked by anonymous 20.01.2016 / 17:25

1 answer

-1

Tries to give user access to access remotely

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' 
    IDENTIFIED BY 'YOUR_PASS' 
    WITH GRANT OPTION;
FLUSH PRIVILEGES;  
    
20.01.2016 / 17:48