CentOS7 yum方式安装MariaDB 10.2.13-1
注:以下步骤都是以root身份运行。
一、建立mariadb.repo
1,编辑新文件,命令:vim /etc/yum.repos.d/mariadb.repo
2,输入如下内容,保存退出
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos74-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=
二、安装
1,输入命令
yum install mariadb-server mariadb-client -y
2,等待~_~...
三、配置系统
1,打开防火墙端口(是的,你没看错,服务还叫mysql!)
[root@mariadb ~]# firewall-cmd --permanent --add-service mysql
success
[root@mariadb ~]# firewall-cmd --reload
success
[root@mariadb ~]#
2,设置自启动,启动mariadb
[root@mariadb Downloads]# systemctl enable mariadb
[root@mariadb Downloads]# systemctl start mariadb
3,查看状态(mariadb 或mysql都可以)
[root@mariadb ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.2. database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Fri -- :: CST; 3min 48s ago
Docs: man:mysqld()
https://mariadb.com/kb/en/library/systemd/
Process: ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=/SUCCESS)
Process: ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit (code=exited, status=/SUCCESS)
Process: ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=/SUCCESS)
Main PID: (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─ /usr/sbin/mysqld
四、配置mariadb
1,设置安全配置
[root@mariadb Downloads]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here. Enter current password for root (enter for none):
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation. Set root password? [Y/n] y
New password:
Re-enter new password:
Sorry, passwords do not match. New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment. Remove anonymous users? [Y/n] Y
... Success! Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y
... Success! By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment. Remove test database and access to it? [Y/n] n
... skipping. Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] Y
... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB
installation should now be secure. Thanks for using MariaDB!
mysql_secure_installation
2,测试登录
[root@mariadb Downloads]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.2.-MariaDB MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
mysql -uroot -p
3,设置mysql默认字符编码
[root@mariadb ~]# vim /etc/my.cnf.d/mysql-clients.cnf #
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
# [mysql]
default-character-set=utf8 [mysql_upgrade] [mysqladmin] [mysqlbinlog] [mysqlcheck] [mysqldump] [mysqlimport] [mysqlshow] [mysqlslap] ~
vim /etc/my.cnf.d/mysql-clients.cnf
[root@mariadb ~]# vim /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]
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
default-storage-engine = innodb
innodb_file_per_table
max_connections = #开启慢查询
#slow_query_log = ON
#slow_query_log_file = /usr/local/mysql/data/slow.log
#long_query_time =
# #
# * Galera-related settings
#
vim /etc/my.cnf.d/server.cnf
MariaDB [(none)]> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
rows in set (0.00 sec) MariaDB [(none)]> show variables like 'colla%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
rows in set (0.00 sec) MariaDB [(none)]>
查看当前设置
4,创建远程用户
MariaDB [mysql]> grant all privileges on *.* to user1@'%' identified by 'user188' with grant option;
给所有权限且可传播
五、打完收工^_^
CentOS7 yum方式安装MariaDB 10.2.13-1的更多相关文章
- CentOS7 yum方式安装 MongoDB 3.4 复制集
CentOS7 yum方式安装 MongoDB 3.4 环境.准备 Centos7 系统 配置MongoDB的yum源,添加文件/etc/yum.repos.d/mongodb-org-3.4.rep ...
- CentOS7 yum方式 安装mysql 5.7.28步骤
CentOS7系统yum方式安装MySQL5.7 最新的yum源可以去http://dev.mysql.com/downloads/repo/yum下载 1.获取mysql官方yum reposito ...
- Centos7 yum方式安装MySQL
1.下载安装源 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 2.yum方式安装 yu ...
- centos7 yum 方式安装nginx
centos7系统库中默认是没有nginx的rpm包的,所以我们自己需要先更新下rpm依赖库 (1)使用yum安装nginx需要包括Nginx的库,安装Nginx的库 #rpm -Uvh http:/ ...
- Centos7 Yum方式安装Mysql7
不废话,直奔主题,可以覆盖安装. 下载并安装MySQL官方的 Yum Repository [root@localhost ~]# wget -i -c http://dev.mysql.com/ge ...
- CentOS7 yum方式安装MySQL5.7
转载至博客:https://www.cnblogs.com/bigbrotherer/p/7241845.html 在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要 ...
- Linux(CENTOS7) YUM方式安装mysql5.7
参考地址:https://www.cnblogs.com/linjiqin/p/7611204.html 注:该地址标题写的是CENTOS6.*版本的,但是我在我的CENTOS7.*上面安装是完美进行 ...
- CentOS7 yum方式安装MySQL5.7 + 远程连接
1 下载并安装MySQL官方的 Yum Repository [root@localhost ~]# wget -i -c http://dev.mysql.com/get/mysql57-commu ...
- CentOS7安装Jenkins,使用war方式直接运行或用yum方式安装运行
jenkins最简单的安装方式呢,就是直接去官网下载jenkins的war包,把war丢到tomcat里运行,直接就能打开了. Jenkins官网:https://jenkins.io/downloa ...
随机推荐
- crm 中使用的Django方法
. 通过ChangeList封装好多数据 . 销售中公共资源:Q查询,3天 15天 . 使用yield实现 - 生成器函数,对数据进行加工处理 - __iter__和yield配合 . 获取Model ...
- ParallaxNode视差节点实现远景近景的不同层次移动
Cocos2d-x有ParallaxNode视差节点,视察顾名思义,就是造成不同的移动速率的效果. 我想大家都玩过刀塔传奇,他的背景有远景和近景之分,而且你滑动屏幕的时候远景和近景是按照不同的速率移动 ...
- linux sendmail 发送缓慢的问题
这个问题关键就是hosts里面对于本机host的设置有问题,你可以看下/var/log/mail.log retry 和 sleeping,再加上其他时间,用sendmail发送邮件等这么久,太累了吧 ...
- Android native thread相关
几个主要的source code路径: /system/core/include/utils/threads.h /system/core/include/utils/Thread.h /system ...
- UVA 11613 Acme Corporation(不固定流量的最小费用流)
题意好长....变量好多.... 增加源点跟汇点.然后将每个月份看成一个点,然后拆成两个点u 跟 u+n. 从s向每个u连一条<n[u], m[i]>的弧,表示最多生产量及价值. 从每个u ...
- 浅谈压缩感知(二十二):压缩感知重构算法之正则化正交匹配追踪(ROMP)
主要内容: ROMP的算法流程 ROMP的MATLAB实现 一维信号的实验与结果 测量数M与重构成功概率关系的实验与结果 一.ROMP的算法流程 正则化正交匹配追踪ROMP算法流程与OMP的最大不同之 ...
- HTML和CSS中判断IE版本并实现相应HTML和CSS
在编写网页代码时,各种浏览器的兼容性是个必须考虑的问题,有些时候无法找到适合所有浏览器的写法,就只能写根据浏览器种类区别的代码,这时就要用到判断代码了. 1.HTML代码中 经过本人测试,在HTML代 ...
- 微信出现BUG,发送“ 两位数字+15个句号 ”,双方系统会卡崩……
刚刚,有网友反映称,微信出现了新的bug.例如,在微信中发“两位数字+15个句号”(另一说法是任意数字,任意15个标点符号),如果有华为手机或者安卓手机收到,就会卡死. 用安卓手机的朋友可以试一下,不 ...
- MDX Cookbook 12 - 计算 SMA 简单移动平均 LastPeriods() 函数的使用
先认识一下这几个名词 Moving Average (MA) 移动平均,或者叫做移动平均线,是技术分析中一种分析时间序列数据的工具.最常见的就是利用股价,回报或交易量等变数计算出移动平均.可以利用移动 ...
- Nginx 介绍
Nginx 是什么 Nginx ("engine x") 是一个开源的,支持高性能.高并发的 Web 服务和代理服务软件.它是由俄罗斯人 Igor Sysoev 开发的,最初被应用 ...