1.建立/etc/yum.repos.d/mariadb.repo檔案,這裡用到了剛剛發布正式版的10.0
[mariadb]
name = mariadb
baseurl =
gpgkey=
gpgcheck=1
2.準備好repo檔案後可以使用yum來安裝了
# yum install mariadb-server mariadb-client
3.我喜歡自定義資料目錄和服務埠,所以移除預設的資料目錄
# rm -rf /var/lib/mysql
4.建立新的資料目錄
# mkdir /var/data/db/mariadb
5.修改配置檔案/etc/my.cnf.d/mysql-clients.cnf,重點是[client],其他的可以參考
[client]
port = 3307
socket = /var/data/db/mariadb/mysql.sock
[mysql]
no-auto-rehash
[mysqldump]
quick
max_allowed_packet = 64m
[myisamchk]
key_buffer_size = 128m
sort_buffer_size = 128m
read_buffer = 2m
write_buffer = 2m
[mysqlhotcopy]
interactive-timeout
6.修改配置檔案/etc/my.cnf.d/server.cnf,這裡的效能引數來自my-large.ini檔案
[mysqld]
port = 3307
datadir = /var/data/db/mariadb
socket = /var/data/db/mariadb/mysql.sock
skip-external-locking
key_buffer_size = 256m
max_allowed_packet = 64m
table_open_cache = 256
sort_buffer_size = 1m
read_buffer_size = 1m
read_rnd_buffer_size = 4m
myisam_sort_buffer_size = 64m
thread_cache_size = 8
query_cache_size= 16m
thread_concurrency = 8
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
7.初始化資料
# mysql_install_db --defaults-file=/etc/my.cnf --datadir=/var/data/db/mariadb/ --user=mysql
8.啟動服務
# service mysql start
9.設定root密碼
# mysqladmin -u root password "8888888"
10.登陸mysql
# mysql -uroot -p
11.授權root遠端登入
#root可從任何ip登陸,注意修改密碼:'888888'
mysql>grant all privileges on *.* to 'root'@'%' identified by '888888' with grant option;
#root可從指定ip登陸,注意修改密碼:'888888'、ip:'192.168.1.188'
mysql>grant all privileges on *.* to 'root'@'192.168.1.188' identified by '888888' with grant option;
mysql>flush rivileges
**
CentOS安裝配置yum
版本 centos 7 檢視是否存在yum rpm qa grep yum yum plugin fastestmirror 1.1.31 45.el7.noarch yum metadata parser 1.1.4 10.el7.x86 64 yum 3.4.3 158.el7.centos.n...
centOS下yum安裝配置samba
注意 本文的原則是只將檔案共享應用於內網伺服器,並讓將要被共享的目錄擁有充分的讀寫許可權屬性,讀者可順著本文的思路完成基本配置流程,如需複雜讀寫許可權功能,請參考此文章http blog.csdn.net linglongwunv archive 2010 01 19 5213337.aspx。1 ...
centOS下yum安裝配置samba
1 yum y install samba 2 rpm qa grep samba 檢查samba服務包的安裝情況,會顯示類似如下兩個包 samba common 3.0.33 3.7.el5 3.1 伺服器和客戶端均需要的檔案 samba 3.0.33 3.7.el5 3.1 伺服器端檔案 3 w...