centos7+复制粘贴, 配置都给你搞好了,自己添加一个%用户就行了
- cat << EOF > /etc/yum.repos.d/MariaDB.repo
- [mariadb]
- name = MariaDB
- #baseurl = http://yum.mariadb.org/10.3/centos7-amd64
- #gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.7/centos7-amd64/
- gpgkey= http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
- gpgcheck=1
- EOF
- yum -y install mariadb mariadb-server
- cat << EOF > /etc/my.cnf.d/server.cnf
- #
- # These groups are read by MariaDB server.
- # Use it for options that only the server (but not clients) should see
- #
- # See the examples of server my.cnf files in /usr/share/mysql/
- #
-
- # this is read by the standalone daemon and embedded servers
- [server]
-
- # this is only for the mysqld standalone daemon
- [mysqld]
- character-set-server = utf8mb4
- innodb_large_prefix = on
- lower_case_table_names = 1
-
-
- #
- # * Galera-related settings
- #
- [galera]
- # Mandatory settings
- #wsrep_on=ON
- #wsrep_provider=
- #wsrep_cluster_address=
- #binlog_format=row
- #default_storage_engine=InnoDB
- #innodb_autoinc_lock_mode=2
- #
- # Allow server to accept connections on all interfaces.
- #
- #bind-address=0.0.0.0
- #
- # Optional setting
- #wsrep_slave_threads=1
- #innodb_flush_log_at_trx_commit=0
-
- # this is only for embedded server
- [embedded]
-
- # This group is only read by MariaDB servers, not by MySQL.
- # If you use the same .cnf file for MySQL and MariaDB,
- # you can put MariaDB-only options here
- [mariadb]
- # This group is only read by MariaDB-10.7 servers.
- # If you use the same .cnf file for MariaDB of different versions,
- # use this group for options that older servers don’t understand
- [mariadb-10.7]
-
- EOF
- systemctl enable –now mysql
复制代码
|