添加 yum 数据源:
https://downloads.mariadb.org/mariadb/repositories/
选择后生成:
# MariaDB 10.0 CentOS repository list - created 2015-02-07 18:49 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
添加到源中去
$ sudo emacs -nw /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.0 CentOS repository list - created 2015-02-07 18:49 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.0/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 C-x-s #保存C-x-c #退出Eamcs
$ sudo yum install MariaDB-server MariaDB-client #安装MariaDB
$ sudo service mysql start #启动MariaDB数据库
$ sudo mysqladmin -u root password ‘yourpassword‘#修改root密码
$ mysql -u root -p #打开数据库
时间: 2024-10-03 23:10:07