понедельник, 9 октября 2017 г.

Upgrading FreeBSD box with a custom kernel

PATCHING THE BASE SYSTEM
 
From FreeBSD handbook, chapter 23:
Only the GENERIC kernel can be automatically updated by freebsd-update. If a custom kernel is installed, it will have to be rebuilt and reinstalled after freebsd-update finishes installing the updates.
In this post I am going to show how I usually update my FreeBSD home box running a custom kernel inherited from the GENERIC kernel.

First of all, I update the GENERIC kernel. It is very possible.
From the chapter of handbook mentioned above:
freebsd-update will detect and update the GENERIC kernel if /boot/GENERIC exists, even if it is not the current running kernel of the system.
This option suits my requirements, because my kernel based on the GENERIC.
$ sudo freebsd-update fetch
$ sudo freebsd-update install
$ reboot
After the system come back, I upgrade the custom kernel (in my case called FBSD_GF4-1-NOSND).
$ sudo -i
# cd /usr/src
# make buildkernel KERNCONF=FBSD_GF4-1-NOSND
Building a kernel may take a while. After the kernel is built, I install it.
# make installkernel KERNCONF=FBSD_GF4-1-NOSND
# reboot

UPGRADING SOFTWARE PACKAGES

Starting the Autumn, 2017 I dislike packages again. Ports are the strength of FreeBSD! But I am going to describe the process of updating software packages. For the memories.
$ sudo portsnap fetch update
$ sudo pkg update
$ pkg updating | $PAGER
After reading UPDATING info carefully, I upgraded the software next way.
$ sudo pkg upgrade
$ sudo pkg clean
$ sudo pkg autoremove
Then reboot and try to count regressions =)
$ reboot

четверг, 20 апреля 2017 г.

среда, 22 марта 2017 г.

MySQL notes

All "recipes" from this post are for FreeBSD (10.3).

How to completely change MySQL 5.6 with 5.7?

NB, please, that this approach will cause wiping of all MySQL data from your host.
  1. sudo pkg remove mysql56-client # will remove the server too
  2. sudo rm -rd /var/db/mysql /usr/local/etc/mysql
  3. sudo pkg install mysql57-server # will install the client too

Start MySQL

  1. sudo service mysql-server onestart

Auto start MySQL after the system boots

  1. sudo cp /etc/rc.conf /etc/rc.conf.old
  2. echo 'mysql_enable="YES"' >> /etc/rc.conf

First time login as DB server admin

  1. sudo cat /root/.mysql_secret # remember the PASSWORD
  2. mysql -u root -p # type the PASSWORD from /root/.mysql_secret

Reset password before usage of MySQL

Execute the next request in the MySQL monitor.
  • SET PASSWORD = PASSWORD('vs?!h(y=/!er');

Create a regular user account

  • CREATE USER IF NOT EXISTS 'vasilyb'@'localhost' IDENTIFIED BY '21212121' PASSWORD EXPIRE;

Remove a user account

  • DROP USER 'jeffrey'@'localhost';