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

Get to know the installation of 1--MariaDB for MariaDB

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Introduction of MariaDB

MariaDB is a relational database program redeveloped by the original author of Mysql after it was acquired by Oracle. Because it is the same author, it is very similar to Mysql in operation, and the versions correspond to each other. For example, MariaDB5.5 corresponds to version 5.5 of Mysql, but the corresponding MariaDB version becomes more than 10 from Mysql5.6, for example, MariaDB10.1 corresponds to Mysql5.6.

II. Introduction to the environment

MariaDB has three different installation methods: compilation and installation, rpm package installation, and using binaries. Taking MariaDB10.2.13,CentOS6.9 system as an example, this paper introduces compilation and installation.

Third, installation steps

1. Install cmake tools (abbreviated)

Later versions of Mysql5.5 use cmake instead of the original make compilation tool, and use the ccmake command under the source package directory to view the options available for compilation and installation

two。 Create a mysql account

Useradd-s / sbin/nologin-M mysql

3. Create an installation directory

Mkdir-pv / data

Chown-R mysql.mysql / data

4. Upload MariaDB source code and decompress the installation

Tar-xf mariadb-10.2.13.tar.gz-C / tmp/

Cd / tmp/mariadb-10.2.13/

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb-10.2.13\

-DMYSQL_DATADIR=/data\

-DMYSQL_UNIX_ADDR=/data/mysql.sock\

-DENABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITHOUT_PARTITION_STORAGE_ENGINE=1\

-DWITH_FAST_MUTEXES=1\

-DWITH_ZLIB=bundled\

-DENABLED_LOCAL_INFILE=1\

-DWITH_READLINE=1\

-DWITH_EMBEDDED_SERVER=1\

-DWITH_DEBUG=0

Make & & make install

Ln-sv / usr/local/mariadb-10.2.13 / usr/local/mysql

5. Initialize the database

Cd / usr/local/mysql/scripts

. / mysql_install_db-- basedir=/usr/local/mysql\

-- datadir=/data\

-- skip-name-resolve\

-- user=mysql\

-- skip-auth-anonymous-user

6. Add startup scripts and configuration files

Cd / usr/local/mysql/support-files

Cp mysql.server / etc/init.d/mysqld

Cp my-huge.cnf / etc/my.cnf

Chkconfig-add mysqld

7. Modify the configuration file to add two new items

Vim / etc/my.cnf

Skip-name-resolve = 1 # No name resolution at startup

Innodb_file_per_table = 1 # start independent tablespace

8. Export environment variabl

Vim / etc/profile.d/mysqld

Export PATH=/usr/local/mysql/bin:$PATH

Source / etc/profile.d/mysql

At this point, the installation is complete and the service is started using service mysqld start

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