Connect to database in wampserver from another pc in LAN - php

I have setup svn server. The project files can be shared. But i would like to keep all the database in server pc and share those database with other pc in LAN. I have gone through various forums and still didnt get my solution.
Phpmyadmin can be accessed using ip address. But when try to connect to the database from server pc it says Host "user-pc" is not allowed to connect to this Mysql server.
I would really appreciate if any one could help me out.

Related

How to connect a web app in a pc with a database on another pc using php mysql XAMPP

I have a web app in php mysql programmed with xampp server.
I need to have the web server with the app files in one pc on xammp and connect it to a mysql database on another pc using xampp also I imagine on phpmyadmin as usual.
I don't know how to redirect the database, as in one pc you just put the dB name in the queries but I don't know how to do it if the database is on another pc.
I couldn't find any info online, I already can access my xampp server through ip address on another devices but with the web server and the dB server on the same pc.
I need to have the web app files in one pc and the database in another, using xampp in both pc. So I can connect other devices as clients and use the web app normally.
Please help:( it is for a project :(
Edit:
I am beginner, so I really would like a detailed explanation with examples please so I can replicate it.

How do I connect my website on a external server to my database run off of Xaamp on my local host machine?

I have been building a website for a project using XAMPP. It has a database for users to register which stores their details. I was going to test my website with my friends by physically giving them my laptop however due to coronavirus I can no longer do so. As a result, I have had to upload my website to my university server for people to access the URL, however how can I reconnect this with my database that is on my XAMPP?
The code that I'm not sure how to alter is here and this is in a php file on my uni server (this may not even be the correct code to alter):
$db = #mysqli_connect('localhost','root','','databasetable') or die ("Could not connect to server");
OR
Is there a way for people to access my XAMPP files on my machine remotely for my friends to test the website and be able to make a log in etc.
Thanks in advance :D
You can expose your localhost databases by using tools such as http://ngrok.io/.
The command ngrok tcp 3306 will create a secure tunnel that can be used in your code.

Cant connect my website to a database on a VPS

Well i got a free host to run my website, i uploaded all the files:
The point is: my website requires to read/write accounts from a database, located on my VPS (Windows Server).
My website connects through:
Where abboud_auth and abboud_world are my databases, IP is my VPS' IP and user and password are my user and password of my navicat, which is also running on my VPS.
So, now on my VPS, i have my databases:
So, the problem is that when i run my website i cant connect to my databases.
I'm using Xampp, and its mysql config is:
In fact, i tested the remote access with this web, and i cant connect:
The obvious question: what should i do?
Thanks ^^

Anybody's helps me how to connect my hosting MySQL database on my local computer

I want my hosting server MySQL database connect on my local pc because i can input data from my local pc please help me how how to connect this
Install something like XAMPP which include Apache,MySQL,PHP. Then start Apache and MySQL servers and you can get connection to your MySQL using
localhost/phpmyadmin
put that into ulr on your browser(Chrome, Firefox,etc..)

php can't connect to remote database from xampp on windows (remote access enabled on my ip)

I have got a problem with my xampp on windows 7. Everythings work fine except when I try to connect to a remote database from my localhost. I've already enabled the remote access on the mysql server for my ip address and I've tried to turn off the windows firewall.
It seems like something prevents the outgoing connections from my localhost to remote host.
Someone can help me?
Thank you
CA
Check permissions on your MySQL server, it could be the user you are logging in as (against the DB) has localhost as it's hostname try setting the host name to % for the MySql login
What ip did you insert?
Time ago I had problems to connect to my localhost from an external pc/tablet that was in my local net. Finally the problem was solved when I used as ip to connect from a different pc where xammp was installed this: "http://192.168.1.128:80" Maybe is this

Categories