Peter Meyer's picture


I installed turnkey a few days ago. Nice touch to have webmin, apache, php all installed. It basically all works.

There is just one problem that I can't get solved by myself: mysql should be accessible from outside the virtual machine into which I installed turnkey linux.

What I want to do ist:

# mysql -u root -p

Enter password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost'

.. it doesn't matter if I set a password or not, whether I disable the firewall or not (I get a password request, so there is a conection, I am just not allowed in)


What I tried so far:

PHPMyAdmin tells me that there is a user root with host % (all) with all privileges (I tried with and without a password)

I tried setting the bind-address in my.cnf

I disabled the firewall in webmin

I reinstalled the whole turnkey-lamp-11.0-lucid-x86 from iso (the first time I used the vmware 2009.10-2  image)

... all to no avail - there is no remote access to mysql ...


could someone please tell me what I could try now? Or what configuration file I should add to provide more information?


Peter Meyer's picture


Replying to myself. This &%%çç!! cost me hours...

However it is no bug of turnkey itself it also comes with the ubuntu server installation, it seems already broken from the beginning.

To resolve I did what is described here: (even though it says "lost password" my password was correct, it just didn't allow me to log in)

However I am not sure if I did a apt-get --purge remove mysql-server before that

... anyway, now it works for me

Penguinphile's picture

I am new to this (really wonderful and easy) turnkey Linux stuff and this took some time to solve even with the reading so here is how I did it in steps

1. Install your favourite Turnkey Linux system with MySQL (potentially not the MySQL one, I haven't tried it yet)

2. Create your user account for remote access (hint webmin, Servers, MySQL Database Server, User permissions)

3. Allow the MySQL server to listen to remote requests (hint webmin, Servers, MySQL Database Server, MySQL Server Configuration, MySQL server listening address - set to any)

4. Restart MySQL

5. Allow the requests through the firewall (hint webmin, Networking, Linux Firewall, add a rule for TCP where the destination is port 3306)

I suspect there is a good deal better and tighter configuration can be done but for now I have the remote access I need and can tighten it up from there. Don't create remote access users with full permissions unless you are sure that's what you want to do.

Emanuele's picture

I tryied what you said but i get subject error: Failed to save MySQL server options.



Jeremy Davis's picture

Although there was a bug lodged about Webmin MySQL not saving settings properly.

But you should still be able to do it. Just you'll have to manually edit the config file. OTTOMH it should be something like /etc/mysql/my.cnf (or something like that...)

As for what settings you'll need to change, you should find plenty of info via google. Just keep in mind that TKL v11.x is based on Ubuntu 10.04/Lucid (although MySQL settings should be pretty much consistent between Linux distros AFAIK).

You should only need to change MySQL settings. Changing the firewall (IPtables) rules is only needed if you have enabled it (it's disabled by default).

Actually there are instructions in the docs. See here.

Ang Yi Yang's picture

Your method is easy and it works for me, thanks a lot.

email: Jem's picture

Way to go Penguinphile

EXACTLY what I needed.  I hadn't realised that the whole MySQL server was under the control of Webmin.  Now I can access the databases on it by MS Access through MySQL connectors from PCs on the lan.  i.e. at its IP:3306. Thanks.

Regards, Jem

Matt's picture

I tried this but it does not seem to help :S

Jeremy Davis's picture

By default all appliances that include MySQL (or any other DB) allow only local connections (ie remote connection is disabled). This is a security measure. AFAIK the standalone appliances don't have this configuration (it is assumed that a standalone DB server is for the purpose of using remote connections...)

So have a read of the docs here.

Add new comment