CentOs6.5系统下MySQL-5.7.19安装-创新互联-成都快上网建站

CentOs6.5系统下MySQL-5.7.19安装-创新互联

好长时间没有更新了,今天给大家分享一波简单的文档,菜鸟的入门精神就是不断的学习,不断地找大神帮助!!!!

创新互联是专业的迪庆州网站建设公司,迪庆州接单;提供网站设计制作、做网站,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行迪庆州网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

在这里今天给大家推荐一个博文地址:http://sumongodb.blog.51cto.com/

好了!废话少说,干活走起来!!!!!!!!

CentOs6.5下mysql5.7.19二进制安装是我自己编译的官方源码包

首先我们把一些依赖包安装上:

yum -y groupinstall "Development tools" yum -y install ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make

解压mysql二进制安装包:

tar -zxvf mysql-5.7.19.tar.gz -C /usr/local/mysql

编辑my3306.cnf

vim /etc/my3306.cnf [client] port                            = 3306 socket                          = /tmp/mysql3306.sock default_character_set           = utf8 [mysqld] lower_case_table_names      = 1 port                            = 3306 basedir                         = /usr/local/mysql datadir                         = /home/mysql3306/mysql3306 socket                          = /tmp/mysql3306.sock pid_file                        = /home/mysql3306/mysql.pid tmpdir                          = /tmp/ skip_name_resolve               = 1 character_set_server            = utf8 collation_server                = utf8_unicode_ci max_connections                 = 512 max_connect_errors              = 100000 interactive_timeout             = 600 wait_timeout                    = 600 table_open_cache                = 2048 query_cache_type                = 0 #query_cache_size               = 64M #query_cache_limit              = 2M thread_cache_size               = 51 max_allowed_packet              = 16M tmp_table_size                  = 256M max_tmp_tables                  = 128 max_heap_table_size             = 96M sort_buffer_size                = 4M read_buffer_size                = 4M #顺序IO join_buffer_size                = 4M read_rnd_buffer_size            = 8M #随机IO bulk_insert_buffer_size         = 64M # default_storage_engine               = InnoDB log_bin                              = /home/mysql3306/logs/mysql-bin expire_logs_days                     = 7 binlog_format                        = row log_slave_updates                     = 1 log_error                            = /home/mysql3306/logs/mysql-error.log slow_query_log                       = 1 slow_query_log_file                  = /home/mysql3306/logs/mysql-slow.log long_query_time                      = 1 log_output                           = FILE log_queries_not_using_indexes        = 1       max_binlog_cache_size                = 8M max_binlog_size                      = 1024M binlog_cache_size                    = 4M sync_binlog                          = 1 server_id                            = 15133306             #innodb innodb_data_home_dir                 = /home/mysql3306/mysql3306/ innodb_data_file_path                = ibdata1:512M:autoextend innodb_log_group_home_dir            = /home/mysql3306/mysql3306 innodb_buffer_pool_instances         = 1 innodb_buffer_pool_size              = 500M innodb_buffer_pool_dump_pct          = 40 innodb_page_cleaners                 = 4 innodb_log_file_size                 = 256M innodb_log_files_in_group            = 2 innodb_log_buffer_size               = 32M  #default 16M innodb_flush_log_at_trx_commit       = 1 innodb_lock_wait_timeout             = 30 innodb_undo_directory                = /home/mysql3306/mysql3306/ innodb_undo_logs                     = 128  #must >=35.default 128 innodb_undo_tablespaces              = 3    #must >=2 innodb_undo_log_truncate             = 1 innodb_max_undo_log_size             = 1000M innodb_purge_rseg_truncate_frequency = 128 innodb_print_all_deadlocks          = 1     innodb_buffer_pool_load_at_startup  = 1 innodb_buffer_pool_dump_at_shutdown = 1 innodb_open_files                   = 65536 innodb_file_per_table               = 1 innodb_lock_wait_timeout            = 30 innodb_read_io_threads              = 8 innodb_write_io_threads             = 8 innodb_io_capacity                  = 200 innodb_flush_log_at_trx_commit      = 1 innodb_flush_method                 = O_DIRECT innodb_purge_threads                = 4 innodb_support_xa                   = 1 innodb_max_dirty_pages_pct          = 75 transaction_isolation               = REPEATABLE-READ #rep slave-parallel-type=LOGICAL_CLOCK slave-parallel-workers=16 master_info_repository=TABLE relay_log_info_repository=TABLE relay_log_recovery=ON [mysqldump] max_allowed_packet              = 16M [mysql] default_character_set           = utf8

创建mysql用户

useradd mysql

创建mysql相关数据目录

mkdir -p /home/mysql3306/msyql3306 mkdit -p /home/mysql3306/logs

给mysql相关目录进行授权

chown -R mysql:mysql /home/mysql3306 chown -R mysql:mysql /usr/local/mysql

初始化mysql

/usr/local/mysql/bin/mysqld --defaults-file=/etc/my3306.cnf --initialize-insecure --explicit_defaults_for_timestamp --basedir=/usr/local/mysql --datadir=/home/mysql3306/mysql3306/ --user=mysql

启动mysql

/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my3306.cnf --datadir=/home/mysql3306/mysql3306/ --user=mysql &

配置环境变量

vim /etc/profile export PATH=$PATH:/usr/local/mysql/bin

进入mysql

mysql -S /tmp/mysql3306.sock

修改mysql用户密码

mysql>UPDATE user SET authentication_string=password('root123') WHERE User='root' AND Host='localhost';

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享题目:CentOs6.5系统下MySQL-5.7.19安装-创新互联
网页链接:http://kswjz.com/article/ccoghi.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流