install mariadb on ubuntu 17.10
MariaDB
https://mariadb.org/download/ 에서 repository configuration tool 을 사용해보라고 나온다.
- Choose a Distro 에서 Ubuntu 선택하고,
- Choose a Release 에서 17.10 “artful” 선택하고,
- Choose a Version 에서 10.2 [Stable] 선택하고,
- Choose a Mirror 에서 KAIST File Archive 선택하면.
다음과 같이 어떻게 하라고 나온다.
Here are the commands to run to install MariaDB on your Ubuntu system:
sudo apt-get install software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386] http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful main'
Once the key is imported and the repository added you can install MariaDB with:
sudo apt update sudo apt install mariadb-server
See Installing MariaDB .deb Files for more information and for instructions on installing MariaDB Galera Cluster.
You can also create a custom MariaDB sources.list file. To do so, after importing the signing key as outlined above, copy and paste the following into a file under /etc/apt/sources.list.d/(we suggest naming the file MariaDB.list or something similar), or add it to the bottom of your /etc/apt/sources.list file.
# MariaDB 10.2 repository list - created 2018-11-26 01:06 UTC # http://downloads.mariadb.org/mariadb/repositories/ deb [arch=amd64,i386] http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful main deb-src http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful main
그래서 다음과 같이 실행해보았음.
jinia@jin:~$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
software-properties-common is already the newest version (0.96.24.17).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
jinia@jin:~$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Executing: /tmp/apt-key-gpghome.XlYfkDcRuE/gpg.1.sh --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
gpg: key F1656F24C74CD1D8: public key "MariaDB Signing Key <signing-key@mariadb.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
jinia@jin:~$ sudo add-apt-repository 'deb [arch=amd64,i386] http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful main'
jinia@jin:~$ sudo apt update
Hit:1 http://kr.archive.ubuntu.com/ubuntu artful InRelease
Get:2 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful InRelease [3,131 B]
Hit:3 http://kr.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:4 http://kr.archive.ubuntu.com/ubuntu artful-backports InRelease
Ign:5 https://deb.nodesource.com/node_8.x artful InRelease
Err:6 https://deb.nodesource.com/node_8.x artful Release
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 52.85.192.110 443]
Get:7 http://packages.microsoft.com/repos/vscode stable InRelease [2,802 B]
Ign:8 http://dl.google.com/linux/chrome/deb stable InRelease
Get:9 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 Packages [7,536 B]
Get:10 http://dl.google.com/linux/chrome/deb stable Release [943 B]
Hit:11 http://security.ubuntu.com/ubuntu artful-security InRelease
Get:12 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Get:13 http://packages.microsoft.com/repos/vscode stable/main amd64 Packages [79.7 kB]
E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
Do you want to accept these changes and continue updating from this repository? [y/N] Y
Get:14 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main i386 Packages [7,051 B]
Get:15 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,128 B]
Reading package lists... Done
E: The repository 'https://deb.nodesource.com/node_8.x artful Release' no longer has a Release file.
N: Updating from such a repository can''t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
jinia@jin:~$ sudo apt install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
galera-3 libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libterm-readkey-perl mariadb-client-10.2 mariadb-client-core-10.2 mariadb-common mariadb-server-10.2
mariadb-server-core-10.2 socat
Suggested packages:
libmldbm-perl libnet-daemon-perl libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test tinyca
The following NEW packages will be installed:
galera-3 libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libterm-readkey-perl mariadb-client-10.2 mariadb-client-core-10.2 mariadb-common mariadb-server mariadb-server-10.2
mariadb-server-core-10.2 socat
0 upgraded, 13 newly installed, 0 to remove and 2 not upgraded.
Need to get 21.1 MB of archives.
After this operation, 180 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-common all 10.2.16+maria~artful [3,324 B]
Get:2 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 galera-3 amd64 25.3.23-artful [8,212 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu artful/main amd64 libdbi-perl amd64 1.637-1 [720 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu artful/main amd64 libaio1 amd64 0.3.110-4 [6,398 B]
Get:5 http://kr.archive.ubuntu.com/ubuntu artful/universe amd64 socat amd64 1.7.3.2-1 [342 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu artful/universe amd64 libdbd-mysql-perl amd64 4.041-2build1 [79.7 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu artful/main amd64 libhtml-template-perl all 2.95-2 [60.4 kB]
Get:8 http://kr.archive.ubuntu.com/ubuntu artful/universe amd64 libterm-readkey-perl amd64 2.37-1build1 [24.4 kB]
Get:9 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-client-core-10.2 amd64 10.2.16+maria~artful [753 kB]
Get:10 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-client-10.2 amd64 10.2.16+maria~artful [1,131 kB]
Get:11 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-server-core-10.2 amd64 10.2.16+maria~artful [5,497 kB]
Get:12 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-server-10.2 amd64 10.2.16+maria~artful [4,221 kB]
Get:13 http://ftp.kaist.ac.kr/mariadb/repo/10.2/ubuntu artful/main amd64 mariadb-server all 10.2.16+maria~artful [2,966 B]
Fetched 21.1 MB in 5s (3,652 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mariadb-common.
(Reading database ... 201828 files and directories currently installed.)
Preparing to unpack .../0-mariadb-common_10.2.16+maria~artful_all.deb ...
Unpacking mariadb-common (10.2.16+maria~artful) ...
Selecting previously unselected package galera-3.
Preparing to unpack .../1-galera-3_25.3.23-artful_amd64.deb ...
Unpacking galera-3 (25.3.23-artful) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../2-libdbi-perl_1.637-1_amd64.deb ...
Unpacking libdbi-perl (1.637-1) ...
Selecting previously unselected package mariadb-client-core-10.2.
Preparing to unpack .../3-mariadb-client-core-10.2_10.2.16+maria~artful_amd64.deb ...
Unpacking mariadb-client-core-10.2 (10.2.16+maria~artful) ...
Selecting previously unselected package mariadb-client-10.2.
Preparing to unpack .../4-mariadb-client-10.2_10.2.16+maria~artful_amd64.deb ...
Unpacking mariadb-client-10.2 (10.2.16+maria~artful) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../5-libaio1_0.3.110-4_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-4) ...
Selecting previously unselected package mariadb-server-core-10.2.
Preparing to unpack .../6-mariadb-server-core-10.2_10.2.16+maria~artful_amd64.deb ...
Unpacking mariadb-server-core-10.2 (10.2.16+maria~artful) ...
Selecting previously unselected package socat.
Preparing to unpack .../7-socat_1.7.3.2-1_amd64.deb ...
Unpacking socat (1.7.3.2-1) ...
Setting up mariadb-common (10.2.16+maria~artful) ...
Selecting previously unselected package mariadb-server-10.2.
(Reading database ... 202168 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.2_10.2.16+maria~artful_amd64.deb ...
Unpacking mariadb-server-10.2 (10.2.16+maria~artful) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.041-2build1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.041-2build1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-2_all.deb ...
Unpacking libhtml-template-perl (2.95-2) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.37-1build1_amd64.deb ...
Unpacking libterm-readkey-perl (2.37-1build1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_10.2.16+maria~artful_all.deb ...
Unpacking mariadb-server (10.2.16+maria~artful) ...
Setting up libhtml-template-perl (2.95-2) ...
Processing triggers for ureadahead (0.100.0-20) ...
ureadahead will be reprofiled on next reboot
Setting up socat (1.7.3.2-1) ...
Setting up libterm-readkey-perl (2.37-1build1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
Setting up libaio1:amd64 (0.3.110-4) ...
Setting up galera-3 (25.3.23-artful) ...
Processing triggers for systemd (234-2ubuntu12.4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up mariadb-server-core-10.2 (10.2.16+maria~artful) ...
Setting up libdbi-perl (1.637-1) ...
Setting up mariadb-client-core-10.2 (10.2.16+maria~artful) ...
Setting up mariadb-client-10.2 (10.2.16+maria~artful) ...
Setting up mariadb-server-10.2 (10.2.16+maria~artful) ...
2018-11-26 10:13:11 140129259567296 [Note] /usr/sbin/mysqld (mysqld 10.2.16-MariaDB-10.2.16+maria~artful) starting as process 9409 ...
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Uses event mutexes
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Compressed tables use zlib 1.2.11
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Using Linux native AIO
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Number of pools: 1
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Using SSE2 crc32 instructions
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Completed initialization of buffer pool
2018-11-26 10:13:11 140128714610432 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Highest supported file format is Barracuda.
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: Waiting for purge to start
2018-11-26 10:13:11 140129259567296 [Note] InnoDB: 5.7.22 started; log sequence number 1619987
2018-11-26 10:13:11 140128072759040 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-11-26 10:13:11 140128072759040 [Note] InnoDB: Buffer pool(s) load completed at 181126 10:13:11
2018-11-26 10:13:11 140129259567296 [Note] Plugin 'FEEDBACK' is disabled.
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
Setting up mariadb-server (10.2.16+maria~artful) ...
Setting up libdbd-mysql-perl (4.041-2build1) ...
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
Processing triggers for systemd (234-2ubuntu12.4) ...
Processing triggers for ureadahead (0.100.0-20) ...
jinia@jin:~$
systemctl 이 뭔지 모르겠으나, enable 하고.. status로 상태보면 됨. mysql -u root -p 로 연결하면 되고.
jinia@jin:~$ systemctl enable mariadb
jinia@jin:~$ systemctl status mariadb
● mariadb.service - MariaDB 10.2.16 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Mon 2018-11-26 10:13:17 KST; 1h 3min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 9656 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 31 (limit: 4915)
Memory: 65.7M
CPU: 5.660s
CGroup: /system.slice/mariadb.service
└─9656 /usr/sbin/mysqld
Nov 26 10:13:17 jin mysqld[9656]: 2018-11-26 10:13:17 140438970464448 [Note] Server socket created on IP: '::'.
Nov 26 10:13:17 jin mysqld[9656]: 2018-11-26 10:13:17 140438970464448 [Note] Reading of all Master_info entries succeded
Nov 26 10:13:17 jin mysqld[9656]: 2018-11-26 10:13:17 140438970464448 [Note] Added new Master_info '' to hash table
Nov 26 10:13:17 jin mysqld[9656]: 2018-11-26 10:13:17 140438970464448 [Note] /usr/sbin/mysqld: ready for connections.
Nov 26 10:13:17 jin mysqld[9656]: Version: '10.2.16-MariaDB-10.2.16+maria~artful' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Nov 26 10:13:17 jin systemd[1]: Started MariaDB 10.2.16 database server.
jinia@jin:~$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.2.16-MariaDB-10.2.16+maria~artful mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
원격 연결을 위해서는 mysqld 부분에 bind-address 추가했고.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' identified by 'password' WITH GRANT OPTION
실행하고.
jinia@jin:~$ cat /etc/mysql/conf.d/mariadb.cnf
#중략
[mysqld]
bind-address = 0.0.0.0
#중략
jinia@jin:~$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.16-MariaDB-10.2.16+maria~artful mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' identified by 'password' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
한글깨짐은 다음 2개 파일을 수정했음.
- /etc/mysql/conf.d/mariadb.cnf
- /etc/mysql/conf.d/mysql.cnf
jinia@jin:~$ cat /etc/mysql/conf.d/mariadb.cnf
# MariaDB-specific config file.
# Read by /etc/mysql/my.cnf
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8
[mysqld]
bind-address = 0.0.0.0
#
# * Character sets
#
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#
init_connect="SET collation_connection=utf8_general_ci"
init_connect="SET NAMES utf8"
character-set-server = utf8
collation-server = utf8_general_ci
character_set_server = utf8
collation_server = utf8_general_ci
# Import all .cnf files from configuration directory
!includedir /etc/mysql/mariadb.conf.d/
jinia@jin:~$ cat /etc/mysql/conf.d/mysql.cnf
[mysql]
default-character-set=utf8
jinia@jin:~$
변경 후에는 restart 를 하면 되는듯함.
- systemctl enable mariadb
- systemctl status mariadb
- systemctl restart mariadb
HeidiSQL
DB Client 프로그램.
참고
https://mariadb.com/kb/en/library/configuring-mariadb-for-remote-client-access/