您好,登錄后才能下訂單哦!
好長時間沒有更新了,今天給大家分享一波簡單的文檔,菜鳥的入門精神就是不斷的學習,不斷地找大神幫助!!!!
在這里今天給大家推薦一個博文地址: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';
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。