Discussion:
mysql installation and setup
Rick Kelly
2005-03-21 10:00:36 UTC
Permalink
Where can I find real documentation on installing mysql from pkgsrc?

This:

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/pkg/bin/mysqladmin -u root password 'new-password'
/usr/pkg/bin/mysqladmin -u root -h wolf password 'new-password'
See the manual for more instructions.

Does not work!!! Either as root or mysql user.

Error message:

/usr/pkg/bin/mysqladmin: unable to change password; error: 'You must have privileges to update tables in the mysql database to be able to change passwords for others'

Do I need to actually shut down the machine, connect a console and keyboard,
and log in at the console as root?

The docs on http://dev.mysql.com/doc/mysql/en/resetting-permissions.html don't
seem to work.

Does pkgsrc set up some kind of password that it doesn't mention?

It looks like I'll have to remove the package and then install from the
beginning.
--
Rick Kelly ***@rmkhome.com
<http://www.rmkhome.com/>
<http://rkba.rmkhome.com/>
matthew sporleder
2005-03-21 15:30:00 UTC
Permalink
After a freshly installed mysql, I ran the following as root:
mysqladmin -u root password 'foo'
This effectively set the password as foo.
After that, if I wanted to change the password, I did:
mysqladmin -u root -p password 'bar'
It would prompt me for the current password and then change it.

As my own user, I tried this:
mysqladmin -u root -p password 'poo'
And it worked the same way. If there was a password set already, you
would get an error like:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

The error you're getting seems like the mysqld doesn't have write
access to /var/mysql. Did you possibly start mysql manually and not
specify the -u mysql/root? Try using the startup script, I found mine
in:
/usr/pkg/share/examples/rc.d/mysqld
and it required that I have mysql=YES in /etc/rc.conf.

Or if you want to continue starting manually, make sure you use
mysqld_safe -u mysql or whatever you like.

On Mon, 21 Mar 2005 03:00:36 -0700 (MST), Rick Kelly
Post by Rick Kelly
Where can I find real documentation on installing mysql from pkgsrc?
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
/usr/pkg/bin/mysqladmin -u root password 'new-password'
/usr/pkg/bin/mysqladmin -u root -h wolf password 'new-password'
See the manual for more instructions.
Does not work!!! Either as root or mysql user.
/usr/pkg/bin/mysqladmin: unable to change password; error: 'You must have privileges to update tables in the mysql database to be able to change passwords for others'
Do I need to actually shut down the machine, connect a console and keyboard,
and log in at the console as root?
The docs on http://dev.mysql.com/doc/mysql/en/resetting-permissions.html don't
seem to work.
Does pkgsrc set up some kind of password that it doesn't mention?
It looks like I'll have to remove the package and then install from the
beginning.
--
<http://www.rmkhome.com/>
<http://rkba.rmkhome.com/>
--
_Matt
Rick Kelly
2005-03-22 02:09:00 UTC
Permalink
Post by matthew sporleder
Or if you want to continue starting manually, make sure you use
mysqld_safe -u mysql or whatever you like.
Post by Rick Kelly
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
/usr/pkg/bin/mysqladmin -u root password 'new-password'
/usr/pkg/bin/mysqladmin -u root -h wolf password 'new-password'
See the manual for more instructions.
I reinstalled and did the above successfully.

Now as mysql user:

$ mysqladmin shutdown
mysqladmin: shutdown failed; error: 'Access denied for user: '@localhost' (Using password: NO)'

$ mysqladmin shutdown -u mysql
mysqladmin: shutdown failed; error: 'Access denied for user: '@localhost' (Using password: NO)'

Note that it never asks me for a password.

As system root user:

wolf# mysqladmin shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: '***@localhost' (Using password: NO)'

wolf# mysqladmin shutdown -u mysql
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: '***@localhost' (Using password: NO)'

wolf# mysqladmin shutdown -u root
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: '***@localhost' (Using password: NO)'

Never asks me for a password.

How do people use this software? The online manuals are useless.

This is: mysql-server-3.23.58
--
Rick Kelly ***@rmkhome.com
<http://www.rmkhome.com/>
<http://rkba.rmkhome.com/>
Ben Collver
2005-03-22 02:37:30 UTC
Permalink
Post by Rick Kelly
How do people use this software? The online manuals are useless.
It has been a while since I configured a new mysql server, but I kept
notes at:

http://backyard.homeunix.net/~ben/docs/comp/unix/netbsd/mysql-notes

Hope this helps,

Ben
Rick Kelly
2005-03-22 06:43:01 UTC
Permalink
Post by Ben Collver
http://backyard.homeunix.net/~ben/docs/comp/unix/netbsd/mysql-notes
Thanks, that worked out really well. :-)

In a couple of hours I installed:

mysql from pkgsrc
php from scratch
phpBB from scratch
apache 1.3.x from scratch

All worked out well. It is easier to build apache and php from source
rather than pkgsrc. You get a chance to read the docs and customize the
configuration.
--
Rick Kelly ***@rmkhome.com
<http://www.rmkhome.com/>
<http://rkba.rmkhome.com/>
matthew sporleder
2005-03-22 05:45:56 UTC
Permalink
You need to specify -p on the command line to have it ask for a
password after you set one.


On Mon, 21 Mar 2005 19:09:00 -0700 (MST), Rick Kelly
Post by Rick Kelly
Post by matthew sporleder
Or if you want to continue starting manually, make sure you use
mysqld_safe -u mysql or whatever you like.
Post by Rick Kelly
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
/usr/pkg/bin/mysqladmin -u root password 'new-password'
/usr/pkg/bin/mysqladmin -u root -h wolf password 'new-password'
See the manual for more instructions.
I reinstalled and did the above successfully.
$ mysqladmin shutdown
$ mysqladmin shutdown -u mysql
Note that it never asks me for a password.
wolf# mysqladmin shutdown
mysqladmin: connect to server at 'localhost' failed
wolf# mysqladmin shutdown -u mysql
mysqladmin: connect to server at 'localhost' failed
wolf# mysqladmin shutdown -u root
mysqladmin: connect to server at 'localhost' failed
Never asks me for a password.
How do people use this software? The online manuals are useless.
This is: mysql-server-3.23.58
--
<http://www.rmkhome.com/>
<http://rkba.rmkhome.com/>
--
_Matt
Michael Smith
2005-03-22 07:39:36 UTC
Permalink
On Mon, 21 Mar 2005 10:30:00 -0500
Post by matthew sporleder
The error you're getting seems like the mysqld doesn't have write
access to /var/mysql
When I did this I had to manually change the ownership of /var/mysql so
that the mysql daemon could access it.
--
Michael Smith
Network Applications
www.netapps.com.au | +61 (0) 416 062 898
Web Hosting | Internet Services
Loading...