리눅스 MariaDB yum 설치
테스트 환경:
CentOS release 6.5 (Final)
2.6.32-431.3.1.el6.x86_64 x86_64
설치 되어 있는지 체크
rpm -qa | grep MariaDB
repo 설정
vi /etc/yum.repos.d/MariaDB.repo
아래 내용 추가
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
설치
yum install MariaDB-server MariaDB-client
설치되었는지 확인
rpm -qa | grep MariaDB
MariaDB-compat-10.0.12-1.el6.x86_64
MariaDB-common-10.0.12-1.el6.x86_64
MariaDB-client-10.0.12-1.el6.x86_64
MariaDB-common-10.0.12-1.el6.x86_64
MariaDB-client-10.0.12-1.el6.x86_64
mysql -V
mysql Ver 15.1 Distrib 10.0.12-MariaDB, for Linux (x86_64) using readline 5.1
mysql Ver 15.1 Distrib 10.0.12-MariaDB, for Linux (x86_64) using readline 5.1
netstat -anl | grep mysql
unix 2 [ ACC ] STREAM LISTENING 9844 /var/lib/mysql/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 9844 /var/lib/mysql/mysql.sock
netstat -anp | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1305/mysqld
[root@localhost ~]# lsof -p 1305
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 1305 mysql cwd DIR 8,2 4096 266389 /var/lib/mysql
mysqld 1305 mysql rtd DIR 8,2 4096 2 /
mysqld 1305 mysql txt REG 8,2 8093960 1054309 /usr/libexec/mysqld
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1305/mysqld
[root@localhost ~]# lsof -p 1305
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 1305 mysql cwd DIR 8,2 4096 266389 /var/lib/mysql
mysqld 1305 mysql rtd DIR 8,2 4096 2 /
mysqld 1305 mysql txt REG 8,2 8093960 1054309 /usr/libexec/mysqld
디비를 시작해 보자
service mysqld start
패스워드 변경
mysqld_safe --skip-grant-tables --skip-networking
mysql
MySQL [(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
MySQL [mysql]> update user set password=password('1') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
MySQL [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
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
MySQL [mysql]> update user set password=password('1') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
MySQL [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
접속 확인
service mysqld stop
service mysqld start
Starting mysqld: [ OK ]
Starting mysqld: [ OK ]
mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
use mysql;