XAMPP server/database access across local LAN

kartracer

Suspended / Banned
Messages
1,178
Edit My Images
No
I have a Wordpress site under development running on XAMPP which uses MariaDB. I'd like to be able to access the database from any device on the LAN (actually WiFi).

Changing the localhost setting to specify an IP gets me to the server, but not the database (Error establishing a database connection).

How can I enable the database to accept a connection from the specific IP address (which is specified for the local host machine and as part of the URL from a remote machine)?

When I go into localhost/phpmyadmin I cannot figure out how to do this (I cannot edit the localhost account). Do I need to create a new user xxx.xxx.xxx.xxx and if so how would I set it up with the right credentials?
 
Is the purpose of your XAMPP to play around with the database config or is it to learn WordPress? If it is purely for learning WordPress save yourself the hard work and use Instant WordPress instead.
 
Is the purpose of your XAMPP to play around with the database config or is it to learn WordPress? If it is purely for learning WordPress save yourself the hard work and use Instant WordPress instead.

The purpose is not to learn Wordpress but to share the Wordpress installation (already existing) so that multiple devices can access it (for editing purposes, etc.).
 
For some sins I can't recall, I work with mysql more often than I would like. Mariadb seems VERY similar though (on occasion I find it's documentation better for things I need to do with mysql, in fact). So something like

GRANT ALL ON 'database' TO 'user'@'host | IP address' IDENTIFIED BY 'password';

should do it. Fill in your own database name, username , host name or IP address and a password (if you want one).

edit for an example

GRANT ALL ON 'mydatabase' to 'kartracer'@'192.168.1.2' INDENTIFIED BY 'LetMeIn';

mysql tends to do a DNS lookup on the IP addresses of incoming connections and then match hostname so on internet servers that have reverse DNS set up I can't specify IP addresses, I have to give the hostname in the PTR record. That's unlikely to be a problem on a LAN though.
 
Last edited:
For some sins I can't recall, I work with mysql more often than I would like. Mariadb seems VERY similar though (on occasion I find it's documentation better for things I need to do with mysql, in fact). So something like

GRANT ALL ON 'database' TO 'user'@'host | IP address' IDENTIFIED BY 'password';

should do it. Fill in your own database name, username , host name or IP address and a password (if you want one).

edit for an example

GRANT ALL ON 'mydatabase' to 'kartracer'@'192.168.1.2' INDENTIFIED BY 'LetMeIn';

mysql tends to do a DNS lookup on the IP addresses of incoming connections and then match hostname so on internet servers that have reverse DNS set up I can't specify IP addresses, I have to give the hostname in the PTR record. That's unlikely to be a problem on a LAN though.

Thanks, I'll give this a try. Just had to revert to localhost in the config files to get back into phpmyadmin on the host machine.

I did read somewhere that MariaDB didn't support remote access so we'll see.
 
OK, I think I've solved the problem here, at least in achieving what I wanted.

The Mariadb is my WordPress db so I went into Wordpress (General Settings) and edited the WordPress Address (URL) and Site Address (URL), changing localhost to the host IP.

Now I can access the WordPress site from my iPad, phone, etc.
 
Back
Top