You are viewing our Forum Archives. To view or take place in current topics click here.
Creating phpmyadmin server | Help me
Posted:

Creating phpmyadmin server | Help mePosted:

CriticaI
  • Supporter
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
background info:

I have a domain provider that has phpmyadmin setup and ready to use for noobs like me. But they limit the storage to 1gb. Since I am working on a social media project, I will need more than that. This is when I decided to buy a server from my provider. I bought a CentOS 6 server. I can easily switch os if need to though.


Problem:

I have setup my server multiple times. I made a Lamp server then installed phpmyadmin on it. I got everything working. I can sign in on my computer and create databases tables etc.

But when I run my php connection file through my website, I keep getting the error that says:
'root@localhost'@'infong1583.lxa.perfora.net'



My php code:


<?php
    $host_name  = "107.180.**.***";
    $database   = "db0003";
    $user_name  = "root";
    $passworddb   = "my password";

    $connect = mysqli_connect($host_name, $user_name, $passworddb, $database);
?>


I know the password is the right password because I have tested the commands through the console and it works.


If some would could tell me how I can fix this that would be great! I've been stuck on this for about 48 hours and I'm not finding any solutions.

BTW if I didn't mention before my domain is on a separate server.

Edit: I created a user and granted it all permissions, it is accessible from any host.
This works but it is not secure. When I try to change the host to the ip of my domain, it does not work.


Last edited by CriticaI ; edited 4 times in total
#2. Posted:
LAXDUDE182
  • Challenger
Status: Offline
Joined: Jun 25, 201112Year Member
Posts: 163
Reputation Power: 6
Status: Offline
Joined: Jun 25, 201112Year Member
Posts: 163
Reputation Power: 6
Have you tried to whitelist the ip your php connects from?
#3. Posted:
CriticaI
  • Blind Luck
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
With zero luck yesterday, I started over and made a new server.
but I still get an error.
I updated he code. It keeps denying access to the root user, even though I have the right credentials.
#4. Posted:
CriticaI
  • Summer 2018
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
BeezyModz wrote contact them

They won't be able to help me.
It is not a server problem.
It is either my php code,
Or some kind of ip permission problem.
#5. Posted:
XBLBeezy
  • Christmas!
Status: Offline
Joined: Mar 20, 20167Year Member
Posts: 301
Reputation Power: 25
Status: Offline
Joined: Mar 20, 20167Year Member
Posts: 301
Reputation Power: 25
ohok
#6. Posted:
iiGrimeDailyy
  • V5 Launch
Status: Offline
Joined: Sep 27, 201112Year Member
Posts: 220
Reputation Power: 8
Status: Offline
Joined: Sep 27, 201112Year Member
Posts: 220
Reputation Power: 8
CriticaI wrote
BeezyModz wrote contact them

They won't be able to help me.
It is not a server problem.
It is either my php code,
Or some kind of ip permission problem.


Have you create a user to use phpMyAdmin because I know some services require you to have a user...
#7. Posted:
speed
  • Winter 2019
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
$user_name = "root";
#8. Posted:
CriticaI
  • Christmas!
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
Status: Offline
Joined: Nov 05, 201310Year Member
Posts: 2,737
Reputation Power: 448
speed wrote
$user_name = "root";


That worked, but it is allowed to be accessed from any host
How do I make it more secure?
#9. Posted:
speed
  • Retired Staff
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
Status: Offline
Joined: Jun 11, 200914Year Member
Posts: 9,897
Reputation Power: 3160
Motto: "I'l no I grew up to fast speed I no u will be little famous" - Famous_Energy
CriticaI wrote
speed wrote
$user_name = "root";


That worked, but it is allowed to be accessed from any host
How do I make it more secure?


Host access is managed in MySQL itself, not the connector.

If you can connect from any host, that means the user is probably configured to allow wildcard access (user@%), so you should update the user to only allow connections from the host you want ([email protected])
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.