MySQL 如何在 Amazon RDS 数据库上获得 phpmyadmin 访问权限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11098929/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:52:44  来源:igfitidea点击:

How to get phpmyadmin access on Amazon RDS Database

mysqlamazon-ec2amazon-web-servicesamazon

提问by Fiaz Ahmad

I am new to Amazon web services and I have no knowledge of operate this service. I recently created a mysql database using Amazon RDS and now want to access phpmyadmin to import an existing database to Amazon RDS, but after spending a lot of my time I could not got any solution to solve this problem.
Can anyone please help me to find out the solution.

我是亚马逊网络服务的新手,我不知道操作这项服务。我最近使用 Amazon RDS 创建了一个 mysql 数据库,现在想访问 phpmyadmin 以将现有数据库导入 Amazon RDS,但是在花费了大量时间之后我找不到任何解决方案来解决这个问题。
任何人都可以帮我找出解决方案。

回答by Vectoria

There is a way of configuring phpadmin on you local machine or server to connect straight to your amazon database, but this would require you to have the connection string for your amazon database. look around the settings for your amazon database server and get the IP/URL, db_name, user_name and password. After getting all these files follow these steps

有一种方法可以在您的本地计算机或服务器上配置 phpadmin 以直接连接到您的 amazon 数据库,但这需要您拥有 amazon 数据库的连接字符串。查看亚马逊数据库服务器的设置并获取 IP/URL、db_name、user_name 和密码。获取所有这些文件后,请按照以下步骤操作

  1. Goto your phpadmin folder i.e. (yours may require ftp to your server) C:\wamp\apps\phpmyadmin4.1.14
  2. locate the configuration file config.inc.php
  3. Copy it to create a backup
  4. Open it in a text editor
  5. find this block of code and copy it (the whole block)

    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
    //$cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $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'] = true;
    
  6. change the copy below to match your amazon site, host is the ip/url of the database server, user is for user-name and password...

  7. close the config file and restart/relaunch the phpadmin Drop Down
  8. on the drop down under Current Server you can find the amazon server you added
  9. this same technique works to add different database servers to your phpadmin
  1. 转到您的 phpadmin 文件夹,即(您的可能需要 ftp 到您的服务器) C:\wamp\apps\phpmyadmin4.1.14
  2. 找到配置文件config.inc.php
  3. 复制它以创建备份
  4. 在文本编辑器中打开它
  5. 找到这个代码块并复制它(整个块)

    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
    //$cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $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'] = true;
    
  6. 更改下面的副本以匹配您的亚马逊站点,主机是数据库服务器的 ip/url,用户是用户名和密码...

  7. 关闭配置文件并重新启动/重新启动 phpadmin 落下
  8. 在当前服务器下的下拉列表中,您可以找到您添加的亚马逊服务器
  9. 同样的技术可以将不同的数据库服务器添加到您的 phpadmin