TurnKey Linux Virtual Appliance Library

remote mysql access

Hi,

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 192.168.0.80 -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:

http://www.turnkeylinux.org/docs/database-remote-access

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?

Thanks

resolved it myself (and beginning to hate mysql)

Hi,

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:

http://www.dotkam.com/2007/04/10/mysql-reset-lost-root-password/ (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


Found the nice way for noobs

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.

Don't work for me: Failed to save MySQL server options

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

 

Why?

Jeremy's picture

Not sure

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.

Your method is easy and it

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

Couldn't believe it was not listening to remote computers

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

I tried this but it does not

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

Jeremy's picture

Did you follow the steps in the docs/

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.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)