centos yum 安装 mariadb

来源:互联网 发布:天天看高清影视mac版 编辑:程序博客网 时间:2024/05/16 08:35

1. 在 /etc/yum.repos.d/ 下建立 MariaDB.repo,输入内容

[mariadb]name=MariaDBbaseurl=http://yum.mariadb.org/10.1.10/centos6-amd64/gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

如需其他版本, 到 http://yum.mariadb.org/ 查看

2. 执行安装

yum -y install MariaDB-client MariaDB-server

3. 启动 mysql 服务

service mysql start


4. 修改root密码

mysqladmin -u root password '111111'


5. 配置 MariaDB


$ sudo /usr/bin/mysql_secure_installation[...]Enter current password for root (enter for none):OK, successfully used password, moving on...[...]Set root password? [Y/n] yNew password:Re-enter new password:Remove anonymous users? [Y/n] Y[...]Disallow root login remotely? [Y/n] N[...]Remove test database and access to it [Y/n] Y[...]Reload privilege tables now? [Y/n] YAll done!


6. 登录

mysql -u root -p



0 0