1Create the/etc/yum.repos.d/mariadb.repo file, which is now available in the 10 release of the official version.0[Mariadb]name=Mariadbbaseurl= http://yum.mariadb.org/10.0/centos6-amd64/Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadbgpgcheck=12after you have prepared the repo file, you can use Yum to install the # Yum installation MariaDB-server mariadb-Client3. I like to customize the data directory and the service port, so remove the default data directory # RM-RF/var/lib/MySQL4. Create a new Data Catalog # mkdir/var/data/db/mariadb5. Modify the configuration file/etc/my.cnf.d/mysql-CLIENTS.CNF, the focus is [client], others can refer to [Client]port=3307Socket= /var/data/db/mariadb/Mysql.sock[mysql]no-auto-Rehash[mysqldump]quickmax_allowed_packet=64m[myisamchk]key_buffer_size=128msort_buffer_size=128mread_buffer=2mwrite_buffer=2m[mysqlhotcopy]interactive-Timeout6. Modify the configuration file/etc/my.cnf.d/server.cnf, where the performance parameters are from my-large.ini file [Mysqld]port=3307DataDir= /var/data/db/Mariadbsocket= /var/data/db/mariadb/Mysql.sockskip-external-lockingkey_buffer_size=256mmax_allowed_packet=64mtable_open_cache= thesort_buffer_size=1mread_buffer_size=1mread_rnd_buffer_size=4mmyisam_sort_buffer_size=64mthread_cache_size=8query_cache_size=16mthread_concurrency=8Log-bin=mysql-Binbinlog_format=Mixedserver-id =17. Initializing Data # mysql_install_db--DEFAULTS-FILE=/ETC/MY.CNF--datadir=/var/data/db/mariadb/--user=MySQL8. Start the Services # service MySQL start9. Set Root password # mysqladmin-U root Password"8888888"Ten. Login mysql# MySQL-uroot-P One. Authorized root Telnet #root can be logged in from any IP, note the password change:'888888'MySQL>grant all privileges on * * to'Root'@'%'Identified by'888888'with GRANT OPTION; #root可从指定IP登陆, note the password change:'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 installs and configures mariadb with Yum