How to Install MySQL on FreeBSD

Install MySQL on FreeBSD:

Firstly you check ‘pkg’ tool installed on your machine. If ‘ pkg’ tool is not installed on your FreeBSD then execute the following command to installed ‘pkg’ tool on your machine

root@localhost:~ # pkg info pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:i386/quarterly, please wait…
http://pkg.FreeBSD.org/FreeBSD:10:i386/quarterlyVerifying signature with trusted certificate pkg.freebsd.org.2013102301… done
Installing pkg-1.7.2…
Extracting pkg-1.7.2: 100%
pkg-1.7.2
Name : pkg
Version : 1.7.2
Installed on : Thu Apr 28 14:53:42 2016 IST
Origin : ports-mgmt/pkg
Architecture : freebsd:10:x86:32
Prefix : /usr/local
Categories : ports-mgmt
Licenses : BSD2CLAUSE
Maintainer : pkg@FreeBSD.org
WWW : http://wiki.freebsd.org/pkgng
Comment : Package manager
Shared Libs provided:
libpkg.so.3
Annotations :
Flat size : 8.92MiB
Description :
Package management tool

WWW: http://wiki.freebsd.org/pkgng
root@localhost:~ #

After installation the ‘pkg’ tool ,you updates package repository with the ‘pkg’ command and ‘update ‘ option .

root@localhost:~ # pkg update

To install MySQL 5.6 using pkg, ‘ command with ‘ install ‘ option

root@localhost:~ # pkg install mysql56-server
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 4 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
mysql56-server: 5.6.27
mysql56-client: 5.6.27
libedit: 3.1.20150325_2
perl5: 5.20.3_8

The process will require 163 MiB more space.
22 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching mysql56-server-5.6.27.txz: 100% 8 MiB 79.5kB/s 01:44
Fetching mysql56-client-5.6.27.txz: 100% 2 MiB 86.6kB/s 00:22
Fetching libedit-3.1.20150325_2.txz: 100% 119 KiB 121.8kB/s 00:01
Fetching perl5-5.20.3_8.txz: 100% 13 MiB 87.0kB/s 02:32
Checking integrity… done (0 conflicting)
[1/4] Installing libedit-3.1.20150325_2…
[1/4] Extracting libedit-3.1.20150325_2: 100%
[2/4] Installing mysql56-client-5.6.27…
[2/4] Extracting mysql56-client-5.6.27: 100%
[3/4] Installing perl5-5.20.3_8…
[3/4] Extracting perl5-5.20.3_8: 100%
[4/4] Installing mysql56-server-5.6.27…
===> Creating users and/or groups.
Creating group ‘mysql’ with gid ’88’.
Creating user ‘mysql’ with uid ’88’.
[4/4] Extracting mysql56-server-5.6.27: 100%
Message from mysql56-client-5.6.27:
* * * * * * * * * * * * * * * * * * * * * * * *

Please be aware the database client is vulnerable
to CVE-2015-3152 – SSL Downgrade aka “BACKRONYM”.
You may find more information at the following URL:

http://www.vuxml.org/freebsd/36bd352d-299b-11e5-86ff-14dae9d210b8.html

Although this database client is not listed as
“affected”, it is vulnerable and will not be
receiving a patch. Please take note of this when
deploying this software.

* * * * * * * * * * * * * * * * * * * * * * * *
Message from perl5-5.20.3_8:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
Message from mysql56-server-5.6.27:
************************************************************************

Remember to run mysql_upgrade the first time you start the MySQL server
after an upgrade from an earlier version.

************************************************************************
root@localhost:~ #

To enable MySQL server service, add ‘ mysql_enable=”YES ‘ in the /etc/rc.conf file or you can use ‘sysrc’ command for this.

root@localhost:~ # sysrc mysql_enable=yes
mysql_enable: -> yes
root@localhost:~ #

Start the MySQL service.

root@localhost:~ # service mysql-server onestart
Starting mysql.
root@localhost:~ #

Now Start the MySQL Server.

root@localhost:~ # mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

2 thoughts on “How to Install MySQL on FreeBSD

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s