Solved Can't start MySQL after fresh installation

Hello,
Code:
cd /usr/ports/databases/mysql55-server
make BUILD_OPTIMIZED=yes BUILD_STATIC=yes
make install clean
The MySQL server 5.5.43 server is not starting after fresh installation on FreeBSD 9.3.
Code:
# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
su: unknown login: mysql
/usr/local/etc/rc.d/mysql-server: WARNING: failed to start mysql
/var/log/messages:
Code:
Jun 15 10:48:33 srv root: /usr/local/etc/rc.d/mysql-server: WARNING: failed to start mysql
and there is not MySQL error file.

Can anyone help?

Thanks
 
Looks like the port failed to create the MySQL user accounts that are needed. What do these commands output?
getent passwd mysql
getent group mysql

If you get no output the accounts are not there. You can create them by hand using:
pw group add -g 88 mysql
pw user add -g 88 -u 88 -c 'MySQL Daemon' -d /var/db/mysql -s /usr/sbin/nologin mysql
After that MySQL should be able to start.
 
Code:
getent passwd mysql

gives me no output
Code:
# pw groupadd -g 88 -n mysql
pw: group name `mysql' already exists

# pw user add -g 88 -u 88 -n mysql -c 'MySQL Daemon' -d /var/db/mysql -s /usr/sbin/nologin mysql
pw: user 'mysql' already exists
but
Code:
# rmuser mysql
rmuser: user (mysql) does not exist in the password database.

and also
Code:
# pw deluser mysql
pw: no such user `mysql'
 
Ah, in that case the passwd file and the database are out of sync. Simplest solution is to start vipw(8), don't change anything, save and exit. That should trigger the synchronization. There's also a command to do this but I keep forgetting the exact syntax.
 
Back
Top