我在centOS 7中安装了LAMP
当我将文件放在默认目录中时(在我的情况下为var / www / html) 当我访问我的页面时收到以下内容:
" Erreur:PB de connexion au serveur mysql de la langue:fr Erreur:PB de connexion�la basededonn�esdela langue:fr Erreur SQL:SELECT * FROM parametres 用户访问被拒绝' apache' @' localhost' (使用密码:否)"
以下是我的配置文件:
$action = "action";
@error_reporting (E_ALL);
@setlocale(LC_TIME, 'french');
$host = "localhost";
$user = "";
$password = "" ;
//---> La langue utilisée (fr, en, ar)
global $lang ;
$lang = isset($_REQUEST["lang"])? $_REQUEST["lang"] : "";
switch($lang)
{
case "ar" : $lang = "ar" ; break;
case "en" : $lang = "en" ; break;
case "fr" : $lang = "fr" ; break;
default : $lang = "fr" ; //---> La langue par défaut
} //Fin switch
global $lang_param;
$lang_param = array
(
//---> principal = TRUE
"fr" => array(
"host" => "localhost" ,
"db" => "database_fr" ,
"user" => "user1" ,
"password" => "" ,
"chemin" => "fr" ,
"description" => "Langue française" ,
"short" => "Français" ,
),
//---> principal = FALSE
"en" => array(
"host" => "localhost" ,
"db" => "database_en" ,
"user" => "user1" ,
"password" => "" ,
"chemin" => "en" ,
"description" => "Langue anglaise" ,
"short" => "Anglais" ,
) ,
"ar" => array(
"host" => "localhost" ,
"db" => "database_ar" ,
"user" => "user1" ,
"password" => "" ,
"chemin" => "ar" ,
"description" => "Langue arabe" ,
"short" => "Arabe" ,
)
); //Fin $lang_param
//---> Se connecter
$r = @mysql_pconnect($lang_param[$lang]["host"], $lang_param[$lang] ["user"], $lang_param[$lang]["password"]);
if ($r==0)
{
echo "Erreur : PB de connexion au serveur mysql de la langue : $lang<br>";
} //Fsi
$r = @mysql_select_db($lang_param[$lang]["db"]);
if ($r==0) {
echo "Erreur : PB de connexion à la base de données de la langue : $lang<br>";
} //Fsi
如何获取apache @ localhost的访问权限?
答案 0 :(得分:1)
$user
变量中应该定义一个帐户。
尝试root帐户
$user='root';
请注意,没有密码的root帐户会使您的网络服务器不安全,并且可以尽快进行设置
答案 1 :(得分:1)
您应该创建一个用户:
const target = event.target;
let children1 = target.parentElement;
let input = $(children1).find('.filled-in');
var list = $(children1).parents('li'); //<li> element
var parentList = list.parents('ul'); //<ul> element
var parentDiv = list.parents('div'); //parent div
var findTop = parentDiv.children("ul.top-list"); //find sibling
var findBot = parentDiv.children("ul.bot-list"); //find sibling
if (input[0].checked === false) {
$(list[0]).slideUp(300, function() {
instance.data.changed(instance.data.instruction._id.toString(), 0, true);
$(list[0]).appendTo($(findTop[0]));
$(list[0]).slideDown(300);
});
} else {
$(list[0]).slideUp(300, function() {
instance.data.changed(instance.data.instruction._id.toString(), 0, true);
$(list[0]).appendTo($(findBot[0]));
$(list[0]).slideDown(300);
});
}
并为您尝试连接的数据库授予权限:
DOMNodeInserted
之后,您必须在代码中填写变量 $ user 和 $ password 。