CentOS用yum安装、配置MariaDB

前端之家收集整理的这篇文章主要介绍了CentOS用yum安装、配置MariaDB前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

mariadb yum 仓库:

https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna&distro=RedHat&distro_release=rhel6-amd64--rhel6&version=10.0

https://my.oschina.net/iluckyboy/blog/215949

1.创建/etc/yum.repos.d/MariaDB.repo文件,这里用到了刚刚发布正式版的10.0.28 [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos6-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB 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/379147.html

猜你在找的CentOS相关文章