安装:

#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. strstr函数

    原型:char * strstr( char *haystack,  char *needle ) 用法:#include <string.h> 功能:在haystack中寻找needle ...

  2. oracle 的 nubmer 类型与 C# 的 float double decimal 对应关系

    如果先有oracle 数据的情况下,怎么对应到C#中的类型. 在oralce 中 在dba_tab_columns表中, Data_type表示字段类型:Data_length表示字段类型的长度:Da ...

  3. tomcat启动时 myeclipse控制台中文乱码

    情况1: tomcat中conf目录下有个叫server.xml的文件,里面 <Connector port="8080" protocol="HTTP/1.1&q ...

  4. Endless Sky源码学习笔记-4

    事件处理: 事件包括:debug模式切换.切换到登陆窗口.退出.窗口大小变化.全屏切换和游戏中的鼠标键盘输入.处理方式分为两类,前几个为简单的if处理,最后一个涉及到游戏中的控制和交互,且事件由每一个 ...

  5. Visio 2007中进行数据库建模时如何显示字段类型以及概念名称

    关于在VISIO中进行数据库建模时如何显示字段类型,以及注释的 1 如何显示字段类型:   在visio菜单上--->点击数据库--->选项--->文档    打开后选择表这项,在上 ...

  6. submit 后台运行代码

    if EX_TABLE-matnr is not initial and EX_TABLE-KUNDE is not initial.       wa_rspar-selname = 'MATNR' ...

  7. instruments usage error specified target process is invalid

    遇到这个问题的很多,但都没说具体的解决办法. 如果你的包名 路径之类的都正确,还是报这个错误的话,请重启手机.

  8. CentOS 6 安装 MySQL-python

    yum install -y mysql-devel python-devel python-setuptools pip install MySQL-python

  9. [goa]golang微服务框架学习(三)-- 使用swagger-ui展示API

    既然goa框架自动生成啦swagger-json文件,那么如何用swagger-ui展示出来呢? 这里分三步: 1.下载swagger-ui的web代码 2.添加swagger.json 和 swag ...

  10. 解决libcurl7.50.3在windows XP SP3 VC++ 6.0下编译报错 unresolved external symbol __imp__IdnToAscii@20 unresolved external symbol __imp__IdnToUnicode@20

    错误重现: --------------------Configuration: curl - Win32 LIB Debug DLL Windows SSPI DLL WinIDN--------- ...