安装:

#centos 7
yum install -y mariadb mariadb-server mariadb-devel
#debian 8
apt-get install nginx mariadb-server mariadb-client libmariadbclient-dev python-dev libssl-dev

启动与开机启动:

systemctl start mysqld
systemctl enable mariadb

配置

初始状态下,在终端中输入mysql就可以直接进入数据库,进而可以更改root密码。

[root@DptServer2 hubery]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec) MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
MariaDB [mysql]> exit
Bye

mysql提供了一套安全的初始化操作,使用/usr/bin/mysql_secure_installation命令。

[root@DptServer2 hubery]# mysql_secure_installation
/bin/mysql_secure_installation: line 379: find_mysql_client: command not found 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:
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]
... 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]
... 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]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n]
... 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!

参考:

Data Matters

MariaDB Setting up

openssl-dev on Ubuntu

CentOS 7下MySQL安装配置的更多相关文章

  1. Centos 下mysql安装配置

    一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...

  2. ubuntu下MySQL安装配置及基本操作

    在linux下安装方法: 分为四种:一: 直接用软件仓库自动安装(如:ubuntu下,sudo apt-get install mysql-server; Debain下用yum安装): 二:官网下载 ...

  3. Linux下MySQL 安装配置

    MySQL 是最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司. MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言. MySQL由于其体积小.速度快 ...

  4. Win7和Ubuntu下mysql 安装配置

    Windows下安装 下载对应版本的mysql安装包安装,如果安装目录为 C:\Program Files\MySQL\MySQL Server 5.6 增加环境变量 MYSQL_HOME=C:\Pr ...

  5. Windows下MySQL安装配置与使用

    1.下载. 下载地址: http://downloads.mysql.com/archives/get/file/mysql-5.7.11-winx64.zip. NavicatforMySQL:ht ...

  6. Mariadb 在centos 7下的安装配置

    安装Mariadb数据库: sudo yum install mariadb-server 启动数据库: sudo systemctl start mariadb 设置自动启动: sudo syste ...

  7. php-fpm 在centos 7下的安装配置

    安装php: sudo yum install php php-fpm php-mysql php-mbstring php-mcrypt php-sockets php-curl php-commo ...

  8. PostgreSQL 在centos 7下的安装配置

    安装postgresql: sudo yum install postgresql-server 初始化数据库: sudo postgresql-setup initdb 启动数据库: sudo sy ...

  9. centos 6.9 mysql 安装配置

    1.全新系统,安装mysql yum -y install mysql mysql-server mysql-devel 2.启动mysql service mysqld start 3.修改密码 登 ...

随机推荐

  1. 新年SO交期更新——FP_SO2SAP

    (一)         以下逻辑落在12月26日-2月4日生效,2月5日此段逻辑失效: (二)         针对SO创建日期落在N-1天的新单进行处理: (三)         根据FP运算逻辑: ...

  2. Centos apache + mysql + usvn 配置svn 服务器

    1.遇到问题 提交异常:'svn/!svn/me'path not found http://www.myexception.cn/cvs-svn/1262826.html 更改http.conf 配 ...

  3. jquery的滑动

    (1)slideDown(speed,callback)方法:用于想下滑动的方法. $("#flip").click(function(){ $("#panel" ...

  4. EF外键关联

    客户里面存在客服外键 基类模型 public class ModelBase { public ModelBase() { CreateTime = DateTime.Now; } [Key] pub ...

  5. 一个简单xml数据转换为数组的方法

    本人用easywechat做微信回复图文,从数据库中拿到的数据直接是xml拼好的数据,但是框架只有自带的获取xml格式的语句,所有需要将xml数据中所需要的数据拿出来用来拼接. 搜了好多资料说的都很麻 ...

  6. Finereport集群配置

    增加配置文件cluster.xml 将配置包resource文件夹下的cluster.xml打开,如果没有cluster.xml,则新建一个,基本内容如下: <?xml version=&quo ...

  7. [Android基础论]为何Activity退出之后,系统没有调用onDestroy方法?

    首先,问题是如何出现的? 晚上复查代码,发现一个activity没有调用自己的ondestroy方法 我表示非常的费解,于是我检查了下代码. 发现再finish代码之后接了如下代码 finish(); ...

  8. java中switch、while、do...while、for

    一.Java条件语句之 switch 当需要对选项进行等值判断时,使用 switch 语句更加简洁明了.例如:根据考试的名次,给予前 4 名不同的奖品.第一名,奖励笔记本一台:第二名,奖励 IPAD  ...

  9. 深入浅出Symfony2 - 结合MongoDB开发LBS应用

    简介 随着近几年各类移动终端的迅速普及,基于地理位置的服务(LBS)和相关应用也越来越多,而支撑这些应用的最基础技术之一,就是基于地理位置信息的处理.我所在的项目也正从事相关系统的开发,我们使用的是S ...

  10. 用SMIL语言编写一个简单的演示

    一.首先需要注意的几点是: 1.用记事本编写代码时,要保存为后缀名为.smil或.smi的文件,并且编码格式选择为UTF-8. 2.打开.smil文件的播放器选择为:RealPlayer或是Ambul ...