{"id":484,"date":"2017-07-04T15:56:58","date_gmt":"2017-07-04T12:56:58","guid":{"rendered":"http:\/\/presta.site\/blog\/?p=484"},"modified":"2022-01-19T15:26:24","modified_gmt":"2022-01-19T12:26:24","slug":"how-to-change-database-connection-settings-in-prestashop","status":"publish","type":"post","link":"https:\/\/presta.site\/blog\/en\/how-to-change-database-connection-settings-in-prestashop\/","title":{"rendered":"How to change database connection settings in PrestaShop"},"content":{"rendered":"<p>Most frequently you may need to change database settings after moving to new hosting.<br \/>\nHere is how you can do that:<\/p>\n<p><!--more--><br \/>\n<strong>Be careful with these settings. Incorrect config will break your site.<\/strong><\/p>\n<h2>PrestaShop 1.7<\/h2>\n<ol>\n<li>Using your FTP client or file manager navigate to your <b>PrestaShop root<\/b> and open this file: <strong>\/app\/config\/parameters.php<\/strong><\/li>\n<li>Find the lines with <strong>database_host<\/strong>, <strong>database_name<\/strong>, <strong>database_user<\/strong> and <strong>database_password<\/strong> parameters.\n<\/li>\n<li>Replace existing values of those params by the new ones.<\/li>\n<li>Save the file and upload it back to the server.<\/li>\n<p>All done! Open your site in the browser and check whether it works.\n<\/ol>\n<p><b>IMPORTANT:<\/b> sometimes you might need to manually clear the site cache to apply the settings. Delete all <b>content<\/b> of folder &#171;\/var\/cache\/&#187; under the site root. You can do it by using your hosting file manager or by FTP. &#171;\/var\/cache\/&#187; contains folders &#171;dev&#187;, &#171;prod&#187; and similar. <b>Be careful not to delete something else.<\/b><\/p>\n<p>Here is an example config:<\/p>\n<div class=\"codecolorer-container php blackboard\" style=\"overflow:auto;white-space:nowrap;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/><\/div><\/td><td><div class=\"php codecolorer\"><span class=\"kw2\">&lt;?php<\/span> <span class=\"kw1\">return<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a> <span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; <span class=\"st_h\">'parameters'<\/span> <span class=\"sy0\">=&gt;<\/span> <br \/>\n&nbsp; <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a> <span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_host'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'127.0.0.1'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_port'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">''<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_name'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'your_database_name'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_user'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'your_database_user'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_password'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'your_database_password'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_prefix'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'ps_'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'database_engine'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'InnoDB'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'mailer_transport'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'smtp'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'mailer_host'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'127.0.0.1'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'mailer_user'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw4\">NULL<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'mailer_password'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw4\">NULL<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'secret'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'Vz6rVXVYNWYt7E6Fvfvdfvg34MCdc97h3IttReewVIxNOu7wHAoS'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'ps_caching'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'CacheMemcache'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'ps_cache_enable'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw4\">false<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'ps_creation_date'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'2017-05-22'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'locale'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'en-US'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'cookie_key'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'xduROM3yvjDSym43CvfdvFDVD47YG8zCrVruNFjjZ3NUb7Ut9'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'cookie_iv'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'7kBvdfvgh'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"st_h\">'new_cookie_key'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'def00000766ffa61aae49b279evfsdvsdfvsfdvfdvwerr324r3frdfveb1afedc8702a964f0a1f6828bf1623ca54efad10ed4bbfb289beec62b01a3062d4c3ce78254157'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<h2>PrestaShop 1.5 &#8212; 1.6<\/h2>\n<ol>\n<li>Using your FTP client or file manager open this file: <strong>\/config\/settings.inc.php<\/strong><\/li>\n<li>Find the lines with <strong>_DB_SERVER_<\/strong>, <strong>_DB_NAME_<\/strong>, <strong>_DB_USER_<\/strong> and <strong>_DB_PASSWD_<\/strong> parameters.\n<\/li>\n<li>Replace existing values of that params with the new ones.<\/li>\n<li>Save the file and upload it back to the server.<\/li>\n<p>All done! Open your site in the browser and check whether it works.\n<\/ol>\n<p>Here is an example config:<\/p>\n<div class=\"codecolorer-container php blackboard\" style=\"overflow:auto;white-space:nowrap;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/><\/div><\/td><td><div class=\"php codecolorer\"><span class=\"kw2\">&lt;?php<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_DB_SERVER_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'localhost'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_DB_NAME_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'your_database_name'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_DB_USER_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'your_database_user'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_DB_PASSWD_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'your_database_password'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_DB_PREFIX_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'ps_'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_MYSQL_ENGINE_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'InnoDB'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_PS_CACHING_SYSTEM_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'CacheApc'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_PS_CACHE_ENABLED_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'0'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_COOKIE_KEY_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'VydXpBBvqfdVyGyVY44qVfFTvL23AG1szj0Avsd271PtuNw5CbORvvOIs'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_COOKIE_IV_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'PIx53ASw'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_PS_CREATION_DATE_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'2017-05-07'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_PS_VERSION_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'1.6.1.14'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_RIJNDAEL_KEY_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'4H8PRpv43fsdDSuZXUx9iLiiwRb2af5'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_RIJNDAEL_IV_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'8Xav8t+xvdft54D+k\/KI1g=='<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<a href=\"http:\/\/www.php.net\/define\"><span class=\"kw3\">define<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'_PS_DIRECTORY_'<\/span><span class=\"sy0\">,<\/span> <span class=\"st_h\">'\/..\/..\/'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Most frequently you may need to change database settings after moving to new hosting. Here is how you can do that:<\/p>\n","protected":false},"author":1,"featured_media":496,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/posts\/484"}],"collection":[{"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":22,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":621,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions\/621"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/media\/496"}],"wp:attachment":[{"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/presta.site\/blog\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}