pkg_info | grep -i mysql

cd /usr/ports/databases/mysql50-server

make

make install


echo ‘mysql_enable=”YES”‘ >> /etc/rc.conf
/usr/local/etc/rc.d/mysql-server start

 /usr/local/bin/mysqladmin -u root password newpassword

mysql_install_db

FreeBSD does not automatically include a default my.cnf for MySQL. Instead, a set of sample configuration files can be found under /usr/local/share/mysql. These configuration files include my-small.cnf, my-medium.cnf, my-large.cnf, my-innodb-heavy-4G, and my-huge.cnf. The appropriate file can be copied and used as a template configuration by performing the following actions:

cd /usr/local/share/mysql/
cp /usr/local/share/mysql/my-large.cnf /usr/local/etc/my.cnf
 
    
/usr/local/etc/rc.d/mysql-server restart
ajouter dans /etc/rc.conf
mysql_dbdir=”/data/db”
chown mysql:mysql /data/db

sources

http://www.marksanborn.net/freebsd/installing-mysql-51-on-freebsd-70/

http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/

http://www.quesaco.org/Dupliquer-une-base-MySQL