LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2012, 07:58 AM   #1
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
Host is not allowed to connect to this MySQL server


i am trying to connect to centos5.x which ip is 192.68.2.65 from 192.168.2.231(mine) via x1.php files and i am getting following error

Code:
Warning: mysql_connect() [function.mysql-connect]: Host '192.168.2.231' is not allowed to connect to this MySQL server in D:\xampp\htdocs\x1.php on line 3
Hata No :1130Hata :Host '192.168.2.231' is not allowed to connect to this MySQL server
i have added following command into /etc/my.cnf ile
bind-address= 127.0.0.1
or
bind-address= 192.168.2.231
or
bind-address= 192.168.2.65

and i run this
grant all prvileges on *.* to root@192.168.2.65
all of them give mysql error 2002

how can i solve this

Last edited by zodehala; 01-16-2012 at 08:01 AM.
 
Old 01-16-2012, 08:12 AM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Make sure root is allowed remote login:

bind-address= 0.0.0.0

Then firewall off all the interfaces you do not actually want MySQL to listen on.

Use:

GRANT ALL PRIVILEGES ON *.* to 'root'@'192.168.2.231' IDENTIFIED BY 'password';

FLUSH PRIVILEGES;

Last edited by klearview; 01-16-2012 at 08:19 AM. Reason: Can add 'WITH GRANT OPTION' since it's for root
 
Old 01-16-2012, 08:49 AM   #3
zodehala
Member
 
Registered: Nov 2008
Posts: 53

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by klearview View Post
Make sure root is allowed remote login:

bind-address= 0.0.0.0

Then firewall off all the interfaces you do not actually want MySQL to listen on.

Use:

GRANT ALL PRIVILEGES ON *.* to 'root'@'192.168.2.231' IDENTIFIED BY 'password';

FLUSH PRIVILEGES;

Thanx but now following error

and my php codes are :

PHP Code:

$link    
mysql_connect("192.168.2.65","root","123");
if(!
$link){
    echo 
"Hata No :".mysql_errno()."Hata :".mysql_error();
    } 
Code:

Warning: mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:553) in D:\xampp\htdocs\x1.php on line 3

Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected in D:\xampp\htdocs\x1.php on line 3

Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in D:\xampp\htdocs\x1.php on line 3
Hata No :2000Hata :mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
 
Old 01-16-2012, 11:53 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,333

Rep: Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891Reputation: 3891
Quote:
Originally Posted by zodehala View Post
Thanx but now following error
and my php codes are :
Code:
Warning: mysql_connect() [function.mysql-connect]: 
Premature end of data (mysqlnd_wireprotocol.c:553) in D:\xampp\htdocs\x1.php on line 3
Warning: mysql_connect() [function.mysql-connect]: 
OK packet 1 bytes shorter than expected in D:\xampp\htdocs\x1.php on line 3
Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ 
using the old insecure authentication. Please use an administration tool to reset your 
password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will 
store a new, and more secure, hash value in mysql.user. If this user is used in other 
scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag 
from your my.cnf file in D:\xampp\htdocs\x1.php on line 3
Hata No :2000Hata :mysqlnd cannot connect to MySQL 4.1+ using the old insecure 
authentication. Please use an administration tool to reset your password with the command 
SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, 
hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or 
earlier you might need to remove the old-passwords flag from your my.cnf file
Did you read the errors posted in bold above?? Try any of those suggestions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Host is not allowed to connect ti this MySQL Server cheesewizz Linux - Server 2 11-05-2010 05:21 AM
Host is not allowed to connect to this MySQL server lothario Linux - Software 1 07-08-2006 09:14 AM
not allowed to connect to mysql server on another machine dsids Linux - Newbie 2 05-26-2006 04:36 PM
ERROR 1130: Host 'testserver' is not allowed to connect to this MySQL server ddaas Linux - Software 1 04-07-2005 01:00 PM
Host XXX.XXX.XXX.XXX is not allowed to connect to this MySQL server ocavid Linux - Newbie 2 03-16-2005 10:40 AM


All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration