Jump to content

php membership system on 000webhost

Hello,

 

If anyone has any experience setting up a PHP membership system on 000webhost with mysql and phpmyadmin I am stuck.  I've set up a membership system in the past, but I was doing my own hosting and everything just seemed to work.

 

Error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a6201318_carter'@'localhost' (using password: YES) in/home/a6201318/public_html/base.php on line 9

 

 

Base.php

<?php

 

session_start();
 
$dbhost = "localhost"; 
$dbname = "a6201318_member2";
$dbuser = "a6201318_carter";
$dbpass = "correct";
 
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());

 

?>

 

Any help would be greatly appreciated, I really need to hear from someone else because I've exhausted everything I can think of.

 

Thanks,

TidaLWaveZ

 

 

 

 

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

Site is www.beersinthewater.com if you need to see the full php error

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, TidaLWaveZ said:

Hello,

 

If anyone has any experience setting up a PHP membership system on 000webhost with mysql and phpmyadmin I am stuck.  I've set up a membership system in the past, but I was doing my own hosting and everything just seemed to work.

 

Error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a6201318_carter'@'localhost' (using password: YES) in/home/a6201318/public_html/base.php on line 9

 

 

Base.php

<?php

 

session_start();
 
$dbhost = "localhost"; 
$dbname = "a6201318_member2";
$dbuser = "a6201318_carter";
$dbpass = "correct";
 
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());

 

?>

 

Any help would be greatly appreciated, I really need to hear from someone else because I've exhausted everything I can think of.

 

Thanks,

TidaLWaveZ

 

 

 

 

Seems like it's NOT accepting your account. Are you the admin? 

CPU: AMD Ryzen 5 5600X | CPU Cooler: Stock AMD Cooler | Motherboard: Asus ROG STRIX B550-F GAMING (WI-FI) | RAM: Corsair Vengeance LPX 16 GB (2 x 8 GB) DDR4-3000 CL16 | GPU: Nvidia GTX 1060 6GB Zotac Mini | Case: K280 Case | PSU: Cooler Master B600 Power supply | SSD: 1TB  | HDDs: 1x 250GB & 1x 1TB WD Blue | Monitors: 24" Acer S240HLBID + 24" Samsung  | OS: Win 10 Pro

 

Audio: Behringer Q802USB Xenyx 8 Input Mixer |  U-PHORIA UMC204HD | Behringer XM8500 Dynamic Cardioid Vocal Microphone | Sound Blaster Audigy Fx PCI-E card.

 

Home Lab:  Lenovo ThinkCenter M82 ESXi 6.7 | Lenovo M93 Tiny Exchange 2019 | TP-LINK TL-SG1024D 24-Port Gigabit | Cisco ASA 5506 firewall  | Cisco Catalyst 3750 Gigabit Switch | Cisco 2960C-LL | HP MicroServer G8 NAS | Custom built SCCM Server.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

it's a  problem with host after you set it up or change it's password. Took mine 2 days before it would let me in. However do check the username and password are correct

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Abdul201588 said:

Seems like it's accepting your account. Are you the admin? 

 

Yes, I've checked the password multiple times and confirmed I can log in via phpmyadmin

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, vorticalbox said:

it's a  problem with host after you set it up or change it's password. Took mine 2 days before it would let me in. However do check the username and password are correct

 

I've noticed that as well but I currently can get into phpmyadmin, so my base.php should be able to connect as well right?

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, TidaLWaveZ said:

 

Yes, I've checked the password multiple times and confirmed I can log in via phpmyadmin

login into phpmyadmin and go to "privileges" and check whether your account is set to "all privileges" 

CPU: AMD Ryzen 5 5600X | CPU Cooler: Stock AMD Cooler | Motherboard: Asus ROG STRIX B550-F GAMING (WI-FI) | RAM: Corsair Vengeance LPX 16 GB (2 x 8 GB) DDR4-3000 CL16 | GPU: Nvidia GTX 1060 6GB Zotac Mini | Case: K280 Case | PSU: Cooler Master B600 Power supply | SSD: 1TB  | HDDs: 1x 250GB & 1x 1TB WD Blue | Monitors: 24" Acer S240HLBID + 24" Samsung  | OS: Win 10 Pro

 

Audio: Behringer Q802USB Xenyx 8 Input Mixer |  U-PHORIA UMC204HD | Behringer XM8500 Dynamic Cardioid Vocal Microphone | Sound Blaster Audigy Fx PCI-E card.

 

Home Lab:  Lenovo ThinkCenter M82 ESXi 6.7 | Lenovo M93 Tiny Exchange 2019 | TP-LINK TL-SG1024D 24-Port Gigabit | Cisco ASA 5506 firewall  | Cisco Catalyst 3750 Gigabit Switch | Cisco 2960C-LL | HP MicroServer G8 NAS | Custom built SCCM Server.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Abdul201588 said:

login into phpmyadmin and go to "privileges" and check whether your account is set to "all privileges" 

I don't get a privileges option in 000webhost's phpmyadmin, I'm starting to think that 000webhost may be the problem 

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

@Abdul201588 @vorticalbox

 

Thanks for your help, I've figured out the issues but unfortunately I'm out of luck

 

Issue 1 - $dbhost must be set to mysql.000webhost.com

Issue 2 - 000webhost doesn't allow remote connections to the DB

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, TidaLWaveZ said:

@Abdul201588 @vorticalbox

 

Thanks for your help, I've figured out the issues but unfortunately I'm out of luck

 

Issue 1 - $dbhost must be set to mysql.000webhost.com

Issue 2 - 000webhost doesn't allow remote connections to the DB

If you're using them to host your website then issue 2 isn;t really an issue. If you want a database that you can connect to maybe find a mysql host?

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, vorticalbox said:

If you're using them to host your website then issue 2 isn;t really an issue. If you want a database that you can connect to maybe find a mysql host?

Really? I am using 000webhost to host the site but I am using the free hosting, not the premium.  

 

After fixing the $dbhost I get 

 

Warning: mysql_connect() [function.mysql-connect]: Host '10.1.1.25' is not allowed to connect to this MySQL server in /home/a6201318/public_html/base.php on line 9

 

I was assuming that the no remote connections meant that my membership system will not work because users will not be able to connect to log in.

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, TidaLWaveZ said:

Really? I am using 000webhost to host the site but I am using the free hosting, not the premium.  

 

After fixing the $dbhost I get 

 

Warning: mysql_connect() [function.mysql-connect]: Host '10.1.1.25' is not allowed to connect to this MySQL server in /home/a6201318/public_html/base.php on line 9

 

I was assuming that the no remote connections meant that my membership system will not work because users will not be able to connect to log in.

well your users should never had access to your database except through some sort of view or application layer. if the website is hosted on 000 then any scripts there can have access to the DB them up you to to create the pages to do what ever you want your users to do.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, vorticalbox said:

well your users should never had access to your database except through some sort of view or application layer. if the website is hosted on 000 then any scripts there can have access to the DB them up you to to create the pages to do what ever you want your users to do.

 

Ok, it's back to the grind then.  Thanks.

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, TidaLWaveZ said:

 

Ok, it's back to the grind then.  Thanks.

Log a ticket with their support and see if there's an internal IP you're meant to be connecting to. It's very likely that they've got a whitelist for connections to only allow from certain IPs. They'll block external IPs for security reasons.

 

They'll proably need to whitelist the local IP of your server to allow it to make connections.

Link to comment
Share on other sites

Link to post
Share on other sites

Different user accounts in MySQL can be given different locations that they are allowed to connect from.

 

Check your mysql users permissions, it's likely set to 'localhost' only instead of 'any' or a specific location, if that's the case and the database is held on another server than the one you're running the script on, that is the error you would expect to see. 

Are you running phpmyadmin on the same host as this script? Also, is phpmyadmin using the same username/password to log in as the one that your script is attempting to use? It's entirely possible that your phpmyadmin user account is given access to connect from another host in that case. 

EDIT: I should also note that unless absolutely necessary, your root account should NOT be allowed to connect to the mysql server from any other location other than localhost unless your database is hosted on another machine.

Edited by zushiba
Clarification.
Link to comment
Share on other sites

Link to post
Share on other sites

Thanks for the replies, I ended up just using mybb's membership/forum system instead of creating my own.  

- ASUS X99 Deluxe - i7 5820k - Nvidia GTX 1080ti SLi - 4x4GB EVGA SSC 2800mhz DDR4 - Samsung SM951 500 - 2x Samsung 850 EVO 512 -

- EK Supremacy EVO CPU Block - EK FC 1080 GPU Blocks - EK XRES 100 DDC - EK Coolstream XE 360 - EK Coolstream XE 240 -

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×