mySQL 5.4 server & Post installation SNAFUs

Matthew Seaman m.seaman at
Sat Jan 9 09:56:48 UTC 2010

jaymax wrote:

> Post installation SNAFUS
> ========================
> [i] support-files/mysql.server are apparently in "/usr/local/share/mysql" am
> I correct, all of them?

Yes, except that mysql-server is the rc.subr(8) script to start up mysql on
boot, and that is to be found in /usr/local/etc/rc.d/mysql-server

> [ii] mysql_secure_installation is not found in this installation, it is in
> v. 5.5 however.

It's part of a different port. You need to install databases/mysql54-scripts
The same applies to mysql55 actually -- you must have somehow already
installed databases/mysql55-scripts in that case.

> [iii] Start restricted to /usr/local/bin/mysqld_safe & apparently since
> mysql_secure_installation is not available
> [iv] /usr/local/bin/mysqladmin -u root password ==> 
> ax# /usr/local/bin/mysqladmin -u root password 'xxxxxxxx'
> /usr/local/bin/mysqladmin: connect to server at 'localhost' failed
> error: 'Access denied for user 'root'@'localhost' (using password: NO)'
> ax# /usr/local/bin/mysqladmin -u root -h password xxxxxxxx
> /usr/local/bin/mysqladmin: connect to server at '' failed
> error: 'Access denied for user 'root'@'' (using password: NO)'
> HOW can I setup root password ?

If you're currently logged into, then you definitely want
to use '-h localhost' (or nothing, as that's the default).  If there is
already a root password, obviously you need to give it.  Conversely, if
you've got a password set in /root/.my.cnf or some other my.cnf file but
this is a brand new mysql install with no root password yet, then you need
to temporarily move that file aside: mysql doesn't let you in if you try
and supply a password for a no-password account.

I advise using mysql_secure_installation -- but you're still going to have
to move aside any pre-existing .my.cnf files.  Also, as a general security
thing, preferably don't allow root logins to mysql from anywhere other than



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list