MySQL DBA - Tips and Techniques Magazine

14 Oct 2014

Install MYSQL on FREEBSD

1)     DOWNLOAD required MYSQL Version on Free BSD

 

You can try getting the server to download the software, however, it will install the software in /usr/local/bin

 

            cd /usr/ports/databases/

cd mysql50-server                  (or the directory relevant to the version of mysql you wish to install)

make install clean

 

To start the database

 

            vi /etc/rc.conf --> mysql_enable="YES"

 

            /usr/local/etc/rc.d/mysql-server start

 

            You can create a my.cnf if required, otherwise it will use all the defaults

 

The server will attempt to connect to various ftp sites to get the software, and hopefully will download it for you. 

 

 

Alternatively

 

2)     DOWNLOAD required MYSQL Version on Free BSD and FTP/SCP to new box

 

You can use pkg_add to install mySQL but I prefer to do the following steps (it's a more complicated process on Free BSD):-

Add mySQL user and group

 

  • pw groupadd mysql
  • pw useradd mysql
  • pw groupmod mysql -M mysql
  • pw groupshow mysql

 

Create directory where mySQL resides

 

  • mkdir /opt/tiscali/mysql_5.0.19

 

Uncompress and untar ball file

 

In this case the file contains the server and client mySQL binaries. Run as ROOT.

 

·       shell> cd /opt/tiscali/mysql_5.0.19

·       shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf –

·       shell> ln -s full-path-to-mysql-VERSION-OS mysql

·       shell> cd mysql

·       shell> chown -R mysql .

·       shell> chgrp -R mysql .

·       shell> scripts/mysql_install_db --user=mysql

·       shell> chown -R root .

·       shell> chown -R mysql data

·       shell> bin/mysqld_safe --user=mysql &

·       shell> ln -s /opt/tiscali/mysql_5.0.19/mysql    /usr/local/mysql

·       shell> cp /opt/tiscali/mysql_5.0.19/mysql-standard-5.0.19-freebsd5.3-i386/support-files/mysql.server /etc/rc.d/mysql.server

·       shell> cp /opt/tiscali/mysql_5.0.19/mysql-standard-5.0.19-freebsd5.3-i386/support-files/mysql.server /usr/local/etc/rc.d/mysql-server.sh

·       shell> vi /etc/rc.conf --> mysql_enable="YES"

·       shell> ln -s /etc/my.cnf      /opt/tiscali/mysql_5.0.19/mysql/data/my.cnf

 

If the tar files that you install include MySQL-server, the mysqld server should be up and running after installation. You should be able to start using MySQL.

 

No comments:

Post a Comment