第 26 章 MySQL

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

目录

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 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
22天前
|
关系型数据库 MySQL
mysql报Toomanyconnection的问题
mysql报Toomanyconnection的问题
12 0
|
5月前
|
存储 关系型数据库 MySQL
|
关系型数据库 MySQL
MySQL一行变多行,多行变一行
MySQL一行变多行,多行变一行
163 1
MySQL一行变多行,多行变一行
|
SQL 关系型数据库 MySQL
MySQL(六)
MySQL(六),一起来学习吧。
|
SQL 关系型数据库 MySQL
MySQL(八)
MySQL(八),一起来学习吧。
MySQL(八)
|
SQL 存储 缓存
MySQL的组成
SQL运行机制概述
104 0
MySQL的组成
|
关系型数据库 MySQL
mysql特点
mysql特点
86 0
|
SQL 存储 数据可视化
|
SQL 存储 安全
MySQL DEFINER详解
在 MySQL 数据库中,在创建视图及函数的时候,你有注意过 definer 选项吗?在迁移视图或函数后是否有过报错情况,这些其实都可能和 definer 有关系。本篇文章主要介绍下 MySQL 中 definer 的含义及作用。
995 0
|
SQL 关系型数据库 MySQL
【Mysql】常见错误集合
【Mysql】常见错误集合
217 0

热门文章

最新文章