In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you the "CentOS 6.6 how to compile and install MariaDB-10.0.24", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "CentOS 6.6 how to compile and install MariaDB-10.0.24" this article.
System environment: CentOS 6.7 (Final)
MariaDB port: 3309 (because this machine already has MySQL installed, I don't want to delete MySQL)
# wget http://mariadb.nethub.com.hk//mariadb-10.0.20/source/mariadb-10.0.20.tar.gz
# wget-O http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.0.24/source/mariadb-10.0.24.tar.gz
Establish mariadb user
# groupadd-r mariadb
# useradd-g mariadb-r-M-s / sbin/nologin mariadb / / prohibit mariadb users from logging in locally
Dependent component
# yum-y install gcc gcc-c++ make cmake ncurses ncurses-devel libxml2 libxml2-devel openssl-devel bison bison-devel
# tar-zxvf mariadb-10.0.24.tar.gz
# cd mariadb-10.0.24
# cmake. -DMYSQL_UNIX_ADDR=/tmp/mariadb.sock-DSYSCONFDIR=/usr/local/mariadb-DMYSQL_TCP_PORT=3309-DEXTRA_CHARSETS=all-DMYSQL_USER=mariadb-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb-DMYSQL_DATADIR=/data/mariadb-DWITH_XTRADB_STORAGE_ENGINE=1-DWITH_FEDERATEDX_STORAGE_ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_ARCHIVE_STPRAGE_ENGINE=1-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWIYH_READLINE=1-DWIYH_SSL=system-DVITH _ ZLIB=system-DWITH_LOBWRAP=0-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci
# make-j 4 & & make install
Add the MariaDB service to the system environment variable: add the following line at the end
# vim / etc/profile
Export PATH=/usr/local/mariadb/bin:$PATH
# source / etc/profile
Copy Profil
# cp / usr/local/mariadb/support-files/my-large.cnf / usr/local/mariadb/my.cnf
Initialize the database
# / usr/local/mariadb/scripts/mysql_install_db-basedir=/usr/local/mariadb-datadir=/data/mariadb-user=mariadb-defaults-file=/usr/local/mariadb/my.cnf
Replication service startup script
# cp / usr/local/mariadb/support-files/mysql.server / etc/init.d/mariadb
# vim / etc/init.d/mariadb
find
$bindir/mysqld_safe-datadir= "$datadir"-pid-file= "$mysqld_pid_file_path" $other_args > / dev/null 2 > & 1 &
OK, change to:
$bindir/mysqld_safe-defaults-file=/usr/local/mariadb/my.cnf-datadir= "$datadir"-- pid-file= "$mysqld_pid_file_path" $other_args > / dev/null 2 > & 1 &
That is, add-- defaults-file=/usr/local/mariadb/my.cnf
: wq
# chmod + x / etc/init.d/mariadb
# chkconfig mariadb on
Configuration / usr/local/mariadb/my.cnf
Add the following lines to the [mysqld] module:
Log-error = / usr/local/mariadb/logs/mariadb_error.log
Pid-file = / usr/local/mariadb/mariadb.pid
User=mariadb
Datadir = / data/mariadb
Basedir = / usr/local/mariadb
Newly added mysqld_safe block
[mysqld_safe]
Log-error = / usr/local/mariadb/logs/mariadb_error.log
Pid-file = / usr/local/mariadb/mariadb.pid
Modify directory permissions before startup
# chown-R mariadb:mariadb / data/mariadb
# chown-R mariadb:mariadb / data/mariadb/.
# chown-R mariadb:mariadb / usr/local/mariadb
# chown-R mariadb:mariadb / usr/local/mariadb/.
Start MariaDB:
# / etc/init.d/mariadb start
Note: if the startup fails, check the / usr/local/mariadb/logs/mariadb_error.log file to see what is wrong and correct it.
Set the password for root
# / usr/local/mariadb/bin/mysqladmin-u root password '123456'
Enter the shell of MariaDB
[root@localhost mariadb] # / usr/local/mariadb/bin/mysql-u root-p
Enter password:
Welcome to the MariaDB monitor. Commands end with; or\ g.
Your MariaDB connection id is 4
Server version: 10.0.24-MariaDB Source distribution
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
MariaDB [(none)] > show engines\ G
* * 1. Row *
Engine: InnoDB
Support: DEFAULT
Comment: Percona-XtraDB, Supports transactions, row-level locking, and foreign keys
Transactions: YES
XA: YES
Savepoints: YES
* 2. Row * *
Engine: MRG_MyISAM
Support: YES
Comment: Collection of identical MyISAM tables
Transactions: NO
XA: NO
Savepoints: NO
* 3. Row * *
Engine: CSV
Support: YES
Comment: CSV storage engine
Transactions: NO
XA: NO
Savepoints: NO
* * 4. Row *
Engine: BLACKHOLE
Support: YES
Comment: / dev/null storage engine (anything you write to it disappears)
Transactions: NO
XA: NO
Savepoints: NO
* * 5. Row * *
Engine: MyISAM
Support: YES
Comment: MyISAM storage engine
Transactions: NO
XA: NO
Savepoints: NO
* 6. Row * *
Engine: MEMORY
Support: YES
Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
XA: NO
Savepoints: NO
* 7. Row * *
Engine: ARCHIVE
Support: YES
Comment: Archive storage engine
Transactions: NO
XA: NO
Savepoints: NO
* * 8. Row *
Engine: PERFORMANCE_SCHEMA
Support: YES
Comment: Performance Schema
Transactions: NO
XA: NO
Savepoints: NO
* 9. Row * *
Engine: FEDERATED
Support: YES
Comment: FederatedX pluggable storage engine
Transactions: YES
XA: NO
Savepoints: YES
* 10. Row * *
Engine: Aria
Support: YES
Comment: Crash-safe tables with MyISAM heritage
Transactions: NO
XA: NO
Savepoints: NO
10 rows in set (0.00 sec)
ERROR: No query specified
MariaDB [mysql] > use mysql; / / Select system database mysql
MariaDB [mysql] > select Host,User,Password from user; / / View all users
MariaDB [mysql] > delete from user where password= ""
MariaDB [mysql] > GRANT ALL PRIVILEGES ON *. * TO root@ "%" IDENTIFIED BY '123456permissions; / / add remote connection permissions for root
MariaDB [mysql] > flush privileges
MariaDB [mysql] > select Host,User,Password from user; / / confirm whether all users with empty passwords have been deleted
MariaDB [mysql] > exit
Set up a firewall so that other servers in the local area network can access it
# vim / etc/sysconfig/iptables
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 3309-j ACCEPT
# / etc/init.d/iptables save
# / etc/init.d/iptables restart
These are all the contents of the article "how to compile and install MariaDB-10.0.24 under CentOS 6.6". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.