APM설치(3) - 우분투 서버에 mariaDB 설치하기
[MariaDB 설치] #apt-get install mariadb-server 우분투 16.04 버젼에는 MariaDB 10.0.24 이 기본 설치됩니다.
데이터베이스 설정및 초기화 작업입니다. # /usr/bin/mysql_secure_installation 위 화면 처럼 mysql root 비밀번호만 설정을 하고 나머지는 모두 엔터로 끝냅니다. 여기서는 비밀번호로 1234로 합니다.
[사용자 접속권한 설정] 
root@test-host:~# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 50 Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others
Type help; or h for help. Type c to clear the current input nt.
MariaDB [(none)]> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed MariaDB [mysql]> select host, user, password from user; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | *A4B6157319038724E3560894F7F932C8886EBFCF | +-----------+------+-------------------------------------------+ 1 row in set (0.00 sec)
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@%; Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@::1; Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@127.0.0.1; Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> update mysql.user set password = password(1234) er = root; Query OK, 3 rows affected (0.01 sec) Rows matched: 4 Changed: 3 Warnings: 0
MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> select host, user, password from user; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | *A4B6157319038724E3560894F7F932C8886EBFCF | | % | root | *A4B6157319038724E3560894F7F932C8886EBFCF | | ::1 | root | *A4B6157319038724E3560894F7F932C8886EBFCF | | 127.0.0.1 | root | *A4B6157319038724E3560894F7F932C8886EBFCF | +-----------+------+-------------------------------------------+ 4 rows in set (0.00 sec)
[DB 연동모듈 설치] php와 mysql의 DB 연동모듈 설치해야 합니다. # apt-get install php-mysql
[MYSQL 콘솔 클라이언트 버전체크] ~# mysql -V mysql Ver 15.1 Distrib 10.0.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
[mysql 설정] vi /etc/mysql/mariadb.conf.d/50-server.cnf [mysqld]로 된 항목 하단에아래 내용을 기재합니다. character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci [mysql 재시작] root@old-host:~# service mysql restart |