New MySQL Database Installation

Source: Internet
Author: User

Appendix: The following are additional steps. If you want to run the MySQL database on this server, perform the following steps. If you only want PHP to support MySQL extension libraries and connect to MySQL Databases on other servers, you do not need to perform the following two steps.

① Create a directory for storing MySQL Databases
Mkdir-p/data0/mysql/3306/data/
Mkdir-p/data0/mysql/3306/binlog/
Mkdir-p/data0/mysql/3306/relaylog/
Chown-R mysql: mysql/data0/mysql/

② Create a data table as a mysql user account:
/Usr/local/webserver/mysql/bin/mysql_install_db -- basedir =/usr/local/webserver/mysql -- datadir =/data0/mysql/3306/data -- user = mysql

③ Create the my. cnf configuration file:
Vi/data0/mysql/3306/my. cnf
Enter the following content:
Reference [client]
Character-set-server = utf8
Port = 3306
Socket =/tmp/mysql. sock

[Mysqld]
Character-set-server = utf8
Replicate-ignore-db = mysql
Replicate-ignore-db = test
Replicate-ignore-db = information_schema
User = mysql
Port = 3306
Socket =/tmp/mysql. sock
Basedir =/usr/local/webserver/mysql
Datadir =/data0/mysql/3306/data
Log-error =/data0/mysql/3306/mysql_error.log
Pid-file =/data0./mysql/3306/mysql. pid
Open_files_limit = 10240
Back_log = 600
Max_connections = 5000
Max_connect_errorrs = 6000
Table_cache = 614
External-locking = FALSE
Max_allowed_packet = 32 M
Sort_buffer_size = 1 M
Join_buffer_size = 1 M
Thread _ cache_size = 300
# Thread_concurrency = 8
Query_cache_size = 512 M
Query_cache_limit = 2 M
Query_cache_min_res_unit = 2 k
Default-storage-engine = MyISAM
Thread_stack = 192 K
Transaction_isolation = READ-COMMITTED
Tmp_table_size = 246 M
Max_heap_table_size = 246 M
Long_query_time = 3
Log-slave-updates
Log-bin =/data0/mysql/3306/binlog
Binlog_cache_size = 4 M
Binlog_format = MIXED
Max_binlog_cache_size = 8 M
Max_binlog_size = 1G
Relay-log-index =/data0/mysql/3306/relaylog
Relay-log-info-file =/data0/mysql/3306/relaylog
Relay-log =/data0/mysql/3306/relaylog
Expire_logs_days = 30
Key_buffer_size = 256 M
Read_buffer_size = 1 M
Read_rnd_buffer_size = 16 M
Bulk_insert_buffer_size = 64 M
Myisam_sort_buffer_size = 128 M
Myisam_max_sort_file_size = 10G
Myisam_repair_threads = 1
Myisam_recover

Interactive_timeout = 120
Wait_timeout = 120

Skip-name-resolve
# Master-connect-retry = 10
Slave-skip-errors = 1396

# Master-host = 192.168.1.2
# Master-user = username
# Master-password = password
# Master-ports = 3306

Server-id = 1

Innodb_additional_mem_pool_size = 16 M
Innodb_buffer_pool_size = 512 M
Innodb_data_file_path = ibdata1: 256 M: autoextend
Innodb_file_io_threads = 4
Innodb_thread_concurrency = 8
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 16 M
Innodb_log_file_size = 128 M
Innodb_log_files_in_group = 3
Innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_file_per_table = 0

# Log-slow-queries =/data0/mysql/3306/slow. log
# Long_query_time = 10

[Mysqldump]
Quick
Max_allowed_packet = 32 M

  • 1
  • 2
  • Next Page

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.