rpm -e mysql-libs –nodeps

#yum中之后mysql5.1,安装还是5.1,现在就要去增加一个新的repo
yum install pv -y
rpm -Uvh http://mirror.steadfast.net/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum –enablerepo=remi,remi-test install mysql mysql-server -y

vim /etc/my.cnf

[mysqld]
datadir=/datadisk/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#skip-locking
skip-name-resolve
key_buffer_size = 128M
max_allowed_packet = 512M
table_open_cache = 1024
table_definition_cache=1024
sort_buffer_size = 4M
net_buffer_length = 256K
read_buffer_size = 4M
join_buffer_size = 8M
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 64M
query_cache_size = 8M
#default-character-set=utf8
character_set_server=utf8
innodb_log_buffer_size=32M
thread_cache_size = 64
tmp_table_size = 256M
max_connections = 3000
#max_connect_errors = 10000000
wait_timeout = 31536000
interactive_timeout=31536000
thread_concurrency = 8
#long_query_time = 10
log-slow-queries =log-queries-not-using-indexes
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size=2G
innodb_file_per_table=1
log-bin=/datadisk/mysql_logs/mysql-bin
max_binlog_size=10240M
event_scheduler=on
log_bin_trust_function_creators=1
character_set_server=utf8

[mysqld_safe]
log-error=/datadisk/mysql/mysqld.log
pid-file=/datadisk/mysql/mysqld.pid

#[client]
#default-character-set = utf8

[mysqld]
datadir=/datadisk/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#skip-locking
skip-name-resolve
key_buffer_size = 128M
max_allowed_packet = 512M
table_open_cache = 1024
table_definition_cache=1024
sort_buffer_size = 4M
net_buffer_length = 256K
read_buffer_size = 4M
join_buffer_size = 8M
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 64M
query_cache_size = 8M
#default-character-set=utf8
character_set_server=utf8
innodb_log_buffer_size=32M
thread_cache_size = 64
tmp_table_size = 256M
max_connections = 3000
#max_connect_errors = 10000000
wait_timeout = 31536000
interactive_timeout=31536000
thread_concurrency = 8
#long_query_time = 10
log-slow-queries =log-queries-not-using-indexes
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size=2G
innodb_file_per_table=1
log-bin=/datadisk/mysql_logs/mysql-bin
max_binlog_size=10240M
event_scheduler=on
log_bin_trust_function_creators=1
character_set_server=utf8

[mysqld_safe]
log-error=/datadisk/mysql/mysqld.log
pid-file=/datadisk/mysql/mysqld.pid

#[client]
#default-character-set = utf8

 

把目录建好后启动服务

mkdir /datadisk/mysql_logs -p
mkdir /datadisk/mysql -p
chown mysql:mysql /datadisk/mysql/ -R
chown mysql:mysql /datadisk/mysql_logs -R
chkconfig mysqld on

确认selinux已经关闭了,再启动mysql

service mysqld restart

###mysql添加admin账号和授权,
CREATE USER ‘admin’@’%’ IDENTIFIED BY ‘123456’;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE
TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE,
ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO ‘admin’@’%’;

 

Prometheus监控系统

前言:prometheus作为目前流行的一套监控系统,主要由三大件组成 prometheus(主监控服务)node_exporter(指标采集服务)Alertmanager(报警管理服务)Prome...

阅读全文

为Kubernetes v1.5.2版本安装dashboard图形界面

一、前言 dashboard是一个图形化管理界面,由于我这边的Kubernetes v1.5.2比较老,按官网的安装方法没有效果,现在试试手动安装,使用下面2个yaml文件安装 ...

阅读全文

k8s简单部署

K8s中文手册地址:https://www.kuboard.cn/learning/k8s-basics/kubernetes-basics.html#kubernetes%E5%8A%9F%E8%83%BD   这边安装的Kubernetes v1.5.2 比较...

阅读全文

欢迎留言