跟我学 phpmyadmin 管理MYSQL多台数据库
2012-02-28 16:14
267 查看
root@mail1 ~]# tar zxvf phpMyAdmin-3.4.10.1-all-languages.tar.gz
[root@mail1 ~]# cp phpMyAdmin-3.4.10.1-all-languages /usr/local/apache/htdocs/phpMyAdmin
[root@mail1 ~]# cd /usr/local/apache/htdocs/phpMyAdmin/
[root@mail1 phpMyAdmin]# cp config.sample.inc.php config.inc.php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
#/$cfg['Servers'][$i]['host'] = '192.168.20.204';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
################################################
$i++;
/* Authentication type */
/* Server parameters */
$cfg['Servers'][$i]['host'] = '192.168.20.204'; ------------管理多台MYSQL
[root@mail1 phpMyAdmin]# vi libraries/config.default.php
$cfg['blowfish_secret'] = 'BensonHan';
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['auth_type'] = 'cookie';
[root@mail1 phpMyAdmin]# vi libraries/auth/cookie.auth.lib.php
<!-- Login form -->
<form method="post" action="index.php" name="login_form"<?php echo $autocomplete; ?> target="_top" class="login">
<fieldset>
<legend>
<?php
echo __('Log in');
echo '<a href="./Documentation.html" target="documentation" ' .
'title="' . __('phpMyAdmin documentation') . '">';
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
echo '<img class="icon" src=\'#\'" . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('phpMyAdmin documentation') . '" />';
} else {
echo '(*)';
}
echo '</a>';
?>
</legend>
<?php if ($GLOBALS['cfg']['AllowArbitraryServer']) { ?>
<div class="item">
<label for="input_servername" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>"><?php echo __('Server:'); ?></label>
<input type="text" name="pma_servername" id="input_servername" value="<?php echo htmlspecialchars($default_server); ?>" size="24" class="textfield" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>" />
</div>
<?php } ?>
<div class="item">
<label for="input_username">Server Address:</label>
<input type="text" name="mysqlhost" id="mysqlhost" value="<?=$_COOKIE["mysqlhost"];?>" size="24" class="textfield" />
</div>
<div class="item">
<label for="input_username">MySQL Port:</label>
<input type="text" name="mysqlport" id="mysqlport" value="<?=$_COOKIE["mysqlport"];?>" size="24" class="textfield" />
</div>
在需要管理的MYSQL服务品上看一下/etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
port=3306
[align=left] 登录到所需连接的数据库服务器192.168.20.204中 %也可以是安装了phpmyadmin的服务器IP地址192.168.20.206。\[/align]
[align=left] [/align]
[align=left]mysql>grant usage on *.* to 'benson'@'192.168.20.206' identified by '22362236';[/align]
[align=left]mysql> grant all privileges on *.* to 'benson'@'192.168.20.206' identified by '22362236';[/align]
[align=left]mysql>flush privileges;[/align]
[align=left]mysql>grant usage on *.* to benson@"%" identified by '22362236';[/align]
[align=left]mysql> grant all privileges on *.* to benson'@"%" identified by '22362236';[/align]
[align=left]mysql>flush privileges;[/align]
[align=left] [/align]
[align=left] [/align]
点执行
OK 现在 可以管理 远端MYSQL 服务器了
本文出自 “IT” 博客,请务必保留此出处http://benly.blog.51cto.com/460663/791866
[root@mail1 ~]# cp phpMyAdmin-3.4.10.1-all-languages /usr/local/apache/htdocs/phpMyAdmin
[root@mail1 ~]# cd /usr/local/apache/htdocs/phpMyAdmin/
[root@mail1 phpMyAdmin]# cp config.sample.inc.php config.inc.php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
#/$cfg['Servers'][$i]['host'] = '192.168.20.204';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
################################################
$i++;
/* Authentication type */
/* Server parameters */
$cfg['Servers'][$i]['host'] = '192.168.20.204'; ------------管理多台MYSQL
[root@mail1 phpMyAdmin]# vi libraries/config.default.php
$cfg['blowfish_secret'] = 'BensonHan';
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['host'] = $_COOKIE["mysqlhost"];
$cfg['Servers'][$i]['auth_type'] = 'cookie';
[root@mail1 phpMyAdmin]# vi libraries/auth/cookie.auth.lib.php
<!-- Login form -->
<form method="post" action="index.php" name="login_form"<?php echo $autocomplete; ?> target="_top" class="login">
<fieldset>
<legend>
<?php
echo __('Log in');
echo '<a href="./Documentation.html" target="documentation" ' .
'title="' . __('phpMyAdmin documentation') . '">';
if ($GLOBALS['cfg']['ReplaceHelpImg']) {
echo '<img class="icon" src=\'#\'" . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('phpMyAdmin documentation') . '" />';
} else {
echo '(*)';
}
echo '</a>';
?>
</legend>
<?php if ($GLOBALS['cfg']['AllowArbitraryServer']) { ?>
<div class="item">
<label for="input_servername" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>"><?php echo __('Server:'); ?></label>
<input type="text" name="pma_servername" id="input_servername" value="<?php echo htmlspecialchars($default_server); ?>" size="24" class="textfield" title="<?php echo __('You can enter hostname/IP address and port separated by space.'); ?>" />
</div>
<?php } ?>
<div class="item">
<label for="input_username">Server Address:</label>
<input type="text" name="mysqlhost" id="mysqlhost" value="<?=$_COOKIE["mysqlhost"];?>" size="24" class="textfield" />
</div>
<div class="item">
<label for="input_username">MySQL Port:</label>
<input type="text" name="mysqlport" id="mysqlport" value="<?=$_COOKIE["mysqlport"];?>" size="24" class="textfield" />
</div>
在需要管理的MYSQL服务品上看一下/etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
port=3306
[align=left] 登录到所需连接的数据库服务器192.168.20.204中 %也可以是安装了phpmyadmin的服务器IP地址192.168.20.206。\[/align]
[align=left] [/align]
[align=left]mysql>grant usage on *.* to 'benson'@'192.168.20.206' identified by '22362236';[/align]
[align=left]mysql> grant all privileges on *.* to 'benson'@'192.168.20.206' identified by '22362236';[/align]
[align=left]mysql>flush privileges;[/align]
[align=left]mysql>grant usage on *.* to benson@"%" identified by '22362236';[/align]
[align=left]mysql> grant all privileges on *.* to benson'@"%" identified by '22362236';[/align]
[align=left]mysql>flush privileges;[/align]
[align=left] [/align]
[align=left] [/align]
点执行
OK 现在 可以管理 远端MYSQL 服务器了
本文出自 “IT” 博客,请务必保留此出处http://benly.blog.51cto.com/460663/791866
相关文章推荐
- 日记 [2007年01月26日]< 用 phpMyAdmin 让 MySQL 数据库管理温和化 >
- 配置phpmyadmin使登录时可填写IP管理多台MySQL 连接多个数据库 自动登录
- 在CentOS 中用 phpMyAdmin 让 MySQL 数据库管理温和化
- phpmyadmin管理数据库时的权限问题
- navicat--数据库管理软件(支持mysql,oracle,sqlserver,sqlite,postgreSQL)
- 数据库管理工具神器-DataGrip,可同时管理多个主流数据库[SQL Server,MySQL,Oracle等]连接
- MySQL创建、查询和管理数据库
- 详细说明phpmyadmin连接,管理多个mysql服务器
- 修改phpMyAdmin使其能够管理多台远程MySQL服务器
- mysql用户管理、数据库备份恢复
- 使用abator配置iBatis,管理数据库(以MySql为例)
- 基于数据库MySQL的简易学生信息管理系统
- mariadb 的查询、创建、修改、备份、删除、重置密码、授权、mysql的图形管理工具phpmyadmin
- Homestead 安装 phpMyAdmin 作为数据库管理客户端 — Laravel 实战 iBrand API 教程
- 用C#写了一个管理数据库的工具,目前是基于MySql,可轻松扩展至其他数据库。
- Navicat for MySQL 连接数据库、管理用户、创建数据库和表
- MySQL性能管理及架构设计(二):数据库结构优化、高可用架构设计、数据库索引优化
- 6.(Mysql数据管理相关)连接MYSQL,修改密码,增加新用户,数据库相关命令,表操作相关命令,数据相关命令,数据库sql导入和导出,备份数据库,查看不到mysql数据库的解决办法
- 使用MySQL设计大学学籍管理数据库(后台数据库+前台程序)
- phpmyadmin管理多个数据库服务器的配置方法