In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Extract the installation package:
Tar-zxvf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
Create a mysql directory:
Mkdir-p / data/mysqlcd / data/mysql/
Binlog storage directory:
Mkdir binlog
Mysql data Catalog:
Mkdir data
Mysql log directory:
Mkdir log
Restrict mysql import and export directories:
Mkdir tmp
Authorized mysql users:
Chown-R mysql:mysql / data/mysql/
Move the directory to a custom location, where it is stored under / usr/local:
Mv mysql-5.7.23-linux-glibc2.12-x86_64 / usr/local/mysqlcd / usr/local/
Program directory authorization:
Chown-R mysql:mysql / usr/local/mysql/
Back up the configuration file that comes with it:
Cp my.cnf my.cnf.back
Edit the new profile:
Vi my.cnf
Replace the contents of the source file with the following
[mysqld] # bind-address 0.0.0.0back_log = 2000basedir = / usr/local/mysqlcharacter-set-server = utf8mb4datadir = / data/mysql/dataevent_scheduler = ONinnodb_autoinc_lock_mode = 1innodb_buffer_pool_size = 16Ginnodb_data_file_path = ibdata1:500M:autoextendinnodb_data_home_dir = / data/mysql/datainnodb_file_per_table = 1innodb_flush_log_at_trx_commit = 2innodb_flush_method = O_DIRECTinnodb_io_capacity = 2000innodblog _ Buffer_size = 8388608innodb_log_files_in_group = 3innodb_log_group_home_dir = / data/mysql/datainnodb_max_dirty_pages_pct = 50innodb_open_files = 1024innodb_read_io_threads = 8innodb_thread_concurrency = 20innodb_write_io_threads = 8innodb_lock_wait_timeout = 10innodb_buffer_pool_load_at_startup = 1innodb_buffer_pool_dump_at_shutdown = 1key_buffer_size = 3221225472innodb_log_file_size = 1Glocal_infile = 1slave-skip -errors = 1062 1032binlog-format = rowlog-bin = / data/mysql/binlog/mysql-bin.logexpire_logs_days = 7log_bin_trust_function_creators = 1log_output = FILElong_query_time = 1log-error = / data/mysql/log/error.logmax_allowed_packet = 134217728max_connect_errors = 1000000max_connections = 2000myisam_sort_buffer_size = 33554432#myisam_recover = 1join_buffer_size = 8388608tmp_table_size = 33554432net_buffer_length = 8192performance_schema = 1performanceworthy schemamax.max1 Table_instances = 200pid-file = / data/mysql/mysqld.pidport = 3306query_cache_size = 0query_cache_type = 0read_buffer_size = 20971520read_rnd_buffer_size = 16Mmax_heap_table_size = 33554432bulk_insert_buffer_size = 134217728#relay-log = / data2/mysql/log/mysql-relay.logsecure-file-priv = / data/mysql/tmpserver-id = 324532432skip-slave-startskip_name_resolveslave-load-tmpdir = / data/mysql/tmpslow-query-log-file = / data / mysql/log/mysql-slow.logslow_query_log = 1socket = / tmp/mysql.socksort_buffer_size = 2097152table_open_cache = 128thread_cache_size = 50tmpdir = / data/mysql/tmpuser = mysql#wait_timeout = 28800000 transactionisolation isolation log-error = / data/mysql/log/error.logpid-file = / data/mysql/mysqld.pid
Save exit
Cd / usr/local/mysql/
Initialize the database:
. / bin/mysqld-- initialize-- user=mysql-- basedir=/usr/local/mysql/-- datadir=/data/mysql/data/cd / data/mysql/log/
Check the log. Initialization generates an initial password:
Tail-f error.log
Copy the startup script to the system startup directory:
Cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysql
Join the boot service:
Chkconfig-add mysql
Set up boot boot:
Chkconfig mysql on
Copy the command to the system path for global invocation:
Cp / usr/local/mysql/bin/* / usr/local/sbin//etc/init.d/mysql start # # start the database
Log in to the database to change the initialization password of the root user:
Mysql-u root-p-- > enter the password of the mysql database root user SET PASSWORD = PASSWORD ('new password'); # # modify the password of the root user. (alter user user () identified by 'new password';)
At this point, the whole initialization process is complete.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.