Showing posts with label install mysql. Show all posts
Showing posts with label install mysql. Show all posts

Tuesday, January 1, 2019

Apache 2.4 /PHP7.3 /PHP-FPM /freeBSD 12 (part 2): Mysql Server57/PHP Extensions

Install Mysql server 57: 
MySQL server 5.7 installations of FreeBSD 12

Install PHP Extensions:
When you install any DB support PHP extension it will automatically install this particular DB client libraries. Chances are that these client libs will be of an old version. To avoid version mismatch simply install the database server of version you want before installing the PHP extension.
# cd /usr/ports/lang/php73-extensions && make install clean

This is a meta-port listing main PHP extension. You check the option and it will install the port of this extension. But the list is not complete, for example, pecl-* extensions you will have to install by hand:
# cd /usr/ports/devel/pecl-intl
# make install clean

Complete!


Friday, December 21, 2018

MySQL server 5.7 installation of freeBSD 12

(It is recommended that to install MySQL before the installation of PHP_extension to avoid old extension installation.)

Method #1. Install using port: (not working!)
# cd /usr/ports/databases/mysql80-server && make install clean BATCH=yes

(By default, we will compile the software from source, it is not built in static. According to MySQL documentation, building the binary using static will result a 13% improvement comparing to building the binary using dynamic. Here is an example how to build MySQL with static option enabled)

# make BUILD_OPTIMIZED=yes BUILD_STATIC=yes
# make install clean
(It takes ...time hr)

/etc/rc.conf
mysql_enable="YES"
# sysrc apache24_enable=yes

Method #2, Installusing pkg:
# pkg update
# pkg upgrade
# pkg install mysql57-server mysql57-client
# sysrc mysql_enable="yes"
# service mysql-server start


MySQL secure installation:
(Note the password)
# cat $HOME/.mysql_secret
yFH&pek0yw3

# mysql_secure_installation
Answer them all with ...y
# mysql -u root -p 
password: yFH&pek0yw3
root@localhost [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'yFH&pek0yw3';
root@localhost [(none)]> show databases;

Create a user / database in MySQL:
GRANT ALL PRIVILEGES ON *.* TO 'jira'@'localhost' IDENTIFIED BY 's@ydrfD34FEds';
exit
# mysql -u jira -p
CREATE DATABASE jira;

Check the latest version of the MySQL:
# mysqladmin -u root -p version

Start/Stop:
# sudo /usr/local/etc/rc.d/mysql-server start
# service mysql-server start
# sudo /usr/local/etc/rc.d/mysql-server start

Link:
Install Portsnap

Ref:
1. How to Install MySQL Server with phpMyAdmin on FreeBSD 11
2. The easiest way to improve the performance of MySQL server on FreeBSD