I am installing a new instance of Magento. I need all of the web files on one server and the mysql database to be on another server. Is there any documentation on how this install would work? All the install guides I have found assume the database is on the same server.

2 Answers 2


You may have an issue in the configuration at database link up at file server.

It is so simple, just go to app/etc/local.xml.

Add here your database credentials.

                <initStatements><![CDATA[SET NAMES utf8]]></initStatements>


your_database_server_url is your database host. You may have put localhost in `local.xml but this is wrong it should be database server IP/Domain Name. Also note that your database server must be given remote version access for your file server.

  1. Edit your local.xml (Magento 1), or env.php (Magento 2) located in app/etc to define: database hostname, database name, user database name.

  2. Create database, user, and give the access using mysql command:

    create database databasename; create user username;
    grant all privileges on databasename.* to username@'%' identified by 'password123';

Note: Please change the #databasename, #username, and #password123

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.