Webmin not allowing database creation, user creation

Q: Inside webmin I cannot create new databases or users, I get the error:

DBI connect failed : Access denied for user ‘my_user_nam_here’@’%’ to database ‘mysql’

How can I fix this?

A: You need to login to mysql as the mysql admin user (usually called root). Normally if you login to webmin as root it will login you into MySQL as root too. If this does not work, fix it with:

Inside webmin:

Click “servers”
Click “MySQL Databaseservers”
Click “Module Config” on the MySQL screen (top left)
Change “Administration login” to either automatic (should work) or “root”

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.