mySQL problem

Questions about hosting a Website, using MySQL, PhP or MariaDB may be posted here.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

mySQL problem

Postby roadkill401 » Mon Aug 27, 2012 9:45 pm

I am trying to move my website from a hosted server to my own. I have gotten most of the php to work but am stuck on the mySQL link to my database

I have created an account and database through phpMyAdmin. in my code I am trying to connect to it

function db_connect()
{
$connection = mysql_pconnect('192.168.5.82:3306', mod note: credentials removed for your own security);

if(!$connection)
{
echo"No connection";
return false;


But I have not figured out what I am doing wrong. I am not a big php programmer but managed to get it working fine when hosted with netfirms. I want to get this running local. any help is appreciated.
Synology DS209 (4.1.2668) DS212+ (4.1.2668)
roadkill401
Beginner
Beginner
 
Posts: 22
Joined: Sun Sep 11, 2011 11:27 pm

Re: mySQL problem

Postby roadkill401 » Mon Aug 27, 2012 10:09 pm

the exact error that i am getting is:

Warning: mysql_pconnect(): Access denied for user mod note: username removed for your own security@'PStore1' (using password: YES) in /volume1/web/realwoodbox/db_fns.php on line 9 No connection
Synology DS209 (4.1.2668) DS212+ (4.1.2668)
roadkill401
Beginner
Beginner
 
Posts: 22
Joined: Sun Sep 11, 2011 11:27 pm

Re: mySQL problem

Postby HarryPotter » Tue Aug 28, 2012 4:18 pm

Not 100% sure, but I think If your script is running on the DS itself, you have to use "localhost" or "127.0.0.1" (which is the same as localhost) instead of the LAN-IP of your DS. BTW: The port is not needed as long as you use the default one (3306). If you use the LAN-IP of your DS the DS probably thinks you are connecting from outside, and per default your user has only local access (could be changed on phpMyAdmin)
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS713+ / DSM 5.0-4458-1 / 2 x HD204UI (RAID0) / LMS 7.7.3-032
DS712+ / DSM 5.0-4458-1 / 2 x HDS721010KLA330 (RAID0)
DS110+ / DSM 5.0-4458-1 / HD154UI
DS408 / DSM 4.0 2228 / 2 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1637 / ST31000340AS + WD5000KS

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 14117
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland


Return to Web Server + PHP / MySQL + MariaDB

Who is online

Users browsing this forum: No registered users and 3 guests