MariaDB는 mysql 의 Clone DB로 mysql과 거의 동일하다 10.3.x 버전부터는 Mysql과 다른 길을 걷고 있기 때문에 10.3.x 버전부터는 적용시 검토가 필요하다.
여기서는 stable 버전중에 mysql 5.7과 호환이 가능한 10.2.26 버전을 설치해본다.
1,.파일다운로드 페이지
https://downloads.mariadb.org/mariadb/10.2.26/
2. 설치 파일 선택(현재 OS는 CentOS 6.10)
mariadb-10.2.26-linux-systemd-x86_64.tar.gz -> CentOS 7 이상 설치x
mariadb-10.2.26-linux-glibc_214-x86_64.tar.gz (requires GLIBC_2.14+)
[mysql@test-db ~]$ getconf -a | grep libc |
--> 2.14보다 아래라서 설치x
mariadb-10.2.26-linux-x86_64.tar.gz --> 설치가능O
3. Mariadb-10.2.26 설치
-- 초기설정은 Mysql 5.7과 같다 다른부분만 기술한다.
#권한su [root@testdb]# /home/mysql/mariadb/bin/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb_data
#Trouble shooting 1) 뭐냐 왜 안돼냐..my.cnf 돌려쓰기 실패.. By default, until MariaDB 10.1, MariaDB uses the XtraDB storage engine, a performance enhanced fork of the InnoDB storage engine. For compatibility reasons, the system variables still retain their original innodb prefixes, and where the text in this knowledge base refers to InnoDB, it can usually be understood as referring to the XtraDB fork.
#my.cnf 수정후 다시 설치해본다. [root@testdb]# ./mysql_install_db --user=mysql --defaults-file=/etc/my.cnf --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb_data
Installing MariaDB/MySQL system tables in '/data/svc/mariadb_data' ... To start mysqld at boot time you have to copy PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! '/data/svc/mariadb/bin/mysqladmin' -u root password 'new-password' Alternatively you can run: which will also give you the option of removing the test See the MariaDB Knowledgebase at http://mariadb.com/kb or the You can start the MariaDB daemon with: You can test the MariaDB daemon with mysql-test-run.pl Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/.
[root@testdb]# # 잘된다ㅎㅎ
#시작 스크립트 작성
[root@testdb]# service mysqld start Starting MariaDB.180521 16:16:34 mysqld_safe Logging to '/home/mysql/mariadb_logs/error/mysql.err'.180521 16:16:34 mysqld_safe Starting mysqld daemon with databases from /home/mysql/mariadb_data .. [ OK ]
#보안설정 [root@testdb]# cd /home/mysql/mariadb/bin [root@testdb]# ./mysql_secure_installation --basedir=/home/mysql/mariadb
print: /home/mysql/mariadb/bin/my_print_defaults NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB In order to log into MariaDB to secure it, we'll need the current Enter current password for root (enter for none): Setting the root password ensures that nobody can log into the MariaDB Set root password? [Y/n] y Remove anonymous users? [Y/n] y Normally, root should only be allowed to connect from 'localhost'. This Disallow root login remotely? [Y/n] y By default, MariaDB comes with a database named 'test' that anyone can Remove test database and access to it? [Y/n] y Reloading the privilege tables will ensure that all changes made so far Reload privilege tables now? [Y/n] y Cleaning up... All done! If you've completed all of the above steps, your MariaDB Thanks for using MariaDB!
[root@testdb]# cd /home/mysql/mariadb/bin
[root@testdb]# service mysqld stop
#mysql 계정으로 접속 [mysql@testdb]# service mysqld start
#쉘 접속확인 [mysql@testdb]# mysql -uroot -p
|
'RDB > mariadb' 카테고리의 다른 글
MariaDB 10.4.13 mysql계정으로 stop 안되는 현상 해결 (0) | 2020.10.22 |
---|---|
[튜닝] MariaDB where 조건절에 OR 연산인데 빠르게 가능할까? (0) | 2020.10.17 |
xtrabackup 백업 & 압축관련 검토(pigz) (0) | 2020.04.17 |
xtrabackup 장애사례 (0) | 2019.11.26 |
mariadb 10.2.x 이 프로세스 뭐냐? (0) | 2019.10.17 |