473,785 Members | 2,299 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't connect to the remote MySQL db

76 New Member
hi,
can anyone tell me what am i doing wrong here. i'm trying to connect remotely to the MySQL database on a server (SunOS multivac 5.9 sparc SUNW,Sun-Fire-V240). i know that the username and the password are correct, but it keeps giving me this error:
DBI connect('mydb:m yhostname:1234' ,'username',... ) failed: Access denied for user 'username'@'com pname-345-56.abcd.edu' (using password: YES) at myscript.pl line 5
Error: Access denied for user 'username'@'com pname-345-56.abcd.edu' (using password: YES)

i would appreciate your help.


Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use DBI;
  4.  
  5. my $dbh = DBI->connect ("DBI:mysql:mydb:myhostname:1234","username","password") or die "Error: $DBI::errstr\n";
  6. my $sql = "SELECT info FROM mytable limit 2";
  7. my $in = $dbh->prepare($sql);
  8. $in->execute;
  9.  
  10. print "Content-type: text/html \n\n";
  11. print STDOUT "$in\n";
  12.  
Oct 13 '07 #1
2 2231
mwasif
802 Recognized Expert Contributor
You must have to GRANT permissions to user username to connect remotely.
Nov 6 '07 #2
crckdns
1 New Member
...which is cause of security-point.. disabled ;) (networking disabled)

to "bypass" that, you could use Putty to make a port-tunnel, so your script would connect to 127.0.0.1 to port xxxx which just forward you trought putty-tunnel into remote machine and connect there as "localhost" which is normaly not restricted..
(for this case u should have a shell access to the remote machine!)
if not, then ...just put the php on the remote machine (since u have sql access, u should have ftp access too, else you have got a real problem ^^)

guide for putty:(
Configuration -> Connection -> SSH -> Tunnels
add there in "source port" the port your php script is using, normaly 3306
in Destination add sth like 127.0.0.1:3306 and let protocol and direction both at "auto"
then just click add ..et vóila XD , connect per ssh to the shell, now u can start your php script on your local machine (where u changed the host to 127.0.0.1 XD) and it will work
);

regards
cracky
Nov 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
6490
by: Eric W. Holzapfel | last post by:
Hello PHP group, I have mysql running on a linux box. I have apache (2.0.4) running on a diff linux box. I have php 4.X. I can connect to the mysql db using odbc from a windows box, but cannot connect to the remote db from web server box (linux) to mysql database (another linux box). Apache is on RH Enterprise 3.0, mysql is on slacware (2.4.22 kernel). I am using php, require_once('DB.php'), and the dsn style connect string:...
1
3506
by: webhead74 | last post by:
Hi, I've worked on this for a couple of days & can't figure out what I'm doing wrong. I'm trying to connect to a remote AS400 database using odbc & php. Here's my environment: Server: RedHat ES 2.1 IBM HTTP Server (was pre-built by IBM): Server version: IBM_HTTP_Server/2.0.47.1 Apache/2.0.47
0
9013
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try to connect from a remote location using: mysql -h xxx.xxx.xxx.xxx -P 3306 -u root -p mysql I get: ERROR 2003: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061) When I try:
3
18990
by: Sander Smeenk | last post by:
Hello! I'm trying to set up replication between two servers and even though I did everything according to the documentation, the slave keeps failing to connect to the master like this: | 050119 0:23:43 Slave SQL thread initialized, starting replication in | log 'zwart-bin.001' at position 79, relay log './blauw-relay-bin.001' | position: 4 | 050119 0:23:43 Slave I/O thread: error connecting to master
16
27924
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my linux box" will do nicely) Host/Server Name (or IP) - something like MSQLUserName@ServerName.net...
1
4512
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all servers are Fedora 4 with latests updates). The one that worked fine it down and I cannot compare anything against it (it was a client also). My problem is, when I try to connect to the server I get:
47
1960
by: Lauren Wilson | last post by:
One more try. After ransacking the Desktop AND Enterprise edition of Ken Getz Dev Handbooks on Access 2002, I STILL don't know if it is or is not possible to link a client side MDE with a WEB server MDB table using ADO. Does ANYONE know the correct answer to that question?
4
2674
by: courtney.machi | last post by:
Hello, I am trying to connect to a remote mysql server through php. Here's the code: mysql_connect("my.hostname.edu", "username", "password") or die (mysql_error()); mysql_select_db("db_name") or die ("unable to select db".mysql_error()); $r1 = mysql_query('SELECT * FROM table') ;
1
3163
by: ynyus75 | last post by:
Hey! I am unable to connect some of the services that I host from my laptop at home, such as SMTP and MySQL on port numbers 25 and 3306 respectively. But I am able to some services such as Telnet, Remote Desk Connection, SSH. Here are my details ISP: Time Warner Connection Type: Cable Router: Lynksys Port Farwarding: enabled port farwarding to HTTP, Telnet, HTTPS, Remote Desktop Connection, SSH, MySQL etc to my laptop. Connection Type...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.