什么是mariadb?mariadb数据库管理系统是mysql的一个分支,主要由开源社区在维护,采用gpl授权许可。开发这个分支的原因之一是:甲骨文公司收购了mysql后,有将my
配置第一个实例:
#拷贝配置文件
[root@mariadb 3306]# cp ~/tools/mariadb-5.5.25/support-files/my-small.cnf ./my.cnf
#修改配置文件
[root@mariadb 3306]# cat my.cnf
[client]port= 3306socket= /data/3306/mysql.sock[mysql]no-auto-rehash[mysqld]user = mysqlport = 3306socket = /data/3306/mysql.sockbasedir = /application/mariamysqldatadir = /data/3306/dataopen_files_limit = 1024back_log = 600max_connections = 800max_connect_errors = 3000table_cache = 614external-locking = falsemax_allowed_packet =8msort_buffer_size = 1mjoin_buffer_size = 1mthread_cache_size = 100thread_concurrency = 2query_cache_size = 2mquery_cache_limit = 1mquery_cache_min_res_unit = 2k#default_table_type = innodbthread_stack = 192k#transaction_isolation = read-committedtmp_table_size = 2mmax_heap_table_size = 2mlong_query_time = 1#log_long_format#log-error = /data/3306/error.log#log-slow-queries = /data/3306/slow.logpid-file = /data/3306/mysql.pidlog-bin = /data/3306/mysql-binrelay-log = /data/3306/relay-binrelay-log-info-file = /data/3306/relay-log.infobinlog_cache_size = 1mmax_binlog_cache_size = 1mmax_binlog_size = 2mexpire_logs_days = 7key_buffer_size = 16mread_buffer_size = 1mread_rnd_buffer_size = 1mbulk_insert_buffer_size = 1m#myisam_sort_buffer_size = 1m#myisam_max_sort_file_size = 10g#myisam_max_extra_sort_file_size = 10g#myisam_repair_threads = 1#myisam_recoverlower_case_table_names = 1skip-name-resolveslave-skip-errors = 1032,1062replicate-ignore-db=mysqlserver-id = 1innodb_additional_mem_pool_size = 4minnodb_buffer_pool_size = 32minnodb_data_file_path = ibdata1:128m:autoextendinnodb_file_io_threads = 4innodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 2innodb_log_buffer_size = 2minnodb_log_file_size = 4minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120innodb_file_per_table = 0[mysqldump]quickmax_allowed_packet = 2m[mysqld_safe]log-error=/data/3306/mysql_oldboy3306.errpid-file=/data/3306/mysqld.pid
#!/bin/shport=3306mysql_user=rootmysql_pwd=cmdpath=/application/mariamysql/binmysql_sock=/data/${port}/mysql.sock#startup functionfunction_start_mysql(){if [ ! -e $mysql_sock ];thenprintf starting mariamysql...\n/bin/sh ${cmdpath}/mysqld_safe --defaults-file=/data/${port}/my.cnf 2>&1 > /dev/null &elseprintf mariamysql is running...\nexitfi}#stop functionfunction_stop_mysql(){if [ ! -e $mysql_sock ];thenprintf mariamysql is stopped...\nexitelseprintf stoping mariamysql...\n${cmdpath}/mysqladmin -u ${mysql_user} -p${mysql_pwd} -s /data/${port}/mysql.sock shutdown fi}#restart functionfunction_restart_mysql(){printf restarting mariamysql...\nfunction_stop_mysqlsleep 2function_start_mysql}case $1 instart)function_start_mysql;;stop)function_stop_mysql;;restart)function_restart_mysql;;*)printf usage: /data/${port}/mysql {start|stop|restart}\nesac
本文出自 “chocolee” 博客,,请务必保留此出处
