In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Foreword:
Mariadb offers packages in three different formats on its official website: source package, package manager, and binary, as shown below. Binary version is compiled by the official version of the green version, compared to the source package version of the installation is easier, compared to the package manager version and a little more freedom, is a compromise between the two. Also note that it depends on glibc, which version you need to pay attention to.
Installation:
Step 1:
First confirm the glibc version, you can see that CentOS-6 installed glibc-2.12 version, so you need to download
# rpm -q glibcglibc-2.12-1.166.el6.x86_64
Step 2:
Close iptables and SElinux
Step 3:
#Create system user mysql
# useradd -r mysql
#Extract to directory/usr/local/
# tar -xf mariadb-5.5.43-linux-x86_64.tar.gz -C /usr/local/
#Create soft links mysql
# cd /usr/local/# ln -sv mariadb-5.5.43-linux-x86_64/ mysql"mysql" -> "mariadb-5.5.43-linux-x86_64/"
#Modify directory owners and groups
# chown -R root:mysql .
#Create database directory. If you do not create and specify it separately, the data directory under the current directory will be used as the database directory by default.
# mkdir -pv /data/mysqlmkdir: created directory `/data'mkdir: created directory `/data/mysql'
#Change the owner and group of the database directory to mysql
# chown -R mysql:mysql /data/mysql/
#Install Database
# scripts/mysql_install_db --user=mysql --datadir=/data/mysql
configured
#Import bin directory path into PATH environment variable
# vim /etc/profile.d/mysql.shexport PATH=/usr/local/mysql/bin:$PATH
#Effective immediately
# exec bash
#Create header file symbolic links
# cd /usr/local/include/# ln -s ../ mysql/include/mysql/ mysql
#Import man path into system man manual
# vim /etc/man.configMANPATH /usr/local/mysql/man
#Copy service scripts to/etc/rc.d/init.d directory
# cd /usr/local/mysql# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
#Copy template configuration files to/etc/directory
# cp support-files/my-large.cnf /etc/my.cnf
#Modify configuration file
# vim /etc/my.cnf
Character Set:
mysqld for the server, mysql for the local CLI command line tools, client for the client connection tools, including remote connection tools. The character set needs to be uniformly set to utf-8, and modified to other character sets according to the actual situation in special scenarios.
[client]default-charater-set=utf8[mysql]default-charater-set=utf8[mysqld]character-set-server=utf8
Character sorting:
[mysqld]collation-server=utf8_general_ci
database directory
[mysqld]datadir=/data/mysql
storage engine
[mysqld]#Default uses innodb storage engine default-storage-engine=InnoDB#Use separate tablespaces for each table innodb-file-per-table=TRUE
Close domain name resolution
skip-name-resolve=TRUE
This is what it should look like when it's configured.
[client]port = 3306socket = /tmp/mysql.sockdefault-character-set=utf8[mysqld]datadir=/data/mysqlport = 3306socket = /tmp/mysql.sockskip-external-lockingkey_buffer_size = 256Mmax_allowed_packet = 1Mtable_open_cache = 256sort_buffer_size = 1Mread_buffer_size = 1Mread_rnd_buffer_size = 4Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8query_cache_size= 16Mthread_concurrency = 8character-set-server=utf8collation-server=utf8_general_cidefault-storage-engine=InnoDBinnodb-file-per-table=TRUEskip-name-resolve=TRUElog-bin=mysql-binskip-name-resolve=TRUElog-bin=mysql-binbinlog_format=mixedserver-id = 1[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehashdefault-character-set=utf8[myisamchk]key_buffer_size = 128Msort_buffer_size = 128Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout
start the service
/etc/init.d/mysqld start
start automatically when the system
chkconfig --add mysqldchkconfig mysqld on
security settings
# mysql_secure_installation /usr/local/mysql/bin/mysql_secure_installation: line 379: find_mysql_client: command not foundNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.# Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.# Set root password? [Y/n] n ... skipping.By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.# Remove anonymous users? [Y/n] n ... skipping.Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.# Disallow root login remotely? [Y/n] n ... skipping.By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.# Remove test database and access to it? [Y/n] n ... skipping.Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.# Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.