MySQL单实例安装

来源:互联网 发布:考试软件哪个好 编辑:程序博客网 时间:2024/06/05 21:01

1. 环境准备

1、上传MySQL二进制压缩包到Linux上
image

2、解压到/usr/local/mysql中

 tar -xzvf mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz -C /usr/local/mysql

查看/usr/local/mysql
iamge

3、创建新用户
image

4、/var/local/mysql 更改属主为mysql
image

5、mysql/bin 添加到环境变量

image

6、创建mysql数据目录并更改属主为mysql

image

2. 二进制方式安装MySQL

1、修改my.cnf到/etc/mysql中

image

2、初始化3306数据库 指定文件/etc/mysql/my3306.cnf

image

3、查看/data1/db3306 目录

image

4、查看error.log文件

image

5、启动mysql3306实例

image

6、查看端口

image

3. 测试

1、进入mysql

image

2、设置root用户的密码为123456

image

3、使用密码登录mysql

image

4. 附件 mysql3306.cnf

[mysqld]# GENERAL #user = mysqlport = 3306socket = /data1/db3306/my3306.sockpid_file = /data1/db3306/mysql.piddatadir = /data1/db3306/tmpdir = /data1/tmplog_bin = /data1/db3306/3306-mysql-binrelay-log = /data1/db3306/3306-relay-binlog_error = /data1/db3306/error.logslow_query_log_file = /data1/db3306/slow-queries.loglong_query_time=1sync_binlog = 0expire_logs_days = 7back_log=1024skip-name-resolveskip-slave-startskip-external-lockingskip-character-set-client-handshakeexplicit_defaults_for_timestamp=truedefault_storage_engine = InnoDBbind-address=0.0.0.0#lower_case_table_names  = 0myisam_recover = FORCE,BACKUPtransaction-isolation = READ-COMMITTEDtable_definition_cache = 4096table_open_cache = 4096# connection #max_connections = 1100max_user_connections = 1000max_connect_errors = 1000# timeout #wait_timeout = 100interactive_timeout = 100lock_wait_timeout = 3connect_timeout = 20slave-net-timeout = 30# character # character-set-server=utf8init-connect='SET NAMES utf8'# disabled query cache #query_cache_type = 0query_cache_size = 0# replication #server_id=71493306gtid_mode=ONenforce-gtid-consistencylog-slave-updatesbinlog-format=rowslave-parallel-workers=6master-info-repository=TABLErelay-log-info-repository=TABLEsync_master_info = 10000slave_sql_verify_checksum=1skip-slave-start# session #key_buffer_size = 128Mtmp_table_size = 32Mmax_heap_table_size = 32Mmax_allowed_packet = 32Mbulk_insert_buffer_size = 32Msort_buffer_size = 128Kread_buffer_size = 1Mread_rnd_buffer_size = 1Mjoin_buffer_size = 128Kmyisam_sort_buffer_size = 32Mtmp_table_size = 32Mmax_heap_table_size = 64Mthread_cache_size = 64#thread_concurrency = 32thread_stack = 192K# INNODB #innodb_flush_method = O_DIRECTinnodb_data_home_dir = /data1/db3306/innodb_data_file_path = ibdata1:10M:autoextend#redo loginnodb_log_group_home_dir=/data1/db3306/innodb_log_files_in_group = 3innodb_log_file_size = 1G#innodb performanceinnodb_flush_log_at_trx_commit = 0innodb_file_per_table = 1innodb_buffer_pool_instances = 8innodb_io_capacity = 2000innodb_lock_wait_timeout = 30binlog_error_action = ABORT_SERVERinnodb_buffer_pool_size = 256Minnodb_max_dirty_pages_pct=90innodb_file_format=Barracuda innodb_support_xa = 0innodb_buffer_pool_dump_at_shutdown = 1innodb_buffer_pool_load_at_startup = 1
0 0
原创粉丝点击