I want to know how to set the DB of WordPress.

Asked 2 years ago, Updated 2 years ago, 46 views

I understand that you can set the DB in wp-config.php in WordPress. What I'm curious about is that I don't know how to write DB_HOST below.

e.g.) When you set up a host for a local DB server inside the company called [192.168.1.8] on the web server of [202.111.11], Set it as below.

//202.111.111 Set up a local DB server inside the company from the web server
define('DB_HOST', '192.168.1.8'); 

If I have to set up a DB outside of local in the above situation, How do I write if I need to set up a local DB through a web server as shown below?

define ("DB_HOST", "202.111.111/192.168.1.8"); 

Please teach me. I beg you.

wordpress database

2022-09-22 08:18

1 Answers

By default, db prevents external access and allows access only locally (127.0.0.1, localhost)

So, if you want to access DB from outside, you need to allow external access in db

That's how you do it from the outside

define('DB_HOST', '202.111.111)); // port 3306

If you do, it works.

How to allow external access is

http://zetawiki.com/wiki/MySQL_%EC%9B%90%EA%B2%A9_%EC%A0%91%EC%86%8D_%ED%97%88%EC%9A%A9

It's detailed here. Please refer to it.


2022-09-22 08:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.