当前位置:网站首页>在FreeBSD中安装MySQL数据库
在FreeBSD中安装MySQL数据库
2022-06-25 23:42:00 【Linux_华仔】
| MySQL 是一个开源的关系型数据库MySQL可以在 Linux、Unix 和Windows系统中运行,它可用于多种应用程序。 |
环境
FreeBSD 13-RELEASE
修改pkg源
需要先创建/usr/local/etc/pkg/repos目录,然后创建FreeBSD.conf配置文件,并将默认源关闭,然后添加国内软件源。
[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 }

更新pkg源:
[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.

安装MySQL数据库
搜索一下pkg源里面有哪些版本的mysql:
[email protected]:~ # pkg search "^mysql"

下面安装mysql80版本:
[email protected]:~ # pkg install -y mysql80-server mysql80-client

运行MySQL
接下来你将运行下面的命令,这会将 MySQL 服务添加到 /etc/rc.conf配置文件中,并开机启动mysql。
[email protected]:~ # sysrc mysql_enable=yes mysql_enable: -> yes

启动mysql服务:
[email protected]:~ # service mysql-server start Starting mysql.
查看服务状态和mysql监听的端口:
[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 *:*

验证安装
要验证安装,您可以用 root 身份登录并使用以下命令检查数据库版本:
[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

总结
到目前MySQL 8 已安装并运行在 FreeBSD 13上了。
本文原创地址:如何在FreeBSD 13中安装MySQL数据库 | 《Linux就该这么学》编辑:逄增宝,审核员:逄增宝
边栏推荐
- [从零开始学习FPGA编程-44]:视野篇 - 集成电路助力数字化时代高质量发展-1-集成电路芯片主要形态
- STM32 key development foundation
- C#使用MySql进行操作
- 新库上线 | CnOpenData农产品批发价格数据
- Case: drawing Matplotlib dynamic graph
- Multiple interface calls, using promise all、Promise. Race and promise any
- The maze of God's perspective in robot vision
- Return value is object type method call equals()
- Handling of @charset UTF-8 warning problems during vite packaging and construction;
- 【花雕体验】11 上手ESP32C3
猜你喜欢

Multiple interface calls, using promise all、Promise. Race and promise any

在线小工具分享(不定时更新,当前数量:2)

The maze of God's perspective in robot vision

Installation and startup of redis

Data analysis slicer, PivotTable and PivotChart (necessary in the workplace)

Motor monitoring system based on MCGS and stm32

C#使用MySql进行操作

Digital circuit - adder

JS reverse case: cracking login password

QT cmake pure C code calls the system console to input scanf and Chinese output garbled code
随机推荐
手机卡开户的流程是什么?网上开户是否安全么?
同花顺上登录股票账户是安全的吗?同花顺上是如何开股票账户的
Development and monitoring of fusion experiment pulse power supply by LabVIEW
Optimized three-dimensional space positioning method and its fast implementation in C language
Web信息收集,互联网上的裸奔者
About the use of hc-12 radio frequency module
Idempotence of interfaces -- talk about idempotence of interfaces in detail, that is, solutions
Etcd database source code analysis cluster communication initialization
Implementation notes of least square fitting conic in stm32
从查询数据库性能优化谈到redis缓存-谈一谈缓存的穿透、雪崩、击穿
《产品思维30讲》精华及感想
I2C protocol
Unknown device ID does not appear on the STM32 st-link utility connection! Causes and Solutions
下载安装Flume
leetcode 300. Longest Increasing Subsequence 最长递增子序列 (中等)
FPGA notes -- implementation of FPGA floating point operation
【花雕体验】11 上手ESP32C3
Native DOM vs. virtual DOM
Motor monitoring system based on MCGS and stm32
Web information collection, naked runners on the Internet