Member Avatar for Member #931611

I've recently found that 1and1, my host, doesn't allow for remote access to MySQL databases and tables, and access is only possible via a slow and cumbersome web UI. Is there any workaround? I don't want to have to spend ten minutes browsing PHPMyAdmin every time I need to timestamp an article I add to my site.

Dani AI

Generated

Brief summary and practical options for the thread: shared 1&1 (IONOS) hosting generally does not allow direct remote MySQL connections from a desktop client; database access is expected to happen from scripts running on the hosted site or via the provider’s web tools. Dreamweaver can still be used to build and upload dynamic pages by configuring the remote site as the testing server (Dreamweaver uploads small helper scripts that act as a proxy for database introspection). (ionos.com)

Lowest-effort fix to avoid phpMyAdmin every time: have the database assign timestamps automatically. Use TIMESTAMP/DATETIME columns with DEFAULT CURRENT_TIMESTAMP (and ON UPDATE CURRENT_TIMESTAMP for last-modified). Example SQL (safe on modern MySQL versions):

ALTER TABLE articles
  ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

This removes manual timestamp edits at insert/update time. (dev.mysql.com)

Practical admin workflows with minimal coding: follow ’s and ’s direction by using a tiny server-side form (one PHP insert script with prepared statements) so article publishing runs through the site and the DB handles timestamps. For occasional manual edits, a single-file tool like Adminer is a faster, lightweight alternative to phpMyAdmin—upload it temporarily, protect it (IP restriction/password), then remove it when done. (adminer.org)

If desktop clients must connect directly, the realistic choices are provider features or a server upgrade: request a VPS/dedicated plan that permits external DB access, or use an SSH tunnel / port forward when the host allows it. Never open MySQL port 3306 publicly; prefer SSH tunnels, IP whitelisting, strong credentials, HTTPS, and removal of temporary admin scripts. (ionos.com)

Recommended Answers

All 8 Replies

It sounds like you've answered your own question regarding remote connections. You could write a php script that does what you need and put it up on the server.

Member Avatar for Member #931611

You can do that with PHP?

Yes, PHP can connect to your 1and1 database as long as the PHP file is hosted on your web server. phpMyAdmin is written in php for example. How is the database being used? When you add the timestamps to the database, is there some PHP or CGI accessing that information?

So you would build some admin pages so that you can manage the data within your db (add new articles, modify info such as timestamps, etc...). This would be a lot easier and better so that you do not have to log into their DB console every time you want to make a change.

Some providers such as GoDaddy do provide you with a choice whether the DB is or is not accessible from the internet on port 1433. I would not recommend exposing the DB to the internet just for convinience.

Member Avatar for Member #931611

Strictly speaking, I'm new to PHP, and I've yet to add the timestamps. I'm still trying to figure out how exacly I'm going to go about doing so.
And that custom admin page — that sounds like a lot of coding.

Member Avatar for Member #120589

I don't want to have to spend ten minutes browsing PHPMyAdmin every time I need to timestamp an article I add to my site.

Why do you need to manually add anything?

Member Avatar for Member #931611

If my understanding of PHP is right (and at this point that's a big "if"), either Dreamweaver has to communicate with the DB every time I upload a file, or I have to go onto the MyAdmin page every time.
I suppose if that's wrong, do I just call the database with each uploaded document, and the server automatically handles everything?

Ok, so lets take a step back...what I assume based on reading your first post again is that when you write an article or take some other action, you are logging into your PHPMyAdmin so you can make changes to some record in a database?

If that is the case, what we are recommending is that you develop a web page that is already configured to read from and write to your database so that when you need to update a record, you do so from your "admin" page. That way you do not have to logon on some console provided by your provider to make changes to your data

If this is what we are talking about, you are correct, there is quite a bit of coding you will need to do to build "admin" pages. I think what action you decide to take will be dependant on the long term and balance the time it takes to build yourself an admin portal vs loging into this MySQL console every time you need to update the DB.

keep in mind that Dreamweaver is just a development app on your computer. its not going to have direct access to a DB at the providers site. This is why i mentinoed that some hosting providers do expose DBs to the internet, for developers who want to be able to connect to them directly with the software, such as Dreamweaver, that is loaded on your computer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.