<br><br><div><span class="gmail_quote">On 2/7/06, <b class="gmail_sendername">sean finney</b> <<a href="mailto:seanius@debian.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">seanius@debian.org
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi marcin,<br><br>fyi, i'm cc'ing this to the dbconfig-common discussion list...<br><br>On Tue, Feb 07, 2006 at 05:09:30PM +0100, Marcin Antczak wrote:<br>> But I would like to make it very easy to end user. And I also would like to
<br>> make it installable 'from scratch'.<br>> I mean for user that doesn't have mysql-server installed.<br><br>the easiest way to do that would be to have your package depend<br>on the mysql-server... but i would strongly advise against it,
<br>and instead mention mysql-server as a Recommends or Suggests,<br>and also say something in the Package description like:<br><br> <rest of long description><br> .<br> This package requires access to a functioning mysql system. If you
<br> do not plan on using a remote mysql system then you should install the<br> mysql-server package first.<br><br>... or something like that.</blockquote><div><br>Well it is logical but it's pretty complicated for many users. The problem is that we don't have an option to choose between
local and remote server.<br>
<br>
By default only localhost is availabe (or I'm wrong but AFAIK I can set
remote host for dbconfig-common only when I use custom config file).<br>
<br>
So, this is pretty big problem because we need:<br>
<br>
1. allow users to connect to remote servers<br>
2. allow users to connect to local server and set up database without
additional user activity (ie. 'mysqladmin -u root password
somepassword').<br>
<br>And while we don't have something like 'conditional dependency' in debian or ubuntu it is pretty confusing.<br>
<br>
We can set mysql-server as dependency but this will reduce an ability to use database on remote host.<br>
<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> The problem is that if I add mysql-server as dependency then my package
<br>> won't install properly.<br>> Because I need to add admin password for mysql admin first.<br><br>why do you need the admin password for mysql? if you are using<br>dbconfig-common, and your db app just needs to perform some
<br>basic sql code execution as admin, dbconfig-common will already<br>take care of that for you. a little more information would<br>be very helpful to answer this further.</blockquote><div><br>My app doesn't need to perform sql code as admin - admin password is required on installation stage.
<br>I need admin app to create database for my app. This is why I want to use password taken from /etc/mysql/debian.cnf<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> So, I need to install mysql-server, then mysqladmin -u root password
<br>> somepassword<br><br>you definitely do not want to go changing the mysql root password.<br>that would make a lot of people angry...</blockquote><div><br>
Well but by default dbc_dbadmin is 'root' so I need root password to database if I want to setup database.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> The problem is that in Ubuntu - and propably in Debian, too - mysql-server
<br>> is installed as service/daemon<br>> and install scripts generates default password and admin account that is<br>> different than 'root'.<br><br>yes... the root account still exists as well though.</blockquote>
<div><br>
and as I mentioned above root is set as default value of $dbc_dbadmin<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> In ubuntu mysql-sever create small file in /etc/mysql/debian.cnf with some
<br>> settings - admin user: debian-sys-maint, and with autogenerated password.<br>><br>> I seems logical that if I want to automate my package then I can use<br>> debian-sys-maint as dbc_dbadmin, and set into
<br>> /etc/dbconfig-common/packagename.conf.<br><br>i've considered using the debian-sys-maint account before, but<br>every time i do, i end up deciding not to because the local<br>admin may have modified and/or removed it.
</blockquote><div><br>
Again - it's default value for users that want to use package without any modifications.<br>
I think that only advanced users with special needs would like to remove this account.<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> one option which
<br>might be a good compromise would be to have an extra question like<br>"should i use the debian maintainance account?" built-in to<br>dbc, so the admin is given the choice.</blockquote><div><br>
First thing is that user should have a choice to select host. Local or remote.<br>
<br>
If remote - things are pretty simple.<br>
And if local - dbconfig should try to connect. And return error if localhost is not available (no mysq-server).<br>
<br>
This still won't install mysql-server on demand. But it's just a step ahead.<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> So my question is: Is there any way to pass admin password to
<br>> dbconfig-common from script without calling debconf and without any user<br>> interaction?<br><br>if we did what i mention above, it could be built into<br>dbc to copy/use the debian-sys-maint file and pass it internally
<br>to all mysql-related calls... but this is of course unwritten.<br></blockquote></div><br>
So, what's your opinion about it? What do you think about patches?<br>
<br>
Btw. There is another thing. Currently if we don't have mysql-server as dependency we have more issues.<br>
<br>
Short example: cacti - it uses dbconfig-common, and it doesn't need mysql server.<br>
<br>
I don't have mysql-server (I don't need one). So, let's try:<br>
<br>
apt-get install cacti<br>
<br>
I get questions about password for user cacti (in fact I even don't
know that it's cacti - I know that because I know dbconfig-common
sources and documentation)<br>
<br>
And... that's it - package is installed - no questions about remote
host, no question about mysql-server on localhost. Script will simple
install cacti but then suddenly when trying to run this application on
<a href="http://localhost/cacti">http://localhost/cacti</a> user get a bunch of warnings:<br>
<br>
<b><span style="font-weight: bold;">"</span>Warning</b>: mysql_connect() [<a href="http://localhost/cacti/function.mysql-connect">function.mysql-connect</a>]: Access denied for user: 'cacti@localhost' (Using password: YES) in
<b>/usr/share/adodb/drivers/adodb-mysql.inc.php</b> on line <b>338"<br>
<span style="font-weight: bold;"><br>
and then on the bottom of the page:<br>
<br>
</span></b>"Cannot connect to MySQL server on 'localhost'. Please make sure you
have specified a valid MySQL database name in 'include/config.php'."<br>
<br>
I consider myself as advanced user but even for me it's just annoying and for me this package as 'broken'.<br>
<br>
So, please think about it. I understand that we need to provide
flexibility (and user should have an ability to connect to remote host)
but also we need to configure things that "just work".<br>
<br>
<br>
Regards,<br>
Marcin<br>
<br>
<br>
<b><span style="font-weight: bold;"></span><br>
</b>