AWS完全指引手册第07节-安装MySQL

2014-05-25 0:16:05

[开发运维 | Dev Ops] , , ,

MySQL 的安装同样简单,我们用yum安装完后,直接用它提供的脚本进行设置,然后再进行微调。

 

 

sudo yum install mysql mysql-server

 

然后我们启动它

sudo service mysqld start

 

你会看到有提示

Alternatively you can run:
/usr/bin/mysql_secure_installation
我们就用sudo来运行,然后按照提示办就可以了。

然后我们需要设置/etc/my.cnf 这个文件是MySQL  的配置文件,其具体参数根据自己的需要进行微调吧。如果不使用MySQL的远程登陆功能,建议添加 skip-networking

[mysqld]
character-set-server                    = utf8
skip-networking
skip-external-locking
key_buffer                              = 16M
sort_buffer_size                        = 512K
net_buffer_length                       = 64K
read_buffer_size                        = 256K
read_rnd_buffer_size                    = 256K
join_buffer_size                        = 256K
max_connections                         = 2000
wait_timeout                            = 10

thread_concurrency                      = 8

query_cache_size                        = 16M
tmp_table_size                          = 16M

#innodb_log_file_size                   = 32M
#innodb_log_buffer_size                 = 8M
#innodb_buffer_pool_size                = 32M
#innodb_additional_mem_pool_size        = 16M



[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

 

 

这篇博文发表在 开发运维 | Dev Ops 目录下,标签为 , , ,
如需引用,请使用链接:https://note.mc256.dev/?p=377

This article published in 开发运维 | Dev Ops with tags , , , .
Cite this page using this link:https://note.mc256.dev/?p=377

您的邮箱地址不会被公开,评论使用Gravatar头像。
Your email address will not be published. This blog is using Gravatar.

正在提交评论... Submitting ...
正在为您准备评论控件 Loading Comment Plugin
Copyright © 2013-2024 mc256. All Rights Reserved.
Powered by WordPress on top of a dual-stack k3s Cluster using JuiceFS.
Wordpress Theme Designed By mc256.
Encrypted By Let's Encrypt.  Hosted On Linode + OVH + AWS.
DNS Provided By Hostker.
Status Page by CloudFlare Worker.