第 26 章 MySQL

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介:

目录

26.1. Installation
26.2. create database and user

26.1. Installation

# yum install mysql-server
# /etc/init.d/mysqld start
		

设置数据库root密码

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h your.domain password 'new-password'
		

or

# /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, 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 MySQL
root user without the proper authorisation.

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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, MySQL 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 MySQL
installation should now be secure.

Thanks for using MySQL!

		

Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by Disqus





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
存储 SQL 算法
【Hello mysql】 mysql数据类型(下)
【Hello mysql】 mysql数据类型(下)
83 0
|
10月前
|
关系型数据库 MySQL Java
MySQL的问题
MySQL的问题
157 0
|
SQL 算法 关系型数据库
|
存储 关系型数据库 MySQL
MySQL详解
@[TOC](目录) # 一、MySQL 概述 MySQL 是一种开源的关系型数据库管理系统,最初由瑞典的 MySQL AB 公司开发,并于 2008 年被 Oracle 收购。MySQL 是目前最流行的关系型数据库管理系统之一,广泛应用于 Web 应用程序、企业级应用程序、大数据和数据挖掘等领域。 MySQL 的历史和发展: MySQL 最初是由 Michael Widenius 和 Allan Larsson 于 1979 年开发的。当时,他们正在为瑞典的一个电话公司开发一个账单系统,需要一个快速的数据存储和处理工具。他们决定使用关系型数据库管理系统,因为当时其他的数据存储和处理工具都比较
123 0
|
SQL 存储 缓存
|
SQL 存储 Oracle
盘点一下Mysql中的一些小知识(一)
盘点一下Mysql中的一些小知识(一)
117 0
|
SQL 存储 安全
MySQL详细讲解
MySQL入门教程整理,涉及MySQL初级篇所有知识点。
MySQL详细讲解
|
SQL 关系型数据库 MySQL
Mysql 系列 一 explan
explan在数据库中的作用以及字段详解
|
存储 SQL 关系型数据库
MYSQL
MYSQL
185 0
MYSQL
|
SQL 关系型数据库 MySQL
Mysql
笔记
137 1