Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2004, 01:23 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default php client interface?

Hello to all,

I am trying to access mysql server from a remotely via SQLyog. I am having absolutely no success. Can someone tell me if this is even possible? do i have to somehow configure it to enable external access?

Thank you for all your help...
 
Old August 12th, 2004, 04:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For any external access, your first step is to determine the IP address of the machine you are running on (IPCONFIG at a command prompt will tell you this*). Now create a MySQL user account with the necessary permissions, whose 'Host' field is set to the IP address of your client machine. FLUSH PRIVILEGES, and see if you can connect as that user. Let us know how you get on.

Take it easy,
Dan
 
Old August 12th, 2004, 09:57 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Daniel,

thanks for responding to this posting... I tried exactly what your suggested and no luck what so ever... I got a error message;
Erro No. 1130
Host 'hostname' is not allowed to connect to this Mysql server...

I don't know if its from my server or just my client, but it definitely does look like a server issue...

Any further assistance is greatly appreciated...

thanks
 
Old August 12th, 2004, 10:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

MySQL gives an error 1045:

"Access denied for user <user>@<IP addy> using Password: Yes"

...or something along those lines. You'll need access to port 3306 on the server. Is there a firewall in the way?
 
Old August 12th, 2004, 10:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, that's nonsense, since you're getting a MySQL error message at all :)...

So... here's an idea: check whether network access is enabled in the MySQL server at all. Access may be locally bound to localhost only. Look for 'bind-address' in my.cnf. If it's there and it's bound to 127.0.0.1, comment out that line, restart mysqld and see if you can get on then.
 
Old August 12th, 2004, 10:59 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Daniel,

this is my setting:


#This File was made using the WinMySQLAdmin 1.4 Tool
#4/6/2004 10:34:55 AM

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=C:/mysql
#bind-address=127.0.0.1
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=user
password=user


I did try uncommenting port and attempt to connect but it didn't work as well, it keep on giving me the error: 1130.

this is baffling, i do appreciate all your assistance...
 
Old August 12th, 2004, 11:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay. Next thought to ooze towards the top of my consiouceness, then:
You've checked that you added the user's password using the password() function?

Mysql does not store the actual password; only a hashed version of it. The password function generates that hash.
 
Old August 12th, 2004, 11:40 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

IN fact, can you get onto a commandline on the server and (in the mysql commandline client) try the command:

show grants for dungey@162.168.42.42 <- or whatever

That'll give you a minature report, along the lines of:
+-------------------------------------------------------------------------------------------------------------------+
| Grants for dungey@192.168.42.42 |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'dungey'@'192.168.42.42' IDENTIFIED BY PASSWORD '4430a13e4b3adff2' |
+-------------------------------------------------------------------------------------------------------------------+

Or, it'll say something like:

ERROR 1141: There is no such grant defined for user 'dungey' on host '192.168.42.42'

Which will put you half way along to finding which end the problem lies at.
 
Old August 12th, 2004, 12:32 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Daniel, Daniel, Daniel,

I don't know what to say besides, i am not right in the head today... Cause I went back to the user that I created on the server and realized that the IP address that I assigned it was incorrect. Infact I assigned it the ip address of the server not of the clients station.

Before I end this message, I would like to ask you one last question. No other user trying to connect from an external location with a host that isn't added as a user can access mysql?

Thank you so much for your quick responses and your help.
--dungey
 
Old August 13th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No. The main thing to look out for in your mysql.user table is entries where a host of '%' is provided. '%' in the user table means just what it means in any other table - the SQL wildcard symbol - i.e. "any host". So if you want to lock out access to users on any remote host, make sure you delete any user entries with host '%' (admitedly, they'd still need the login details for that user, of course). I think the Windows version of MySQL defaults to providing an additional entry for root at host '%', as well as 'localhost', for instance.

You might want to also look into the mysql.tables_piv, columns_priv and mysql.db, which lock down access at a table, database or even table-column level (i.e. user can select anything for database 'customers', can update columns 'amount_ordered', 'price' and 'delivery_date' in table 'customer_orders' in the 'orders' database, and can create, drop, update insert select and delete tables in the database 'dumping_ground_for-temporary_table_hacks_and_stuff'). All of this on a host-by-host, user-by-user basis. It's very "granular", as the jargon goes.

Take it easy,
Dan




Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting client to client (Socket programming) maricar C# 0 September 25th, 2008 04:34 AM
setup for php application for client viztech PHP How-To 0 October 10th, 2007 12:38 AM
how to view client registery values using php scri method PHP How-To 0 March 28th, 2006 10:57 PM
Regarding Interface ndr1977 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 July 30th, 2003 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.