mysql - configuration file

000

Well-Known Member
Jun 3, 2008
390
16
68
in what file save cPanel details about IP allowed to connect from host REMOTE to X database ?
 

000

Well-Known Member
Jun 3, 2008
390
16
68
in what file save cPanel details about IP allowed to connect from host REMOTE to X database ?
that config NOT is saved into A FILE,
is created INTO MYSQL when USING cPanel you run
Code:
CREATE USER 'x'@'remote_server_ip' IDENTIFIED WITH mysql_native_password BY 'password';
usually YOU NOT RUN that QUERY, samplely cPanel doit by you.

You can see ALL USERS (included remote hosts) running as ROOT:
Code:
SELECT Host, User, Db FROM mysql.db WHERE Db LIKE '%DTABASE%' ORDER BY User ASC;
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,171
785
313
cPanel Access Level
Root Administrator
Hey there! You are correct that the remote MySQL credentials are not saved to a specific file, but are included directly in the database. For example, if you have given access to the remote host with IP 1.2.3.4 to the user "testuser" you would see the following in the mysql.user database for all databases that user owns. Here's an example showing this with a Wordpress database:

Code:
#mysql -e 'select * from mysql.user' | grep 1.2.3.4

1.2.3.4    testuser_wp    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    N    mysql_native_password    *FC269A215016C698ACA9BAA49DF3FCD25B31F0F9    N    2021-05-18 12:51:47    NULL    N