Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43416 - starting mysql could use some clarity
Summary: starting mysql could use some clarity
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: SpanKY
URL: http://www.gentoo.org/doc/en/qmail-ho...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-01 13:46 UTC by Steven Boothe
Modified: 2004-04-21 18:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Boothe 2004-03-01 13:46:21 UTC
The documentation states:

Code Listing 3.2: Setting up mysql

# rc-update add mysql default
# /etc/init.d/mysql start
# nano /etc/vpopmail.conf
...

The experience is a bit different however:
family root # /etc/init.d/mysql start
 * You dont appear to have the mysql database installed yet.
 * Please run /usr/bin/mysql_install_db to have this done...
family root # /usr/bin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root -h family password 'new-password'
/usr/bin/mysqladmin -u root password 'new-password'
See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

family root # /etc/init.d/mysql start
 * Starting mysqld...                                                                                                 [ ok ]

family root # /usr/bin/mysqladmin -u root password 'new-password'
family root # nano /etc/vpopmail.conf

vpopmail.conf already appears to have 'secret' changed to vpoppw so no change appears necessary...

family root # mysql -p << EOF
> create database vpopmail;
> use mysql;
> grant select, insert, update, delete, create, drop on vpopmail.* to vpopmail@localhost identified by 'vpoppw';
> flush privileges;
> EOF
Enter password: ******
family root #
Comment 1 SpanKY gentoo-dev 2004-03-02 08:48:41 UTC
added a note saying you should make sure you've already setup mysql ;)
Comment 2 Steven Boothe 2004-03-02 11:24:56 UTC
Okay that may be the easier solution for you :), but that doesn't help the person merely trying to emerge vpopmail and picks up mysql as a dependency. So I'm thinking it would make a nice addition to the documentation if there is something hinting at what to do in the event that mysql has _not_ been set up. In fact, this document assumes that mysql was not already setup or why else would it make the suggestion to use rc-update add mysql default? My interest is to expand the documentation and help make it more informative, thus adding value to the experience of maintaining a Gentoo system overall.

So I propose we make a note as to how to set up mysql in the event that it was emerged as a dependency, and thus the unexperienced with mysql will still have a trail of breadcrumbs to follow in the event that last note from emerging mysql was barried by the next package?

Here's how my suggestion for the qmail(vpopmail)-howto would read:

Code Listing 3.2: Setting up mysql

If this is your first time running mysql you will need to run the following commands:

# rc-update add mysql default
# /usr/bin/mysql_install_db
# /etc/init.d/mysql start
# /usr/bin/mysqladmin -u root password 'new-password'
# nano /etc/vpopmail.conf
...

By adding those commands in the document, you will be adding confidence to the user by adding a level of confirmation and consistancy with the other documents, and in addition, will make some lives easier by saving them the trouble of having to stop and look around for what to do (as I had to). Yes the documentation is out there (I found it via google), but with just a couple of lines it could have been a much easier task to accomplish. Those who have already setup MySQL, will know they don't have to do those things over again. But, even for those who don't, a simple note to that effect is simple enough as well: "If you have already setup MySQL, you can ignore the following..."

Just my .02 cents.
Comment 3 SpanKY gentoo-dev 2004-03-02 11:36:56 UTC
the end of the mysql merge says this:
    einfo
    einfo "You might want to run:"
    einfo "\"ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config\""
    einfo "if this is a new install."
    einfo

i'm not about to start reproducing stuff that's contained in the ebuild in the documentation ... that step will pretty much handle everything you just suggested
Comment 4 Steven Boothe 2004-03-02 11:55:31 UTC
Except for where it relates to this:

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root -h localhost password 'new-password'
/usr/bin/mysqladmin -u root password 'new-password'

As I just discovered, if you set the password using the -h option everything will work, but if you opt to just run the command without the "-h localhost" you will not be able to proceed, and will encounter the errors I wrote about previously. So at a minimum, I would still say this should be articulated as it is not clear, and could lead to someone wasting days trying to figure out why they cannot get their system to work as described in your howto.
Comment 5 Steven Boothe 2004-03-02 12:08:10 UTC
Not to mention, if a person emerges vpopmail, all that great documentation you referenced:

"the end of the mysql merge says this:
    einfo
    einfo "You might want to run:"
    einfo "\"ebuild /var/db/pkg/dev-db/${PF}/${PF}.ebuild config\""
    einfo "if this is a new install."
    einfo
"
gets _burried_ as vpopmail begins to emerge!!! Thus a person would never even see it!!! What harm is in adding a couple extra lines to make things easier? Is it that bad of a redundancy that the benefit isn't outweighed by the benefit? I just spent better than eight hours over the last week indulging this principled stand against redundancy. I'm not getting paid for submitting these bug reports. I'm attempting to help improve the life of this community by vollunteering my time in an attempt to save people theirs.

Please, if nothing else, put something in there regarding the password issue, because, that WILL break the process if someone get's it wrong, and as it stands, there is nothing pointing that out.
Comment 6 SpanKY gentoo-dev 2004-03-19 13:09:52 UTC
i thought i touched this up ...
Comment 7 SpanKY gentoo-dev 2004-04-21 18:35:56 UTC
added this before the /etc/init.d/mysql start command:

If you just emerged mysql for the first time, make sure you run 
the <i>ebuild &lt;mysql.ebuild&gt; config</i> command and follow the 
directions before starting the mysql server.