Installing MySQL Server 5.1 on FreeBSD 6.2
I will be installing MySQL Server 5.1 on FreeBSD 6.2 from ports.Log-in as root using the su, switch to the directory and begin the installation.
root@freebsd:/usr/ports/databases/mysql51-server#
cd /usr/ports/databases/mysql51-server
root@freebsd:/usr/ports/databases/mysql51-server#
make install
root@freebsd:/usr/ports/databases/mysql51-server#
We need to issue a rehash for the tcsh shell in order to
reload the commands installed by the port.
root@freebsd:/usr/ports/databases/mysql51-server#
rehash
Now we need to do some configuration of the MySQL server.
Set the database to use mysql user account, which will
get created. Copy the default configuration file.
root@freebsd:/usr/ports/databases/mysql51-server#
mysql_install_db --user=mysql
root@freebsd:/usr/ports/databases/mysql51-server#
cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf
root@freebsd:/usr/ports/databases/mysql51-server#
chown mysql:wheel /var/db/mysql/my.cnf
Start the MySQL Daemon
root@freebsd:/usr/local#
cd /usr/local ; /usr/local/bin/mysqld_safe &
Set the password for root user of the MySQL Database.
root@freebsd:/usr/local#
/usr/local/bin/mysqladmin -u root password ‘xxxxx’
root@freebsd:/usr/local#
/usr/local/bin/mysqladmin -u root -h freebsd.noobtechdev.com
password ‘xxxxx’
Add MySQL to system startup. Also make it run under
user mysql and only only the local interface 127.0.0.1
since I will only be accessing it from the same server.
root@freebsd:/usr/local# vi /etc/rc.conf
mysql_enable=”YES”mysql_args=”––user=mysql ––bind-address=127.0.0.1″
I’m going to restart my server now to make sure
that the MySQL starts, and is only bound to 127.0.0.1