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 compile and install mysql5.5 in FreeBSD

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to compile and install mysql5.5 in FreeBSD, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

If you don't have cmake installed on your system, first of all, cmake's package, cmake-2.8.5.tar.gz, is attached.

Tar zxvf cmake-2.8.5.tar.gz

Cd cmake-2.8.5

. / configure

Make&&make install

After ensuring that the system has cmake installed, you can move on.

The specific steps are as follows

1. Copy mysql source package mysql-5.5.11.tar.gz to your system

Tar zxvf mysql-5.5.11.tar.gz

Cd mysql-5.5.11

two。 Configure mysql5.5 compilation parameters

Ccmake. / / use ccmake to edit configuration parameters, or use cmake. -option to configure; use ccmake. As shown in the figure below, the configuration interface is more convenient, but there are fewer configurable projects.

Use cmake. -option has many options. Some commonly used parameter options are listed below:

-DCMAKE_INSTALL_PREFIX=dir_name / / mysql installation path

-DMYSQL_DATADIR=dir_name / / mysql path

-DWITH_INNOBASE_STORAGE_ENGINE=1

-DWITH_ARCHIVE_STORAGE_ENGINE=1

-DWITH_BLACKHOLE_STORAGE_ENGINE=1

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 / / Storage engine to be installed

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 / / mysql storage engine that is not installed

-DMYSQL_TCP_PORT=port_num / / specify the listening port of mysql

-default characters for DDEFAULT_CHARSET=charset_name / / mysql

Extended characters of-DWITH_EXTRA_CHARSETS=name / / mysql

The above is just a list of some of the most commonly used options. For detailed parameters, you can check the INSTALL-SOURCE file in the source code package. Here is an example of a configuration:

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5-DWITH_INNOBASE_STORAGE_ENGINE=1-DDEFAULT_CHARSET=gbk-DDEFAULT_COLLATION=gbk_chinese_ci-DWITH_EXTRA_CHARSETS=ALL

Note: when configuring,-DDEFAULT_COLLATION=gbk_chinese_ci indicates that the default character set of mysql is gbk_chinese_ci,-DDEFAULT_CHARSET=gbk, which means that the default character is gbk, and both must be configured at the same time, otherwise an error will be reported when initializing the database, indicating that the character set cannot be found. When the configuration is complete, you can use cmake. -LH to check your configuration information, and if you have a problem, you can use cmake. -option to change, which is not available in previous mysql versions to configure mysql compilation parameters using. / configure.

3. Make & & make install / / compile and install mysql. You can clearly feel that this process is much faster than before mysql5.5.

4. Adduser / / create mysql users, create users in freeDSB, and then use adduser to create interactive user creation settings.

5. Cp / usr/local/mysql5.5/support-files/my-large.cnf / etc/my.cnf / / copy the configuration file template. There are five configuration file templates: my-huge.cnf, my-innodb-heavy-4G.cnf, my-large.cnf, my-medium.cnf and my-small.cnf in the support-files folder. You can choose the appropriate configuration file template according to the memory of your system.

6. Chown-R mysql / usr/local/mysql5.5

Chgrp-R mysql / usr/local/mysql5.5/data / / set directory permissions

7. / usr/local/mysql5.5/scripts/mysql_install_db-user=mysql / / when initializing the database, the following error occurs. So when initializing the database, you need to specify the path of mysql and the path of mysql data.

Example: / usr/local/mysql5.5/scripts/mysql_install_db-basedir=/usr/local/mysql5.5-datadir=/usr/local/mysql5.5/data-user=mysql

8. / usr/local/mysql5.5/bin/mysqld_safe-user=mysql& / / start the mysql server

9. / usr/local/mysql5.5/bin/mysql / / Connect to the mysql server

This is the answer to the question about how to compile and install mysql5.5 in FreeBSD. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.

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

Database

Wechat

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

12
Report