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

Install Mariadb

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

Share

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

Based on Centos6 installation, Centos 7 can be installed directly using yum

First, prepare mysql groups and users:

Groupadd-r-g 306 mysql

Useradd-r-g mysql-u 306 mysql

Prepare the package:

Tar-xzvf mariadb-5.5.46-linux-x86_64.tar.gz-C/usr/local/ decompress

Ln-s / usr/local/mariadb-5.5.46-linux-x86_64//usr/local/mysql / / facilitates future version upgrades

3. Modify file permissions:

Cd / usr/local/mysql/

Chown-R root:mysql. / *

4. Initialize the database:

1. Create a directory to store database data

Mkdir-p / mydata/data

Chown mysql:mysql / mydata/data/ modify permissions

two。 Initialize the database

/ usr/local/mysql/scripts/mysql_install_db-user=mysql-basedir=/usr/local/mysql--datadir=/mydata/data/

/ / use your own script to initialize the database and specify the user and database storage path

Prepare the configuration file:

Mkdir / etc/mysql

Cp/usr/local/mysql/support-files/my-large.cnf / etc/mysql/my.cnf

Vim / etc/mysql/my.cnf

6. Add environment variables, etc.

Vim / etc/profile.d/mysqld.sh

Source / etc/profile.d/mysqld.sh

Echo'/ usr/local/mysql/lib/' > / etc/ld.so.conf.d/mysqld.conf

Ldconfig

Ln-s / usr/local/mysql/include/mysql/ / usr/include/mysqld

Echo 'MANPATH / usr/local/mysql/man/' > > / etc/man.config

7. Start the service:

Cp / usr/local/mysql/support-files/mysql.server / etc/rc.d/init.d/mysqld

/ / use the service script provided by the package

Chkconfig-add mysqld

Chkconfig mysqld on / / set boot up

Service mysqld start / / start the service

8. Security initialization:

/ usr/local/mysql/bin/mysql_secure_installation

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