dpdbu24262 2014-06-12 19:13
浏览 127
已采纳

无法在Openshift上连接到MySQL服务器

Recently, I've started using openshift & also deployed an application using PHP & MySQL. Yesterday, out of curiosity, I've removed the password for phpMyAdmin and guess what, now I'm unable to log in to both phpMyAdmin & mysql database.

I've tried both the passwords (the default one & the empty password) and uninstalled & re-installed the PHPmyAdmin catridge & also, force restarted the app several times but nothing worked. Now, I've no idea what happened. Any help is appreciated.

  • 写回答

1条回答 默认 最新

  • dongmi1864 2014-06-13 16:46
    关注

    Hopefully this will help.

    I assume what you did was go into phpmyadmin and click on 'users' then 'edit privileges' for one of the users, select 'no password' and hit save right? If so, then I think the following steps should help.

    1.) ssh into your gear (you can use the rhc ssh command)
    2.) run the mysql command
    3.) You should get an error like this ERROR 1045 (28000): Access denied for user 'adminslULJTS'@'127.10.126.130' (using password: YES)
    4.) Now, type in the command mysql -u $OPENSHIFT_MYSQL_DB_USERNAME -h $OPENSHIFT_MYSQL_DB_HOST -P $OPENSHIFT_MYSQL_DB_PORT -p
    5.) When it asks for a password, just hit enter
    6.) You should now be logged into the mysql shell

    Now you need to reset your password to what openshift thinks it is.

    1.) create another ssh session into your gear in another terminal, leaving the old one open
    2.) run the command env | grep MYSQL
    3.) this will give you the following information that you will need to reset your password:

    OPENSHIFT_MYSQL_DB_HOST=127.10.126.130  
    OPENSHIFT_MYSQL_DB_PASSWORD=Il8-rVLIKSrx  
    OPENSHIFT_MYSQL_DB_USERNAME=adminslULJTS
    

    Given the above information, go back to your ssh session that had the mysql connection open, and enter the following command:

    set password for 'adminslULJTS'@'127.10.126.130' = PASSWORD('Il8-rVLIKSrx');
    

    But you will need to replace the username, host, and password with the ones you got from the above step.

    You should now be able to log into phpmyadmin with your old username & password that you can either view using the env | grep MSYQL command, or view in the web console for your application at openshift.com

    It also might be worth reviewing this KB article: https://www.openshift.com/kb/kb-e1085-possible-complications-when-changing-your-database-credentials

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗