search
HomeCMS TutorialPHPCMSphpcms cannot connect to remote database

phpcms cannot connect to remote database

Feb 18, 2020 pm 12:23 PM
phpcmsdatabaseconnect

phpcms cannot connect to remote database

phpcms cannot connect to the remote database

Cause: The database password is a special character.

When installing phpcms, it appears that the database server cannot be connected. Please check the configuration, but the database information is completely correct.

I searched a lot on the Internet but could not solve the problem. Later I found out that it was the database password. There are two ways to solve this problem if there are special characters "such as: !@#".

Related recommendations: phpcms tutorial

The first is to change the database password , but this is not particularly good, right?

Second method: modify two places in total

1 Modify install/step5.tpl.php line 127

:

var url = '?step=dbtest&dbhost='+$('#dbhost').val()+'&dbuser='+$('#dbuser').val()+'&dbpw='+$('#dbpw').val()+'&dbname='+$('#dbname').val()+'&tablepre='+$('#tablepre').val()+'&sid='+Math.random()*5;

is replaced with:

var url = '?step=dbtest&dbhost='+$('#dbhost').val()+'&dbuser='+$('#dbuser').val()+'&dbpw='+'&dbpw='+escape($('#dbpw').val())+'&dbname='+$('#dbname').val()+'&tablepre='+$('#tablepre').val()+'&sid='+Math.random()*5;

2. Modify install/step6.tpl.php line 55

and replace:

var dbpw = &#39;<?php echo $dbpw?>&#39;;

with:

var dbpw = &#39;var dbpw = escape(&#39;<?=$dbpw?>&#39;);&#39;;

For more information about PHPcmsWebsite Construction Introductory Tutorial, please pay attention to the PHP Chinese website! ! !       

The above is the detailed content of phpcms cannot connect to remote database. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.