skip to Main Content

I have to work with a friend in a wordpress project, and we want to be able to work everyone from our side in localhost.
For this we are using git to have the same code, but we need to use the same database.
I created one database online :

https://xxxx.xxxxxx.com/phpmyadmin

I edit my wp-conf file to have something like this :

define( 'DB_NAME', 'db_name' );

define( 'DB_USER', 'admin' );

define( 'DB_PASSWORD', '******' );

define( 'DB_HOST', 'https://xxxx.xxxxxx.com' );

I already tried with :

define( 'DB_HOST', 'xxxx.xxxxxx.com/phpmyadmin' );

or

define( 'DB_HOST', 'http://xxxx.xxxxxx.com' );

or

define( 'DB_HOST', 'http://xxxx.xxxxxx.com/phpmyadmin' );

etc…

Thanks,

Benjamin.

2

Answers


  1. Chosen as BEST ANSWER

    To resolve this : I just make the database public.


  2. If you refer to the codex here https://codex.wordpress.org/Editing_wp-config.php for setting up your DB_HOST

    The format should be

    define( 'DB_HOST', 'the_ip_of_the_server' );
    

    or in some instances if you need to set a port.

    define( 'DB_HOST', 'mysql.example.com:3307' );
    
    If your host uses Unix sockets or pipes, adjust the DB_HOST value in the wp-config.php file accordingly.
    
    define( 'DB_HOST', '127.0.0.1:/var/run/mysqld/mysqld.sock' );
    // or define( 'DB_HOST', 'localhost:/var/run/mysqld/mysqld.sock' );
    // or define( 'DB_HOST', 'example.tld:/var/run/mysqld/mysqld.sock' );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search