Install MySQL on Linux with rpm

Source: Internet
Author: User
Tags change settings tar extract

Remove the MYSQL:RPM-QA from the system before installing MySQL | grep "mysql*"     and Rpm-qa | grep mysql  to make sure to uninstall the clean rpm-e mysql-server-5.1.74-1.el6.x86_64.rpm--nodepsmysql here using RPM Installation: Installation package: Mysql-5.6.26-1.linux _glibc2.5.x86_64.rpm-bundle.tartar XF Mysql-5.6.26-1.linux_glibc2.5.x86_64.rpm-bundle.tar Extract the:[[email  Protected] mysql_install_packet]# lltotal 619196-rw-r--r--1 root root  317030400 the 11:55 mysql-5.6.26-1.linux_ glibc2.5.x86_64.rpm-bundle.tar-rw-r--r--1 7155 wheel  23142383 Jul 01:16 mysql-client-5.6.26-1.linux_ glibc2.5.x86_64.rpm-rw-r--r--1 7155 wheel   4586909 Jul 01:16 mysql-devel-5.6.26-1.linux_glibc2.5.x86_ 64.rpm-rw-r--r--1 7155 wheel 117649695 Jul 01:17 mysql-embedded-5.6.26-1.linux_glibc2.5.x86_64.rpm-rw-r--r--1 7155 w heel  88754725 Jul 01:17 mysql-server-5.6.26-1.linux_glibc2.5.x86_64.rpm-rw-r--r--1 7155 wheel    2418592 Jul 01:18 mysql-shared-5.6.26-1.linux_glibc2.5.x86_64.rpm-rw-r--r--1 7155 wheel   5181237 Jul 16 01:18 mysql-shared-compat-5.6.26-1.linux_glibc2.5.x86_64.rpm-rw-r--r--1 7155 wheel  75283535 Jul 16 01:18 mysql-test-5.6.26-1.linux_glibc2.5.x86_64.rpm  Create a user first: Groupadd mysql                       --Create MySQL user group useradd-m-s /sbin/nologin mysql-g mysql --the MySQL created here does not Can login without home directory  rpm install:rpm-ivh  MYSQL-CLIENT-5.6.26-1.LINUX_GLIBC2.5.X86_64.RPMRPM-IVH MYSQL-DEVEL-5.6.26-1.LINUX_GLIBC2.5.X86_64.RPMRPM-IVH MYSQL-EMBEDDED-5.6.26-1.LINUX_GLIBC2.5.X86_64.RPMRPM-IVH MYSQL-SHARED-5.6.26-1.LINUX_GLIBC2.5.X86_64.RPMRPM-IVH mysql-shared-compat-5.6.26-1.linux_glibc2.5.x86_64. RPMRPM-IVH mysql-server-5.6.26-1.linux_glibc2.5.x86_64.rpm Here the test is not installed!   Change Data directory: Mkdir/mysqldata the files under the data directory of the RPM default installation are moved to the new directory: Mkdir-p/mysqldata/mv/var/lib/mysql/*/MYSQLDATA/CD/ Mysqldatamkdir slowlogmkdir binlogmkdir relaylogmkdir tmpdatamkdir general_logchown-r mysql:mysql/mysqldata  Change the my.cnf file: replace the original/ETC/MY.CNF content with the following content, the specific parameters according toApplication requirements and server conditions are adjusted: # for advice on what to change settings see# http://dev.mysql.com/doc/refman/5.6/en/ server-configuration-defaults.html# before using this configuration, please create a new directory in the Data Catalog: tmpdata  binlog  relaylog general_log  Slowlog, and gives MySQL user rights!  [mysqld]port=3306datadir=/mysqldata/tmpdir=/mysqldata/tmpdatasocket=/ Mysqldata/mysql.sockskip_external_lockingopen_files_limit = 65535lower_case_table_names = 1 #### Skip Domain Hostname ########## #skip-name-resolve #### bin-log ####################### #server-id=1log-bin=/mysqldata/ binlog/mysql-bin.indexmax_binlog_size=128mbinlog-format=rowsync_binlog=1#binlog-ignore-db=mysql# replicate-ignore-db=mysql#master-connect-retry=60 #### Relay Log ###################### #relay_log =/mysqldata /relaylog/mysql-relay#relay_log_purge = 1#expire_logs_days=3#skip_slave_start #### character ################ ##### #character-set-server=utf8#init_connect= ' Set NAMES UTF8 '  #### connect ####################### #max_ Connections=1024max_allowed_packet=16m #### Timeout ####################### #wait_timeout =1024interactive_timeout=1024 #### Vaiables size ################# #tmp_table_size =64mmax_heap_table_size = 64mkey_buffer_size=128m table_ Definition_cache=1024table_open_cache=1024join_buffer_size=4msort_buffer_size=4mread_buffer_size=8mmyisam_sort _buffer_size = 64m thread_cache_size = 16thread_concurrency = 32 explicit_defaults_for_timestamp = 1sysdate-is-now  ########## general_log ############ #general_log =on#general_log_file=/mysqldata/ general_log/general_log.log ############# slow_log ############ #default offlong_query_time=3slow_query_log= 1slow_query_log_file=/mysqldata/slowlog/slow-query.loglog_queries_not_using_indexes=1   ####### # # # Query_cache ############ #default off#explicit_defaults_for_timestamp=truequery_cache_type=0query_cache_size=0 #thread_cache = 500#query_cache_limit=2m  ########### InnoDB ############### #innodb_read_io_threads = 8innodb_writE_io_threads = 8innodb_buffer_pool_instances = 8innodb_buffer_pool_size = 2ginnodb_additional_mem_pool_size = 32minnodb_thread_concurrency = 32 innodb_file_per_table=1innodb_data_home_dir=/mysqldatainnodb_data_file_ path=ibdata1:12m:autoextend innodb_io_capacity = 2000innodb_autoinc_lock_mode = 2innodb_locks_unsafe_for_ Binlog = 1transaction-isolation = Read-committed  innodb_log_file_size = 128minnodb_log_buffer_size = 32minnodb_log_files_in_group = 3 innodb_lock_wait_timeout=60innodb_flush_method=o_directinnodb_purge_ Threads=1innodb_support_xa=1innodb_flush_log_at_trx_commit = 1  [client]default-character-set=utf8    [mysql]socket=/mysqldata/mysql.sock no_auto_rehashprompt = "\\R:\\m:\\s \\d>"  [ mysqldump]socket=/mysqldata/mysql.sock   add MySQL service to boot: chkconfig--add mysqlchkconfig--levels 235 MySQL On last vi/etc/init.d/mysql  modify Basedir and DataDir to the following: Basedir=/usrdatadir=/mysqldata service MySQL startcat/ root/. Mysql_secretmysql-uroot-p ' 5P19XZXFIPUWYXWR '    --This password is Mysql_secret inside the set PASSWORD = PASSWORD (' Mysteel '); Flush Privileges;drop Database test;

Install MySQL on Linux with rpm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.