browser tries to download php

Browser tries to download php pages screenshot

Question:

Sometimes my browser tries to download or save php files from my website. What causes this? How can it fix it?

Answer:

This can happen for a variety of reasons. However we frequently see it when a page is timing out. If you are connecting to a remote database make sure that the database is up and that dns is resolving correctly for it.

Delete mysql user example and tutorial

Note: deleting mysql users will not work on most types of shared accounts. You will likely need to enter a support request unless you have a VPS.

Here’s how to delete a user mysql from.

In the example the test user is called “jdoe”

This step is not necessary but you can use it to verify you are removing the intended username :


mysql> show grants for jdoe;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for jdoe@% |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'jdoe'@'%' IDENTIFIED BY PASSWORD '*4CB51346C69F4302F0371CB61DE7076D14837C48' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `jdoedb`.* TO 'jdoe'@'%' |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Next, perform the actual removal of the user:

mysql> drop user jdoe;
Query OK, 0 rows affected (0.08 sec)

Next run flush privileges – this is likely not needed. However lacking time to look up the correct answer I’m going to call it anyway. When in doubt, remember that flushing privileges never hurts anything. It simply reloads all the privileges currently assigned (thus “unloading” any that are deleted and should be removed).

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

If you want to verify the user was deleted, run the show grants command again:

mysql> show grants for jdoe;
ERROR 1141 (42000): There is no such grant defined for user 'jdoe' on host '%'

It should come back empty now.

I have forgot my database password. How can I change it?

Question:

I’ve forgot my database password. What are my options?

Answer:

If you have forgot your database password and do not have any scripts that depend on it, you can change your password via the database section of your control panel. Just click on the link that says “Change Database Password”. Do not log-in to phpmyadmin to change your password.

However things become much more complicated if you have scripts (wordpress, joomla, drupal, etc.) that rely on the password. If you change your password it will break those scripts. Unfortunately, even server admins not have access to your existing database password (the passwords are encrypted and not easily decrypted).

The best option if your scripts depend on your password is to search the scripts for the password. If you know the location of the password this is easy. For example, wordpress stores your password in wp-config.php.

If you do not know where the password is stored, use something like the following to find it:

find . -name "*.php" -exec grep "localhost" {} ; -print
find . -name "*.inc" -exec grep "localhost" {} ; -print
find . -name "*.php" -exec grep "3306" {} ; -print
find . -name "*.inc" -exec grep "3306" {} ; -print

These search through common php file extensions and search for the strings “localhost” and “3306” which are usually close to the location of your password. You can also search for the term “password” or “pass” but will likely get a lot of false positives.

If you are not comfortable doing the above, our support staff can find your password for a one-time fee of $25. Contact support with your request.