Hostnamectl set-hostname mysql [[email protected] ~]# rpm -qa mariadb*mariadb-libs-5.5.44-2.el7.centos.x86_64[[email protected] ~]# yum Remove mariadb-libs-5.5.44-2.el7.centos.x86_64[[email protected] ~] #yum install -y perl perl-devel perl-module-install.noarch[[email protected] ~]# rpm -ivh mysql-devel-5.6.29-1.rhel5.x86_64.rpmwarning: mysql-devel-5.6.29-1.rhel5.x86_ 64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing ... ################################# [100%]package mysql-devel-5.6.29-1.rhel5.x86_64 is already installed[[email protected] ~]# rpm -ivh mysql-client-5.6.29-1.rhel5.x86_64.rpm warning: mysql-client-5.6.29-1.rhel5.x86_64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing... ################################# [100%]package mysql-client-5.6.29-1.rhel5.x86_64 is already installed[[email protected] ~]# Rpm -ivh mysql-server-5.6.29-1.rhel5.x86_64.rpm warning: mysql-server-5.6.29-1.rhel5.x86_ 64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing ... ################################# [100%]package mysql-server-5.6.29-1.rhel5.x86_64 is Already installed[[email protected] ~]# you will find that password in '/root/.mysql_secret '. [[email protected] ~]# service mysql startstarting mysql. success! [[ Email protected] ~]# [[email protected] ~]# /usr/bin/mysql_secure_installation #初始化密码 Set your own password
Need to copy the default--datadir MySQL to/data and give MySQL permission
[[email protected] ~]# ps-ef |grep MySQL
Root 12365 1 0 23:28 pts/1 00:00:00/bin/sh/usr/bin/mysqld_safe--datadir=/data/mysql--pid-file=/var/lib/m Ysql/mysql.pid
MySQL 13171 12365 0 23:28 pts/1 00:00:00/usr/sbin/mysqld--basedir=/usr--datadir=/data/mysql--plugin-dir=/usr/ Lib64/mysql/plugin--user=mysql--log-error=/data/mysql/mysql-error.log--open-files-limit=65535--pid-file=/var/ Lib/mysql/mysql.pid--socket=/data/socket/mysql.sock--port=3306
Root 13208 2804 0 23:33 pts/1 00:00:00 grep--color=auto MySQL
[Email protected] ~]#
Look at my.cnf.
[[email protected] ~]# cat /etc/my.cnf[client]port = 3306 socket = /data/socket/mysql.sock default-character-set = utf8[mysqld]port = 3306character-set-server=utf8socket = /data/socket/mysql.sock#basedir = /usr/local/ mysqldatadir = /data/mysqlpid-file = /var/lib/mysql/mysql.piduser = mysqlbind-address = 0.0.0.0server-id = 1skip-name-resolve#skip-networkingback_log = 600max_connections = 1000max_connect_errors = 6000open_files_limit = 65535table_open_cache = 128max_allowed_packet = 4mbinlog_cache_size = 1mmax_heap _table_size = 8mtmp_table_size = 16mread_buffer_size = 2mread_rnd_buffer_size = 8Msort_buffer_size = 8Mjoin_buffer_size = 8Mkey_buffer_size = 4mthread_cache_size = 8query_cache_size = 8mquery_cache_limit = 2mft_min_word_len = 4log_bin = mysql-binbinlog_format = mixedexpire_logs_days = 30log_error = /data/mysql/ mysql-error.logslow_query_log = 1long_query_time = 1slow_query_log_file = /data/ Mysql/mysql-slow.logperformance_schema = 0explicit_defaults_for_timestamp#lower_case_table_names = 1skip-external-lockingdefault_storage_engine = innodb#default-storage-engine = myisaminnodb_file_per_table = 1innodb_open_files = 500innodb_buffer_pool_size = 64minnodb_write_io_threads = 4innodb_read_io_threads = 4innodb_thread_concurrency = 0innodb_purge_threads = 1innodb_flush_log_at_trx_commit = 2innodb_log_buffer_ Size = 2minnodb_log_file_size = 32minnodb_log_files_in_group = 3innodb_max_dirty _pages_pct = 90innodb_lock_waIt_timeout = 120bulk_insert_buffer_size = 8mmyisam_sort_buffer_size = 8mmyisam_ Max_sort_file_size = 10gmyisam_repair_threads = 1interactive_timeout = 28800wait _timeout = 28800sql_mode=no_engine_substitution,strict_trans_tables [mysqldump]quickmax_allowed _packet = 16m[myisamchk]key_buffer_size = 8msort_buffer_size = 8mread_buffer = 4mwrite_buffer = 4m[[email protected] ~]#
Modify the configuration of the socket to stop at startup or MySQL does not know the location of the socket
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/9B/FA/wKioL1lpy7DjCBSTAABuPsMurFg195.png-wh_500x0-wm_ 3-wmp_4-s_812235801.png "title=" 1.png "alt=" Wkiol1lpy7djcbstaabupsmurfg195.png-wh_50 "/>
Backing Up the database
Mysqldump-uroot-p123456-b mysql-f-R--master-data=2--events--single-transaction |gzip >/opt/mysql.20170715 . gz
Mysqldump-uroot-p123456-b mysql-f-R--master-data=2--events--single-transaction >/opt/mysql.sql
Gzip Format Decompression
gzip-d file name
This article is from the "Brick Blog" blog, please be sure to keep this source http://wsxxsl.blog.51cto.com/9085838/1947853
CENTOS7 installation mysql5.6 and partial optimizations