Configuration

Once you have started the MySQL server, you probably want to add a root account in order to maintain your MySQL users and databases. This can be done manually or automatically, as mentioned by the output of the above script. Either run the commands to set a password for the root account, or run the secure installation script.

You now should be able to do further configuration using your favorite interface. For example you can use MySQL's command line tool to log in as root into your MySQL server:

$ mysql -p -u root

To start MySQL at bootup add mysqld to the list of daemons in /etc/rc.conf.

Enable remote access

The MySQL server does not listen on the TCP port 3306 by default. To allow (remote) TCP connections, comment the following line in /etc/mysql/my.cnf:

skip-networking

Upgrading

You might consider running this command after you have upgraded MySQL and started it:

# mysql_upgrade -u root -p

Running multiple instances (MySQL 4 and MySQL 5)

MySQL4:
You can get the MySQL binaries from here
It is best to install them into:

/usr/local/mysql

Copy the start-up script to:

/etc/rc.d

as instructed in the README:

# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/mysqld4

In the start-up script, it helps to explicitly set

Basedir=/usr/local/mysql
pid_file=/usr/local/var/run/mysql/mysql4.pid

(make sure the referenced directories are created with suitable permissions)

MySQL daemon cannot start

and there is no entry in the log files, you might want to check the permissions of files in the directories /var/lib/mysql and /var/lib/mysql/mysql. If the owner of files in these directories is not mysql:mysql, you should do the following:

# chown mysql:mysql /var/lib/mysql -R

If you run into permission problems despite having followed the above, ensure that your my.cnf is copied to /etc/: