phpmaadmin鏈接遠程mysql
鏈接遠程mysql步驟
.保證已經有�phpmyadmin,若是沒有,去http://www.phpmyadmin.net/home_page/downloads.php下載,安裝;文章這裏用集成開發環境wamp自帶的phpmyadmin示範。 進入到phpmyadmin安裝目錄下,這裏是:C:\wamp\apps\phpmyadmin4.1.14,
.建立文件夾config;拷貝.config.inc.php到,\config\config.inc.php
瀏覽器中執行http://localhost/phpmyadmin/setup,根據本身主題填寫host,user,password
.設置保存後,拷貝.\config\config.inc.php到.\config.inc.php(原來文件最好能備份一下)
文件config.inc.php
<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 4.1.14 setup script
* Date: Wed, 24 Sep 2014 08:15:24 +0200
*/
/* Servers configuration */
$i = 0;
/* Server: 85 [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '85';
$cfg['Servers'][$i]['host'] = '172.163.25.85';/*遠程數據庫主機*/
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['auth_type'] = 'config';/*認證方式,以配置文件方式認證*/
$cfg['Servers'][$i]['user'] = 'user2';/*數據庫帳戶*/
$cfg['Servers'][$i]['password'] = '';/*密碼爲空*/、
$cfg['Servers'][$i]['AllowNoPassword'] = true;/*帳戶密碼爲空時,添加此句*/
/* End of servers configuration */
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
$cfg['Servers'][$i]['AllowNoPassword']解釋
$cfg['Servers'][$i]['AllowNoPassword']php
Type: booleanmysql
Default value: falsesql
Whether to allow logins without a password.The default value of false for this parameter prevents unintended access to aMySQL server with was left with an empty password for root or on which ananonymous (blank) user is defined.數據庫