-1

I installed phpmyadmin following: How To Install and Secure phpMyAdmin with Nginx on an Ubuntu 14.04 Server

I ran:

sudo apt-get install phpmyadmin

I selected No for dbconfig-common since I already have database installed.

sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html
sudo php5enmod mcrypt
sudo service php5-fpm restart

When I goto http://159.203.85.69/phpmyadmin or http://159.203.85.69/phpmyadmin:8000 I got page not found error.

I website is using PHP and Laravel 5.1.

How can I remotely use phpmyadmin? Thanks.

Daolin
  • 614
  • 1
  • 16
  • 41

1 Answers1

0

You can from your own computer access a database that is located on another server.

  1. Install MAMP (if you use a Mac) or WAMP (if you are a Windows User)

  2. Then : For MAC : go to Applications/MAMP/bin/phpmyadmin and open config.inc.php For Windows go to C:\wamp\apps\phpmyadmin and open config.inc.php

Modify those lines to match with the Host, username and password of your database

$cfg['Servers'][$i]['host'] ="your_server"; // hostname
$cfg['Servers'][$i]['port'] = '3306'; // Usually always 3306
$cfg['Servers'][$i]['user']  = 'your_username';     
$cfg['Servers'][$i]['password'] = 'your_password';

Then restart WAMP (or MAMP) and go to localhost/phpmyadmin page on your browser you will connect directly to the database that is hosted on your server.

Make sure also to allow connection to your database from anywhere. To do so look at this post :Allow all remote connections, MySQL

I hope it will help you !

Community
  • 1
  • 1
  • I can see the login page now, but it says cannot log in to the MySQL server. I have ran GRANT ALL ON *.* to user@localhost IDENTIFIED BY 'password'; GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password'; I replaced password with MySQL password. – Daolin Mar 14 '16 at 20:41
  • On your local computer ? – maximilienAndile Mar 14 '16 at 20:47
  • I SSH to my Digital ocean server and log in using "MySQL -u root -p" – Daolin Mar 14 '16 at 20:49
  • You can try also this to access database from all IP : Connect with SSH on your server. Then execute : sudo nano /etc/mysql/my.cnf You will open with the editor nano the config file of your database. On this file go to the [mysqld] section and for the line bind-adress, set it to "bind-address = 0.0.0.0 " . I hope it will help – maximilienAndile Mar 14 '16 at 20:57
  • Did not find the line so I added a new line. Still cannot log in. – Daolin Mar 14 '16 at 21:04
  • Try restart your mysql database with this instruction "/etc/init.d/mysqld restart". Execute also "FLUSH PRIVILEGES;" on you mysql Console to validate the grant change – maximilienAndile Mar 14 '16 at 21:09
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/106288/discussion-between-daolincheng-and-maximilienandile). – Daolin Mar 14 '16 at 21:12
  • execute this via ssh : sudo ufw allow 3306/tcp It will open the 3306 port – Daolin Mar 14 '16 at 21:36