centos 安装MariaDB

1、在 /etc/yum.repos.d/ 下建立 MariaDB.repo,内容参照下面的链接,根据自己的系统选择:

        https://downloads.mariadb.org/mariadb/repositories/#mirror=shanghai-university

      如下:

Here is your custom MariaDB YUM repository entry for CentOS. Copy and paste it into a file under /etc/yum.repos.d/ (we suggest naming the file MariaDB.repo or something similar).

# MariaDB 10.3 CentOS repository list - created 2019-05-31 02:06 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

After the file is in place, install MariaDB with:

sudo yum install MariaDB-server MariaDB-client
If you haven't already accepted the MariaDB GPG key, you will be prompted to do so. See "Installing MariaDB with yum" for detailed information.

Please see Installing OQGraph for details on additional install steps needed for that storage engine.

2、执行命令:sudo yum install MariaDB-server MariaDB-client

3、使用systemctl 启停,如下:

      systemctl start mariadb

      systemctl stop mariadb

      systemctl status mariadb

      systemctl enable mariadb

4、配置

      执行命令:mysql_secure_installation,然后根据提示一步一步配置,其中有一项是设置root的登录密码

5、远程访问授权:

    使用mysql -uroot -p密码登录后,执行命令:

      GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的密码的明文' WITH GRANT OPTION;

      FLUSH PRIVILEGES;  

6、如果远程访问,并且数据量很大,则需要进行如下配置,否则会出现MySQL server has gone away 的

 错误     :

   set global max_allowed_packet=1024*1024*16;
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ztenv

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值