Jump to content

Connecting to Web Database using phpMyAdmin


chosendesigns

Recommended Posts

I recently completed a simple project using PHP and a MySQL database for login/registration. I was doing it all as a test on my computer using phpMyAdmin to create the database and table i needed.

 

The problem im having now is using phpMyAdmin with an online database.. wen i say online i mean a database held on a webhost. Im using heartinternet and ive managed to get an SQL database setup which I can connect to fine using my php scripts.

 

My only question comes with using phpMyAdmin to administer the database and add tables etc. Im wondering how I can setup phpMyAdmin to connect to the newly formed database on the web server rather than loading up the databases in my www localhost folder on my computer so I can easily edit without having to send SQL Querys through PHP to create tables etc.

Either setup phpmyadmin on the server and use it from there or change the hostname setting in phpmyadmin to connect to the remote database.

 

Most databases hosted by webhosts will not allow a remote connection by default, so you'll also need to make sure you have permissions to connect remotely. eg:

 

GRANT ALL PRIVILEGES ON database_name TO 'your_username'@'your_ip_address' IDENTIFIED BY 'your_pass' WITH GRANT OPTION;

If I setup phpmyadmin on the server wont that mean that all the pass and user info will automatically be saved in the config.ini file and therefore whenever anyone went to www.mydomain.com/phpmyadmin they would automatically have full access to my databases or am i setting it up/accessing it on the server in the wrong way?

 

I dont think I can connect remotely with heartinternet but if I do where shall I enter the code below? Should I write a php script that connects to my database and send that SQL Query to it once?

I dont know currently. My friend has one of those re-seller accounts with heartinternet and im hosting my site with him for free. Im waiting for a reply back on what database editing tools he was given but in the mean-time trying to work out if I can do it for myself.

 

Ive configured phpMyAdmin now so that I can access it and edit it through my registration forms HOWEVER it is completely un-secure... at the moment anyone can access it through www.mydomain.com/phpMyAdmin and delete, add, edit, steal all the information if they wanted.

 

Is there anyway of securing the webpage with a login/password so only I or people ive given the password to can access it?

BUMP... I need this solved before someone accesses my databases.. otherwise ill have to take phpMyAdmin off the server but I would really like to use it as its what ive learnt.

 

Im sure it must be possible to secure it somehow with a login system??

cd /web/root/path

mv -f  phpMyAdmin myphpadmin61273

 

Do something like that if you can SSH into the system.  If not, just do it over FTP.  Rename the PHP My Admin directory so it's harder to find, and read the documentation about the login system...I know there is one but I forgot how to enable it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.