Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MySQL database in FreeBSD13

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to install MySQL database in FreeBSD13". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

MySQL is an open source small relational database management system. At present, MySQL is widely used in small and medium-sized websites on Internet. Because of its small size, high speed and low total cost of ownership, especially open source, many small and medium-sized websites choose MySQL as the website database in order to reduce the total cost of ownership.

Environment

FreeBSD 13-RELEASE

Modify pkg source

You need to create the / usr/local/etc/pkg/repos directory, then create the FreeBSD.conf configuration file, turn off the default source, and then add the domestic software source.

Root@freebsd:~ # mkdir-p / usr/local/etc/pkg/reposroot@freebsd:~ # vi / usr/local/etc/pkg/repos/FreeBSD.confFreeBSD: {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}

Update the pkg source:

Root@freebsd:~ # pkg update-fUpdating ustc repository catalogue...Fetching meta.txz: 100916B 0.9kB/s 00:01 Fetching packagesite.txz: 1006MiB 6.5MB/s 00:01 Processing entries: 100%ustc repository update completed. 30371 packages processed.All repositories are up to date. Install the MySQL database

Search for which versions of mysql are available in the pkg source:

Root@freebsd:~ # pkg search "^ mysql"

Install the mysql80 version below:

Root@freebsd:~ # pkg install-y mysql80-server mysql80-client runs MySQL

Next you will run the following command, which will add the MySQL service to the / etc/rc.conf configuration file and boot up and start mysql.

Root@freebsd:~ # sysrc mysql_enable=yesmysql_enable:-> yes

Start the mysql service:

Root@freebsd:~ # service mysql-server startStarting mysql.

View the status of the service and the port on which mysql is listening:

Root@freebsd:~ # service mysql-server statusmysql is running as pid 2194. Rootless FreeBSD 4lUSER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS mysql mysqld ~ # sockstat-4lUSER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS mysql mysqld 2194 19 tcp46 *: 33060 *: * mysql mysqld 2194 24 tcp4 127.0.0.1 sockstat 3306 *: * root sshd 8024 tcp4 *: 22 *: * root Sendmail 781 3 tcp4 127.0.0.1 udp4 25 *: * root syslogd 709 7 udp4 *: 514 *: * verify the installation

To verify the installation, you can log in as root and check the database version using the following command:

Root@freebsd:~ # mysqladmin-u root-p versionEnter 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Server version 8.0.25Protocol version 10Connection Localhost via UNIX socketUNIX socket / tmp/mysql.sockUptime: 4 min 16 secThreads: 2 Questions: 6 Slow queries: 0 Opens: 138Flush tables: 3 Open tables: 54 Queries per second avg: 0.023 "how to install MySQL database in FreeBSD13", thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report