当前位置:网站首页>Installing MySQL databases in FreeBSD

Installing MySQL databases in FreeBSD

2022-06-26 01:30:00 Linux_ Huazai

MySQL Is an open source relational database MySQL Can be in  Linux、Unix and Windows Running in the system , It can be used in a variety of applications .

Environmental Science

FreeBSD 13-RELEASE

modify pkg Source

You need to create /usr/local/etc/pkg/repos Catalog , Then create FreeBSD.conf The configuration file , And turn off the default source , Then add the domestic software source .

[email protected]:~ # mkdir -p /usr/local/etc/pkg/repos
[email protected]:~ # vi /usr/local/etc/pkg/repos/FreeBSD.conf

FreeBSD: { enabled: no }
ustc: {
  url: "pkg+http://mirrors.ustc.edu.cn/freebsd-pkg//${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}


to update pkg Source :

[email protected]:~ # pkg update -f
Updating ustc repository catalogue...
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    6 MiB   6.5MB/s    00:01    
Processing entries: 100%
ustc repository update completed. 30371 packages processed.
All repositories are up to date.

install MySQL database

Search for pkg What versions are there in the source mysql:

[email protected]:~ # pkg search "^mysql"


The following installation mysql80 edition :

[email protected]:~ # pkg install -y mysql80-server mysql80-client

function MySQL

Next you will run the following command , This will MySQL Services added to  /etc/rc.conf In profile , And start up mysql.

[email protected]:~ # sysrc mysql_enable=yes
mysql_enable:  -> yes


start-up mysql service :

[email protected]:~ # service mysql-server start
Starting mysql.

View service status and mysql Listening port :

[email protected]:~ # service mysql-server status
mysql is running as pid 2194.
[email protected]:~ # sockstat -4l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
mysql    mysqld     2194  19 tcp46  *:33060               *:*
mysql    mysqld     2194  24 tcp4   127.0.0.1:3306        *:*
root     sshd       802   4  tcp4   *:22                  *:*
root     sendmail   781   3  tcp4   127.0.0.1:25          *:*
root     syslogd    709   7  udp4   *:514                 *:*

Verify the installation

To verify the installation , You can use root Log in as and use the following command Check the database version :

[email protected]:~ # mysqladmin -u root -p version
Enter password: 
mysqladmin  Ver 8.0.25 for FreeBSD13.0 on amd64 (Source distribution)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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

Server version  8.0.25
Protocol version 10
Connection  Localhost via UNIX socket
UNIX socket  /tmp/mysql.sock
Uptime:   4 min 16 sec

Threads: 2  Questions: 6  Slow queries: 0  Opens: 138  Flush tables: 3  Open tables: 54  Queries per second avg: 0.023

summary

So far MySQL 8 Installed and running on FreeBSD 13 Yes .

Original address of this article : How to be in FreeBSD 13 Install in MySQL database | 《Linux It's time to learn 》 edit : Add treasure , Auditor : Add treasure

原网站

版权声明
本文为[Linux_ Huazai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206252342327719.html