From 5b3dfde9ffc0086edb6d58ed00f8430ca7dfe0b9 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 19 Feb 2017 12:27:15 +0100 Subject: [PATCH] Initial import --- .gitignore | 3 + DOC/README.save-grants | 6 + DOC/Readme.PASSWORD_EXPIRED | 45 + DOC/mysql.txt | 130 ++ Example/logrotate_mysql | 34 + Example/my.cnf | 744 +++++++++ Example/my.cnf.ND.5.1 | 422 +++++ Example/my.cnf.ND.5.5 | 430 +++++ Example/my.cnf.ND.5.6 | 762 +++++++++ Example/my.cnf.ND.5.7 | 769 +++++++++ Example/my.cnf.inoodb | 507 ++++++ Example/mysqld_user.cnf.WWW.OOPEN.DE | 221 +++ install_mysql-5.1.sh | 2126 ++++++++++++++++++++++++ install_mysql-5.5.sh | 2095 +++++++++++++++++++++++ install_mysql-5.6.sh | 2078 +++++++++++++++++++++++ install_mysql-5.7.sh | 2285 ++++++++++++++++++++++++++ stopwords_iso8859-15.txt | 1022 ++++++++++++ stopwords_utf8.txt | 1022 ++++++++++++ stopwords_utf8_iso8859-15.txt | 1159 +++++++++++++ 19 files changed, 15860 insertions(+) create mode 100644 .gitignore create mode 100644 DOC/README.save-grants create mode 100644 DOC/Readme.PASSWORD_EXPIRED create mode 100644 DOC/mysql.txt create mode 100644 Example/logrotate_mysql create mode 100644 Example/my.cnf create mode 100644 Example/my.cnf.ND.5.1 create mode 100644 Example/my.cnf.ND.5.5 create mode 100644 Example/my.cnf.ND.5.6 create mode 100644 Example/my.cnf.ND.5.7 create mode 100644 Example/my.cnf.inoodb create mode 100644 Example/mysqld_user.cnf.WWW.OOPEN.DE create mode 100755 install_mysql-5.1.sh create mode 100755 install_mysql-5.5.sh create mode 100755 install_mysql-5.6.sh create mode 100755 install_mysql-5.7.sh create mode 100644 stopwords_iso8859-15.txt create mode 100644 stopwords_utf8.txt create mode 100644 stopwords_utf8_iso8859-15.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8289140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/BAK/* +/log* +/mysql** diff --git a/DOC/README.save-grants b/DOC/README.save-grants new file mode 100644 index 0000000..550eee3 --- /dev/null +++ b/DOC/README.save-grants @@ -0,0 +1,6 @@ + +## - ---------------------------------------------------------------- +## - Datenbank User und deren Rechte auslesen +## - ---------------------------------------------------------------- +mysql -uroot -pbuz111 mysql --skip-column-name -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>'';" | mysql -uroot -pbuz111 mysql --skip-column-name -A | sed 's/$/;/g' > ~/mysql-grants.sql + diff --git a/DOC/Readme.PASSWORD_EXPIRED b/DOC/Readme.PASSWORD_EXPIRED new file mode 100644 index 0000000..823913b --- /dev/null +++ b/DOC/Readme.PASSWORD_EXPIRED @@ -0,0 +1,45 @@ + +Fehrelmeldung: + +mysqladmin: connect to server at 'localhost' failed +error: 'Your password has expired. To log in you must change it using a client that supports expired passwords.' + + +Password Expiration Policy +========================== + +# default_password_lifetime +# +# This variable defines the global automatic password expiration policy. It applies +# to accounts that use MySQL built-in authentication methods (accounts that use an +# authentication plugin of mysql_native_password, mysql_old_password, or sha256_password). +# +# The default default_password_lifetime value is 0, which disables automatic password +# expiration. If the value of default_password_lifetime is a positive integer N, it +# indicates the permitted password lifetime; passwords must be changed every N days. + +# The global password expiration policy can be overridden as desired for individual +# accounts using the ALTER USER statement. See Section 7.3.6, “Password Expiration Policy”. +# +# ! Note ! +# +# From MySQL 5.7.4 to 5.7.10, the default default_password_lifetime value is 360 (passwords +# must be changed approximately once per year). For those versions, be aware that, if you +# make no changes to the default_password_lifetime variable or to individual user accounts, +# all user passwords will expire after 360 days, and all user accounts will start running +# in restricted mode when this happens. Clients (which are effectively users) connecting to +# the server will then get an error indicating that the password must be changed: +# ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing +# this statement. + +# However, this is easy to miss for clients that automatically connect to the server, such +# as connections made from scripts. To avoid having such clients suddenly stop working due +# to a password expiring, make sure to change the password expiration settings for those clients, +# like this: +# +# ALTER USER 'script'@'localhost' PASSWORD EXPIRE NEVER +# +# Alternatively, set the default_password_lifetime variable to 0, thus disabling automatic +# password expiration for all users. +# +default_password_lifetime = 0 diff --git a/DOC/mysql.txt b/DOC/mysql.txt new file mode 100644 index 0000000..26872b4 --- /dev/null +++ b/DOC/mysql.txt @@ -0,0 +1,130 @@ +## - ---------------------------------------------------------------- +## - MySql Superuser anlegen +## - ---------------------------------------------------------------- + +## - Bemerkung: +## - Das Passwort wird verschlsselt abgespeichert + +## - Von berall: +## - +GRANT ALL PRIVILEGES ON *.* TO 'admin' IDENTIFIED BY 'Nyz!aB2u' WITH GRANT OPTION ; +FLUSH PRIVILEGES; + +## - Nur von loacalhost +## - +GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'Nyz!aB2u' WITH GRANT OPTION ; +FLUSH PRIVILEGES; + + + +## - ---------------------------------------------------------------- +## - Dantenbank anlegen, User anlegen mit vollen Rechten auf der Datenbank +## - ---------------------------------------------------------------- + +CREATE DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci; +GRANT ALL ON new_db.* TO 'new_user'@'localhost' IDENTIFIED BY 'password'; +FLUSH PRIVILEGES; + + +## - Dantenbank anlegen, User mit eingeschrenkten Rechten auf der Datenbank +## - +## - Beispiel: vpopmail +## - +CREATE DATABASE vpopmail; +GRANT select,insert,update,delete,create,drop ON vpopmail.* TO 'vpop'@'localhost' IDENTIFIED BY 'r23myzmx'; +FLUSH PRIVILEGES; + + +## - ---------------------------------------------------------------- +## - Zeige alle Views einer Datenbank +## - ---------------------------------------------------------------- + +SHOW FULL TABLES IN WHERE TABLE_TYPE LIKE 'VIEW' + + +## - ---------------------------------------------------------------- +## - Zeige Definition eines Views +## - ---------------------------------------------------------------- + +show CREATE VIEW ; + + +## - ---------------------------------------------------------------- +## - Datenbank User und deren Rechte auslesen +## - ---------------------------------------------------------------- +mysql -uroot -pbuz111 mysql --skip-column-name -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user<>'';" | mysql -uroot -pbuz111 mysql --skip-column-name -A | sed 's/$/;/g' > ~/mysql-grants.sql + + + +## - ---------------------------------------------------------------- +## - Convert databese from current latin1 to utf8 +## - ---------------------------------------------------------------- + +db_name= +db_user= +db_pass= + +old_charset=latin1 +#old_collate=latin1_swedish_ci - NOT NEEDED +new_charset=utf8 +new_collate=utf8_unicode_ci + +## - 1.) dump the databse as follows: +dumpfile=${db_name}-${old_charset}.`date +%Y%m%d-%H%M`.sql +mysqldump -u$db_user -p$db_pass --set-charset --skip-set-charset --add-drop-table $db_name > $dumpfile + +## - 2.) change character settings on mysql monitor +query="ALTER DATABASE \`$db_name\` DEFAULT CHARACTER SET $new_charset DEFAULT COLLATE $new_collate;" +mysql -u$db_user -p$db_pass $db_name -e "$query" + +## - 3.) Load he dumpfile +mysql -u$db_user -p$db_pass --default-character-set=$old_charset $db_name < $dumpfile + +## - 4.) show result +mysql -u$db_user -p$db_pass $db_name -e "SHOW CREATE DATABASE $db_name\G" + + + +-------------------------------------------------------------------------------------------------- + +## - dump database WITHOUT CREATE TABLE Statements - useful, if you +## - want add entries into existing tables of an existing database, +## - i.e. database "mysql" +## - +mysqldump -uroot -p --add-locks --disable-keys --extended-insert \ + --lock-tables --quick --set-charset --no-create-info mysql > db_mysql.sql + +## - durmp table "user" from database mysql without CREATE TABLE statment +## - +mysqldump -uroot -pbuz111 --add-locks --disable-keys --extended-insert --lock-tables --quick --set-charset --no-create-info mysql user | sed 's#),(#);\n(#g' | sed 's#^(#INSERT INTO `user` VALUES (#' > mysql-user.sql + + +## - restore +mysql -uroot -pbuz111 -f mysql < mysql-user.sql + + + +-------------------------------------------------------------------------------------------------- + + +## charset fr den MySQL monitor einstellen +## +mysql> SET CHARACTER SET UTF8; +## bzw. +mysql> \C utf8 + + +## zeige Server-Konfiguration +## +mysql> SHOW VARIABLES; + +mysql> SHOW /*!50000 global */ VARIABLES ; +mysql> SHOW /*!50000 global */ VARIABLES LIKE "%slow%"; + + +## - Zeige Sever Status +## - +mysql> SHOW STATUS ; + +mysql> SHOW /*!50000 global */ STATUS ; +mysql> SHOW /*!50000 global */ STATUS LIKE "slow%"; diff --git a/Example/logrotate_mysql b/Example/logrotate_mysql new file mode 100644 index 0000000..5e0bdf4 --- /dev/null +++ b/Example/logrotate_mysql @@ -0,0 +1,34 @@ +/var/log/mysql/mysql.log +/var/log/mysql/mysql.err +/var/log/mysql/slow_query.log +{ + daily + rotate 7 + missingok + create 640 mysql mysql + compress + sharedscripts + postrotate + ## - Credential File /usr/local/mysql/sys-maint.cnf might look like: + ## - + ## - [client] + ## - host = localhost + ## - user = sys-maint + ## - password = YbuswBqxHLZtw10t + ## - socket = /tmp/mysql.sock + ## - [mysql_upgrade] + ## - host = localhost + ## - user = sys-maint + ## - password = YbuswBqxHLZtw10t + ## - socket = /tmp/mysql.sock + ## - basedir = /usr + ## - + MYSQL="/usr/local/mysql/bin/mysql --defaults-file=/usr/local/mysql/sys-maint.cnf" + MYADMIN="/usr/local/mysql/bin/mysqladmin --defaults-file=/usr/local/mysql/sys-maint.cnf" + if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then + echo "Warning: no mysqld running or missing sys-maint user?" + else + $MYSQL -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2); FLUSH LOGS; select sleep(2); set global long_query_time=@lqt_save;' > /dev/null + fi + endscript +} diff --git a/Example/my.cnf b/Example/my.cnf new file mode 100644 index 0000000..c1d7e53 --- /dev/null +++ b/Example/my.cnf @@ -0,0 +1,744 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = 3306 +socket = /tmp/mysql.sock + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /tmp/mysql.sock +nice = 0 + + +# The MySQL server +[mysqld] +port = 3306 +socket = /tmp/mysql.sock + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +#bind-address = 127.0.0.1 +bind-address = 127.0.0.1 + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=/usr/local/mysql/share +## - #lc-messages-dir=/usr/share/mysql +## - +## - bis 5.1.x +## - +## - language=/usr/local/mysql/share/german +## - #language=/usr/share/mysql/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = 8192 + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +sort_buffer_size = 2M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +key_buffer_size = 384M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +read_buffer_size = 2M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 4M +max_allowed_packet = 32M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +table_open_cache = 512 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +#table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 16 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +thread_cache_size = 8 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = /var/log/mysql/mysql.err + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local//mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 128M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Default: 16777216 (16M) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + diff --git a/Example/my.cnf.ND.5.1 b/Example/my.cnf.ND.5.1 new file mode 100644 index 0000000..f73d61a --- /dev/null +++ b/Example/my.cnf.ND.5.1 @@ -0,0 +1,422 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +#password = your_password +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +port = 3306 +socket = /var/run/mysqld/mysqld.sock +skip-external-locking +key_buffer_size = 384M +max_allowed_packet = 1M +table_open_cache = 512 +sort_buffer_size = 2M +read_buffer_size = 2M +read_rnd_buffer_size = 8M +myisam_sort_buffer_size = 64M +thread_cache_size = 8 +query_cache_size = 32M +# Try number of CPU's*2 for thread_concurrency +thread_concurrency = 8 + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + +# Uncomment the following if you are using InnoDB tables +#innodb_data_home_dir = /var/lib/mysql/ +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend +#innodb_log_group_home_dir = /var/lib/mysql/ +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +#innodb_buffer_pool_size = 384M +#innodb_additional_mem_pool_size = 20M +# Set .._log_file_size to 25 % of buffer pool size +#innodb_log_file_size = 100M +#innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +#innodb_lock_wait_timeout = 50 + + +## ------------------------------------------ +## - angepasste Einstellungen + + +sort_buffer_size = 2M +key_buffer_size = 256M + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = 4096 + +table_open_cache = 1024 +table_definition_cache = 512 + +max_connect_errors = 999999 + +# Try number of CPU's*2 for thread_concurrency +thread_concurrency = 16 +thread_cache_size = 32 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +skip-innodb + + + +log-error = /var/log/mysql/error.log + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +ft_stopword_file = /etc/mysql/stop_words_utf-8_latin9.txt + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +max_connections = 500 + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +##query_cache_limit = 4M +query_cache_limit = 8M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 512M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +log_queries_not_using_indexes = 1 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +join_buffer_size = 384K + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout diff --git a/Example/my.cnf.ND.5.5 b/Example/my.cnf.ND.5.5 new file mode 100644 index 0000000..35ab631 --- /dev/null +++ b/Example/my.cnf.ND.5.5 @@ -0,0 +1,430 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +#password = your_password +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /var/run/mysqld/mysqld.sock +nice = 0 + + +# The MySQL server +[mysqld] +port = 3306 +socket = /var/run/mysqld/mysqld.sock +skip-external-locking +key_buffer_size = 384M +max_allowed_packet = 1M +table_open_cache = 512 +sort_buffer_size = 2M +read_buffer_size = 2M +read_rnd_buffer_size = 8M +myisam_sort_buffer_size = 64M +thread_cache_size = 8 +query_cache_size = 32M +# Try number of CPU's*2 for thread_concurrency +thread_concurrency = 8 + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + +# Uncomment the following if you are using InnoDB tables +#innodb_data_home_dir = /var/lib/mysql/ +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend +#innodb_log_group_home_dir = /var/lib/mysql/ +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +#innodb_buffer_pool_size = 384M +#innodb_additional_mem_pool_size = 20M +# Set .._log_file_size to 25 % of buffer pool size +#innodb_log_file_size = 100M +#innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +#innodb_lock_wait_timeout = 50 + + +## ------------------------------------------ +## - angepasste Einstellungen + + +sort_buffer_size = 2M +key_buffer_size = 256M + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = 8192 + +table_open_cache = 2560 +table_definition_cache = 512 + +max_connect_errors = 999999 + +# Try number of CPU's*2 for thread_concurrency +thread_concurrency = 16 +thread_cache_size = 32 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +default-storage-engine=MyISAM +skip-innodb + + + +log-error = /var/log/mysql/error.log + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +ft_stopword_file = /etc/mysql/stop_words_utf-8_latin9.txt + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +max_connections = 500 + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +##query_cache_limit = 4M +query_cache_limit = 8M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 512M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +log_queries_not_using_indexes = 1 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +join_buffer_size = 384K + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout diff --git a/Example/my.cnf.ND.5.6 b/Example/my.cnf.ND.5.6 new file mode 100644 index 0000000..765eb89 --- /dev/null +++ b/Example/my.cnf.ND.5.6 @@ -0,0 +1,762 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = 3306 +socket = /tmp/mysql.sock + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /tmp/mysql.sock +nice = 0 + + +# The MySQL server +[mysqld] +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 500 +max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=/usr/local/mysql/share +## - #lc-messages-dir=/usr/share/mysql +## - +## - bis 5.1.x +## - +## - language=/usr/local/mysql/share/german +## - #language=/usr/share/mysql/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +#open-files-limit = 8192 +open-files-limit = 16384 + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +#sort_buffer_size = 2M +#sort_buffer_size = 4M +sort_buffer_size = 16M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +#key_buffer_size = 384M +key_buffer_size = 512M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +#read_buffer_size = 2M +read_buffer_size= 8M +#read_buffer_size=16M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 1M +max_allowed_packet = 64M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +#table_open_cache = 512 +table_open_cache = 2560 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 32 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +#thread_cache_size = 8 +thread_cache_size = 32 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = /var/log/mysql/error.log + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +ft_stopword_file = /usr/local//mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +##query_cache_limit = 4M +#query_cache_limit = 8M +query_cache_limit = 16M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +#query_cache_size = 512M +#query_cache_size = 768M +query_cache_size = 1024M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K +#join_buffer_size = 512K +join_buffer_size = 1M + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M +#max_heap_table_size = 256M +#max_heap_table_size = 384M +#max_heap_table_size = 768M +#max_heap_table_size = 1024M +max_heap_table_size = 2048M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M +#tmp_table_size = 256M +#tmp_table_size = 512M +#tmp_table_size = 768M +#tmp_table_size = 1024M +tmp_table_size = 2048M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +#max_allowed_packet = 16M +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + diff --git a/Example/my.cnf.ND.5.7 b/Example/my.cnf.ND.5.7 new file mode 100644 index 0000000..2e9f0d2 --- /dev/null +++ b/Example/my.cnf.ND.5.7 @@ -0,0 +1,769 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = 3306 +socket = /tmp/mysql.sock + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /tmp/mysql.sock +nice = 0 + + +# The MySQL server +[mysqld] +port = 3306 +socket = /tmp/mysql.sock + +sql_mode = 'ONLY_FULL_GROUP_BY,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 500 +max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=/usr/local/mysql/share +## - #lc-messages-dir=/usr/share/mysql +## - +## - bis 5.1.x +## - +## - language=/usr/local/mysql/share/german +## - #language=/usr/share/mysql/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +#open-files-limit = 8192 +open-files-limit = 16384 +#open_files_limit = 32768 + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +#sort_buffer_size = 2M +#sort_buffer_size = 4M +sort_buffer_size = 16M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +#key_buffer_size = 384M +key_buffer_size = 512M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +#read_buffer_size = 2M +read_buffer_size= 8M +#read_buffer_size=16M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 1M +max_allowed_packet = 64M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +#table_open_cache = 512 +table_open_cache = 2560 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 32 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +#thread_cache_size = 8 +thread_cache_size = 32 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +#log-error = /var/log/mysql/error.log +log-error = /var/log/mysql/mysql.err + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +##query_cache_limit = 4M +#query_cache_limit = 8M +query_cache_limit = 16M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +#query_cache_size = 512M +#query_cache_size = 768M +query_cache_size = 1024M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K +#join_buffer_size = 512K +join_buffer_size = 1M + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M +#max_heap_table_size = 256M +#max_heap_table_size = 384M +#max_heap_table_size = 768M +#max_heap_table_size = 1024M +max_heap_table_size = 2048M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M +#tmp_table_size = 256M +#tmp_table_size = 512M +#tmp_table_size = 768M +#tmp_table_size = 1024M +tmp_table_size = 2048M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +#max_allowed_packet = 16M +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + + +sql_mode='ONLY_FULL_GROUP_BY,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' + diff --git a/Example/my.cnf.inoodb b/Example/my.cnf.inoodb new file mode 100644 index 0000000..22222c4 --- /dev/null +++ b/Example/my.cnf.inoodb @@ -0,0 +1,507 @@ +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# MySQL programs look for option files in a set of +# locations which depend on the deployment platform. +# You can copy this option file to one of those +# locations. For information about these locations, see: +# http://dev.mysql.com/doc/mysql/en/option-files.html +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +#password = your_password +port = 3306 +socket = /tmp/mysql.sock + +# Here follows entries for some specific programs + +# The MySQL server +[mysqld] +port = 3306 +socket = /tmp/mysql.sock +skip-external-locking +key_buffer_size = 384M +max_allowed_packet = 1M +table_open_cache = 512 +sort_buffer_size = 2M +read_buffer_size = 2M +read_rnd_buffer_size = 8M +myisam_sort_buffer_size = 64M +thread_cache_size = 8 +query_cache_size = 32M +# Try number of CPU's*2 for thread_concurrency +thread_concurrency = 8 + + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Uncomment the following if you are using InnoDB tables +#innodb_data_home_dir = @localstatedir@ +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend +#innodb_log_group_home_dir = @localstatedir@ +# You can set .._buffer_pool_size up to 50 - 80 % +# of RAM but beware of setting memory usage too high +#innodb_buffer_pool_size = 384M +#innodb_additional_mem_pool_size = 20M +# Set .._log_file_size to 25 % of buffer pool size +#innodb_log_file_size = 100M +#innodb_log_buffer_size = 8M +#innodb_flush_log_at_trx_commit = 1 +#innodb_lock_wait_timeout = 50 + + + + +## ------------------------------------------ +## - angepasste Einstellungen + + +## - In case of using InnoDB tables +## - +#innodb_file_per_table +#innodb_buffer_pool_size = 1024M +#innodb_additional_mem_pool_size = 40M +#innodb_log_file_size = 256M +#innodb_log_buffer_size = 32M +### - In case of extrem slowly restores set +### - +### - innodb_flush_log_at_trx_commit = 2 +### - innodb_log_file_size = 256M +### - +### - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +### - +### - ... +### - SET FOREIGN_KEY_CHECKS=0; +### - SET unique_checks=0; +### - SET AUTOCOMMIT=0; +### - +### - DROP TABLE IF EXISTS.. +### - ... +### - +##innodb_flush_log_at_trx_commit = 2 +#innodb_flush_log_at_trx_commit = 1 +#innodb_lock_wait_timeout = 50 + +sort_buffer_size = 2M +key_buffer_size = 384M + + +max_allowed_packet = 64M + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +bind-address = 127.0.0.1 + + +## - Since MySQL Version 5.6.6 +## - +explicit_defaults_for_timestamp = true + + +## - MySQL Fehlermeldungen +## - +#lc-messages=de_DE +#lc-messages-dir=/usr/local/mysql/share + + +## - Loggt Startup Messages und Fehler +## - +log-error = /var/log/mysql/mysql.err + +## - Query Log +## - +#general-log = on +#general_log_file = /var/log/mysql/mysql.log + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = 8192 + +#table_open_cache = 2560 +#table_definition_cache = 512 + +max_connect_errors = 999999 + +# Try number of CPU's*2 for thread_concurrency +#thread_concurrency = 16 +thread_concurrency = 16 +#thread_cache_size = 32 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 500 + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M +#query_cache_limit = 8M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +query_cache_size = 128M +#query_cache_size = 768M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/slow_query.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +log_queries_not_using_indexes = 1 + +## - Ende: slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K +#join_buffer_size = 512K + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +max_heap_table_size = 32M +#max_heap_table_size = 256M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +#tmp_table_size = 96M +#tmp_table_size = 256M +#tmp_table_size = 512M + + +## - angepasste Einstellungen +## ------------------------------------------ + + + + +[mysqldump] +quick +max_allowed_packet = 16M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + +[mysqlhotcopy] +interactive-timeout diff --git a/Example/mysqld_user.cnf.WWW.OOPEN.DE b/Example/mysqld_user.cnf.WWW.OOPEN.DE new file mode 100644 index 0000000..49ff840 --- /dev/null +++ b/Example/mysqld_user.cnf.WWW.OOPEN.DE @@ -0,0 +1,221 @@ +## - Settings +## - +## - !! Take care to add line +## - +## - !includedir /etc/mysql/conf.d/ +## - +## - at the end of file my.cnf +## - +[mysqld] + +log-error = /var/log/mysql/error.log + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - !! Mybe you have also create file /etc/vservers/*/ulimits/nofiles.hard +## - with the same contents: +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = 2048 + +table_open_cache = 768 +table_definition_cache = 768 + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +ft_stopword_file = /etc/mysql/stop_words_utf-8_latin9.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +query_cache_size = 64M + +## - Ende: query cache +## ------------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = /var/log/mysql/mysql-slow.log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +log_queries_not_using_indexes = 1 + +## - Ende: slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +join_buffer_size = 256K + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +max_heap_table_size = 32M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Vorgabewert ist systemabhängig /16 M auf dem ND Server) +## - +tmp_table_size = 32M diff --git a/install_mysql-5.1.sh b/install_mysql-5.1.sh new file mode 100755 index 0000000..4fb85de --- /dev/null +++ b/install_mysql-5.1.sh @@ -0,0 +1,2126 @@ +#!/usr/bin/env bash + +_MYSQL_VERSION=5.1.72 + +_MYSQL_SRC_BASE_DIR=/usr/local/src/mysql + +_MYSQL_LOG_DIR=/var/log/mysql + +_MYSQL_PORT=3306 +_MYSQL_UNIX_SOCKET=/tmp/mysql.sock + + +_MYSQL_USER=mysql +_MYSQL_GROUP=mysql + +_DISTRIBUTION=Debian + + +## - Let make use multiple cores (-j) +## - +export MAKEFLAGS=-j$(expr `grep "^processor" /proc/cpuinfo | sort -u | wc -l` + 1) + + +## --- Some functions +## --- +echononl(){ + echo X\\c > /tmp/shprompt$$ + if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then + echo "$*\\c" 1>&2 + else + echo -e -n "$*" 1>&2 + fi + rm /tmp/shprompt$$ +} + +fatal(){ + echo "" + echo -e "fataler Fehler: $*" + echo "" + echo -e "\t\033[31m\033[1mInstalllation wird abgebrochen\033[m\033[m" + echo "" + exit 1 +} + +error(){ + echo "" + echo -e "\t[ \033[31m\033[1mFehler\033[m ]: $*" + echo "" +} + +warn (){ + echo "" + echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" + echo "" +} + + +echo_ok() { + echo -e "\033[75G[ \033[32mok\033[m ]" + ## echo -e " [ ok ]" +} +echo_failed(){ + echo -e "\033[75G[ \033[1;31mfailed\033[m ]" + ## echo -e " [ failed ]" +} +echo_skipped() { + echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" +} +## --- +## --- END: functions + +_curdir=`pwd` + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo + +## - root user? +## - +if [ "$(id -u)" != "0" ]; then + fatal Skript muss als \"root\" ausgeführt werden +fi + +DISTRIBUTION= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Um welche Linux Distribution handelt es sich?" +echo "" +echo "[1] Debian" +echo "[2] andere" +echo "" +echononl "Eingabe: " + +while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do + read OPTION + case $OPTION in + 1) DISTRIBUTION="Debian" + ;; + 2) DISTRIBUTION="other" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Eingabe:" + ;; + esac +done + +_UPDATE_MYSQL="" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Soll eine vorhanden MySQL Installation geupdateted werden?" +echo "" +echo "[1] Neuinstallation" +echo "[2] Update vorhandener Installation" +echo "" +echononl "Eingabe: " + + +while [ "$_UPDATE_MYSQL" != "update" -a "$_UPDATE_MYSQL" != "new" ];do + read OPTION + case $OPTION in + 1) _UPDATE_MYSQL="new" + ;; + 2) _UPDATE_MYSQL="update" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$_UPDATE_MYSQL" = "update" ];then + UPDATE_MYSQL=true +else + UPDATE_MYSQL=false +fi + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib die Versionsnummer der MySQL-Distribution an." +echo "" +MYSQL_VERSION= +while [ "X$MYSQL_VERSION" = "X" ] +do + echononl "MySQL Version [$_MYSQL_VERSION]: " + read MYSQL_VERSION + if [ "X$MYSQL_VERSION" = "X" ]; then + MYSQL_VERSION=$_MYSQL_VERSION + fi + + _MYSQL_INSTALL_DIR=/usr/local/mysql-$MYSQL_VERSION + _MYSQL_DATA_DIR=/data/mysql-$MYSQL_VERSION + distfile=mysql-${MYSQL_VERSION}.tar.gz +done +MYSQL_MAJOR_VERSION=`echo $MYSQL_VERSION | cut -d '.' -f1,2` + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des MySQL Sourceverzeichnisses an." +echo "" +MYSQL_SRC_BASE_DIR= +while [ "X$MYSQL_SRC_BASE_DIR" = "X" ] +do + echononl "MySQL Sourceverzeichnis [${_MYSQL_SRC_BASE_DIR}]: " + read MYSQL_SRC_BASE_DIR + if [ "X$MYSQL_SRC_BASE_DIR" = "X" ]; then + MYSQL_SRC_BASE_DIR=$_MYSQL_SRC_BASE_DIR + fi +done +MYSQL_SRC_DIR=${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses in das MySQL installiert werden soll an." +echo "" +MYSQL_INSTALL_DIR= +while [ "X$MYSQL_INSTALL_DIR" = "X" ] +do + echononl "MySQL Installationsverzeichnis [${_MYSQL_INSTALL_DIR}]: " + read MYSQL_INSTALL_DIR + if [ "X$MYSQL_INSTALL_DIR" = "X" ]; then + MYSQL_INSTALL_DIR=$_MYSQL_INSTALL_DIR + LINK=yes + fi + + logdir=${MYSQL_SRC_BASE_DIR}/log-$MYSQL_VERSION + +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses für die MySQL-Datenbanken an." +echo "" +MYSQL_DATA_DIR= +while [ "X$MYSQL_DATA_DIR" = "X" ] +do + echononl "MySQL Datenbankverzeichnis [$_MYSQL_DATA_DIR]: " + read MYSQL_DATA_DIR + if [ "X$MYSQL_DATA_DIR" = "X" ]; then + MYSQL_DATA_DIR=$_MYSQL_DATA_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des LOG-Verzeichnisses für die MySQL an. !! NICHT für binäre logfiles !!" +echo "" +MYSQL_LOG_DIR= +while [ "X$MYSQL_LOG_DIR" = "X" ] +do + echononl "MySQL LOG Verzeichniss [$_MYSQL_LOG_DIR]: " + read MYSQL_LOG_DIR + if [ "X$MYSQL_LOG_DIR" = "X" ]; then + MYSQL_LOG_DIR=$_MYSQL_LOG_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den TCP Port für MySQL an (voreingestell \"${MYSQL_PORT}\")." +echo "" +MYSQL_PORT= +while [ "X$MYSQL_PORT" = "X" ] +do + echononl "MySQL TCP Port [$_MYSQL_PORT]: " + read MYSQL_PORT + if [ "X$MYSQL_PORT" = "X" ]; then + MYSQL_PORT=$_MYSQL_PORT + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Unix Socket für MySQL an (voreingestell \"${_MYSQL_UNIX_SOCKET}\")." +echo "" +MYSQL_UNIX_SOCKET= +while [ "X$MYSQL_UNIX_SOCKET" = "X" ] +do + echononl "MySQL UNIX Socket [$_MYSQL_UNIX_SOCKET]: " + read MYSQL_UNIX_SOCKET + if [ "X$MYSQL_UNIX_SOCKET" = "X" ]; then + MYSQL_UNIX_SOCKET=$_MYSQL_UNIX_SOCKET + fi +done + +echo "" +echo "--" +echo "" +echo "Gib den User-Namen und die User-Gruppe unter dem der MySQL-Daemon laufen soll an." +echo "" +MYSQL_USER= +while [ "X$MYSQL_USER" = "X" ] +do + echononl "MySQL-User [${_MYSQL_USER}]: " + read MYSQL_USER + if [ "X$MYSQL_USER" = "X" ]; then + MYSQL_USER=$_MYSQL_USER + fi +done +MYSQL_GROUP= +while [ "X$MYSQL_GROUP" = "X" ] +do + echononl "MySQL-Gruppe [$MYSQL_USER]: " + read MYSQL_GROUP + if [ "X$MYSQL_GROUP" = "X" ]; then + MYSQL_GROUP=$MYSQL_USER + fi +done + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib ein Passwort für den root user an.." +echo "" +_MYSQL_ROOT_PW_1="X" +_MYSQL_ROOT_PW_2="Y" +while [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ] +do + echononl "Passworteingabe: " + read -s _MYSQL_ROOT_PW_1 + echo + if [ "X$_MYSQL_ROOT_PW_1" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPassworteingabe erforderlich!\033[m\n" + continue + fi + echononl "Passwortwiederholung: " + read -s _MYSQL_ROOT_PW_2 + echo + if [ "X$_MYSQL_ROOT_PW_2" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPasswortwiederholung erforderlich!\033[m\n" + continue + fi + if [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ];then + echo -e "\n\t\033[33m\033[1mPassworteingaben sind nicht identisch!\033[m\n" + else + MYSQL_ROOT_PW=$_MYSQL_ROOT_PW_1 + fi +done + +if $UPDATE_MYSQL ; then + __SYMLINK_INITSCRIPT=nein + __SYMLINK_INSTALL_DIR=nein + __SYMLINK_DATA_DIR=nein +else + __SYMLINK_INITSCRIPT=ja + __SYMLINK_INSTALL_DIR=ja + __SYMLINK_DATA_DIR=ja +fi + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Symlinks:" +echo "" +echo " - Setze Symlink für das Init Skript (/etc/init.d/mysql.server)" +echo " - Setze Sysmlink for das Installationsverzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql" +echo " - Setze Sysmlink for das Datenverzeichnis `dirname $MYSQL_DATA_DIR`/mysql" +echo "" +_SYMLINK_INITSCRIPT="" +echononl "Sysmlink für das Init Skript? (ja/nein) [${__SYMLINK_INITSCRIPT}]: " +read _SYMLINK_INITSCRIPT +if [ "X$_SYMLINK_INITSCRIPT" = "X" ];then + _SYMLINK_INITSCRIPT=$__SYMLINK_INITSCRIPT +fi + +while [ "$_SYMLINK_INITSCRIPT" != "ja" \ + -a "$_SYMLINK_INITSCRIPT" != "Ja" \ + -a "$_SYMLINK_INITSCRIPT" != "nein" \ + -a "$_SYMLINK_INITSCRIPT" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INITSCRIPT +done +if [ "$_SYMLINK_INITSCRIPT" = "ja" -o "$_SYMLINK_INITSCRIPT" = "Ja" ]; then + SYMLINK_INITSCRIPT=true +else + SYMLINK_INITSCRIPT=false +fi + +echo "" +_SYMLINK_INSTALL_DIR="" +echononl "Sysmlink für das Installationsverzeichnis? (ja/nein) [${__SYMLINK_INSTALL_DIR}]: " +read _SYMLINK_INSTALL_DIR +if [ "X$_SYMLINK_INSTALL_DIR" = "X" ];then + _SYMLINK_INSTALL_DIR=$__SYMLINK_INSTALL_DIR +fi + +while [ "$_SYMLINK_INSTALL_DIR" != "ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "Ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "nein" \ + -a "$_SYMLINK_INSTALL_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INSTALL_DIR +done +if [ "$_SYMLINK_INSTALL_DIR" = "ja" -o "$_SYMLINK_INSTALL_DIR" = "Ja" ]; then + SYMLINK_INSTALL_DIR=true +else + SYMLINK_INSTALL_DIR=false +fi + +echo "" +_SYMLINK_DATA_DIR="" +echononl "Sysmlink für das Datenverzeichnis? (ja/nein) [${__SYMLINK_DATA_DIR}]: " +read _SYMLINK_DATA_DIR +if [ "X$_SYMLINK_DATA_DIR" = "X" ];then + _SYMLINK_DATA_DIR=$__SYMLINK_DATA_DIR +fi + +while [ "$_SYMLINK_DATA_DIR" != "ja" \ + -a "$_SYMLINK_DATA_DIR" != "Ja" \ + -a "$_SYMLINK_DATA_DIR" != "nein" \ + -a "$_SYMLINK_DATA_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_DATA_DIR +done +if [ "$_SYMLINK_DATA_DIR" = "ja" -o "$_SYMLINK_DATA_DIR" = "Ja" ]; then + SYMLINK_DATA_DIR=true +else + SYMLINK_DATA_DIR=false +fi + +## - Is this a system with "systemd" ? +## - +if [ "X`which systemd`" = "X" ]; then + SYSTEMD_EXISTS=false +else + SYSTEMD_EXISTS=true +fi + +echo "" + +echo "" +clear +echo -e "\033[21G\033[32mStarte Installation mit folgenden Parametern:\033[m" +echo "" +if ! $UPDATE_MYSQL ; then + echo -e "-- \033[33m\033[1mNeusistallation\033[m --" +else + echo -e "-- \033[33m\033[1mUpdate\033[m (Erstzen einer vorhandenen Installation) --" +fi +echo "" +echo "Linuxdistribution.........: $DISTRIBUTION" +echo "" +echo "MySQL Versionsnummer......: $MYSQL_VERSION" +echo " MySQL Major Verion......: $MYSQL_MAJOR_VERSION" +echo "" +echo "Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" +echo "Installationsverzeichnis..: $MYSQL_INSTALL_DIR" +echo "Datenbankverzeichnis......: $MYSQL_DATA_DIR" +echo "Log Verzeichnis...........: $MYSQL_LOG_DIR" +echo "TCP Port..................: $MYSQL_PORT" +echo "Unix Socket...............: $MYSQL_UNIX_SOCKET" +echo "MySQL-User................: $MYSQL_USER" +echo "MySQL-Gruppe..............: $MYSQL_GROUP" +echo "" +echo "Symlink Initskript........: $SYMLINK_INITSCRIPT" +echo "Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" +echo "Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" +echo "" +echo "" +echononl "einverstanden [ja/nein]: " +read OK +while [ "X$OK" != "Xja" -a "X$OK" != "XJa" -a "X$OK" != "Xnein" -a "X$OK" != "XNein" ] +do + echononl "falsche Angabe! [ja/nein]: " + read OK +done +[ $OK = "ja" -o $OK = "Ja" ] || fatal wiederhole Installation zur Eingabe anderer Parameter + + + +## - Sorcecode Verzeichnis vorhanden? +## - +if [ ! -d ${MYSQL_SRC_BASE_DIR} ] ; then + fatal "Kann MySQL Sourcecode Verzeichnis \"${MYSQL_SRC_BASE_DIR}\" nicht finden." +fi + + +## - Sorcecode vorhanden? +## - +if [ ! -f ${MYSQL_SRC_BASE_DIR}/$distfile ] ; then + + echo "" + + echononl "Download $distfile ..." + wget -O ${MYSQL_SRC_BASE_DIR}/$distfile https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile 2>/dev/null + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Downloading $distfile (https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile) Fehlgeschlagen." + fi +fi + +echo "" + + +## - Erstelle Logverzeichnis +## - +if [ -d $logdir ]; then + echononl "Verschiebe exitierendes Logverzeichnis ..." + mv $logdir $logdir.`date +"%Y%m%d-%H%M"` + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht verschieben.. + fi +fi + +echononl "Erstelle Logverzeichnis \"${logdir}\".." +mkdir -p $logdir > /dev/null 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht erstellen.. +fi +touch ${logdir}/main.log +echo -e "## - Starte Installation mit folgenden Parametern:" >> ${logdir}/main.log +echo "## -" >> ${logdir}/main.log +if ! $UPDATE_MYSQL ; then + echo "## - Neusistallation" >> ${logdir}/main.log +else + echo "## - Update (Erstzen einer vorhandenen Installation)" >> ${logdir}/main.log +fi +echo "## -" >> ${logdir}/main.log +echo "## - Linuxdistribution.........: $DISTRIBUTION" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - MySQL Versionsnummer......: $MYSQL_VERSION" >> ${logdir}/main.log +echo "## - MySQL Major Verion.....: $MYSQL_MAJOR_VERSION" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "## - Installationsverzeichnis..: $MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Datenbankverzeichnis......: $MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "## - Log Verzeichnis...........: $MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "## - TCP Port..................: $MYSQL_PORT" >> ${logdir}/main.log +echo "## - Unix Socket...............: $MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "## - MySQL-User................: $MYSQL_USER" >> ${logdir}/main.log +echo "## - MySQL-Gruppe..............: $MYSQL_GROUP" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Symlink Initskript........: $SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "## - Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +echo "UPDATE_MYSQL=$UPDATE_MYSQL" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "DISTRIBUTION=$DISTRIBUTION" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "MYSQL_VERSION=$MYSQL_VERSION" >> ${logdir}/main.log +echo "MYSQL_SRC_BASE_DIR=$MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "MYSQL_INSTALL_DIR=$MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "MYSQL_DATA_DIR=$MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "MYSQL_LOG_DIR=$MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "MYSQL_PORT=$MYSQL_PORT" >> ${logdir}/main.log +echo "MYSQL_UNIX_SOCKET=$MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "MYSQL_USER=$MYSQL_USER" >> ${logdir}/main.log +echo "MYSQL_GROUP=$MYSQL_GROUP" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "SYMLINK_INITSCRIPT=$SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "SYMLINK_INSTALL_DIR=$SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "SYMLINK_DATA_DIR=$SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + + +_MYSQL_INITSCRIPT= +if [ -f /etc/init.d/mysql.server ];then + _MYSQL_INITSCRIPT="mysql.server" +elif [ -f /etc/init.d/mysql ];then + _MYSQL_INITSCRIPT="mysql" +fi + +if ! $UPDATE_MYSQL ; then + + if [ "X${_MYSQL_INITSCRIPT}X" != "XX" ];then + + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" != "XX" ];then + echononl "Stoppe mysql Server.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/$_MYSQL_INITSCRIPT stop" >> ${logdir}/main.log + /etc/init.d/$_MYSQL_INITSCRIPT stop >> ${logdir}/main.log 2>&1 + sleep 5 + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" = "XX" ]; then + echo_ok + else + echo_failed + + PID=`ps aux | grep "mysqld" | grep -v grep | awk '{print$2}'` + echononl "Abbruch (kill -9) aller mysqld Prozesse.." + echo "" >> ${logdir}/main.log + echo "kill -9 $PID" >> ${logdir}/main.log 2>&1 + kill -9 $PID + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + + fi + + ## - Entferne symbolische Links aus den Run Level Verzeichnissen + ## - + echononl "Entferne symbolische Links aus den Run Level Verzeichnissen" + echo "" >> ${logdir}/main.log + echo "update-rc.d -f $_MYSQL_INITSCRIPT remove" >> ${logdir}/main.log + update-rc.d -f $_MYSQL_INITSCRIPT remove >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann symbolische Links (Run Level Verzeichnisse) nicht entfernen." + fi + + if [ -f "/etc/init.d/$_MYSQL_INITSCRIPT" ]; then + echononl "Entferne existierendes Initskript" + echo "" >> ${logdir}/main.log + echo "rm -f /etc/init.d/$_MYSQL_INITSCRIPT" >> ${logdir}/main.log + rm -f /etc/init.d/$_MYSQL_INITSCRIPT >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Mexistierendes Initskript nicht entfernen." + fi + fi + fi + + ## - Uninstall debian mysql packages if installed + ## - + if [ "$DISTRIBUTION" = "Debian" ]; then + echononl "Deinstalliere Debian MySQL Pakete.." + _INSTALLED_MYSQL_DEB=`dpkg -l | grep mysql | grep -e "^i" | awk '{print$2}'` + INSTALLED_MYSQL_DEB= + for deb in $_INSTALLED_MYSQL_DEB ; do + INSTALLED_MYSQL_DEB="$INSTALLED_MYSQL_DEB $deb" + done + if [ -n "$INSTALLED_MYSQL_DEB" ]; then + echo "" >> ${logdir}/main.log + echo "apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB" >> ${logdir}/main.log + apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann MySQL Packete nicht deinstalieren.. + fi + else + echo_skipped + fi + fi + + + echononl "Adding Group \"$MYSQL_GROUP\".." + if cat /etc/group | grep -e "^${MYSQL_GROUP}:" > /dev/null 2>&1 ; then + echo_skipped + else + groupadd -r $MYSQL_GROUP > ${logdir}/groupadd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Gruppe \"${MYSQL_GROUP}\" nicht erstellen.. + fi + fi + + echononl "Adding User \"$MYSQL_USER\".." + if id -u $MYSQL_USER > /dev/null 2>&1; then + echo_skipped + else + useradd -r -M -d /noexistent -s /bin/false -g $MYSQL_GROUP $MYSQL_USER > ${logdir}/useradd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann User \"${MYSQL_USER}\" nicht erstellen.. + fi + fi +fi + + +if [ -d $MYSQL_DATA_DIR ]; then + echononl "Verschiebe exitierendes MySQL Datenverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_DATA_DIR ${MYSQL_SRC_BASE_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_DATA_DIR ${MYSQL_DATA_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. + fi +fi + + +echononl "Erstelle Datenbankverzeichnis \"$MYSQL_DATA_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_DATA_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"700\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 700 ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chmod 700 ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + + +echononl "Erstelle LOG Verzeichnis \"$MYSQL_LOG_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_LOG_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_LOG_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok + _mysql_log=${MYSQL_LOG_DIR}/mysql.log + _mysql_error_log=${MYSQL_LOG_DIR}/mysql.err + _mysql_slow_query_log=${MYSQL_LOG_DIR}/slow_query.log +else + echo_failed + fatal Kann LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"2750\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 2750 ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chmod 2750 ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + + +#if [ -d "${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION" ];then +# echononl "Verschiebe exitierendes Sourceverzeichnis ..." +# echo "" >> ${logdir}/main.log +# echo "mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log +# mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +"%Y%m%d-%H%M"` \ +# >> ${logdir}/main.log 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. +# fi +#fi + + +if [ -d "${MYSQL_SRC_DIR}" ];then + echononl "Verschiebe exitierendes Sourceverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_DIR}\" nicht verschieben.. + fi +fi + + +cd $MYSQL_SRC_BASE_DIR +echo "" >> ${logdir}/main.log +echo "cd $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log + +echo +echononl "Entpacke $distfile ..." +echo "" >> ${logdir}/main.log +echo "gunzip < $distfile | tar -xf -" >> ${logdir}/main.log + +gunzip < $distfile | tar -xf - +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann MySQL Sourcearchiv \"${distfile}\" nicht entpacken.. +fi + +cd ${MYSQL_SRC_DIR} +echo "" >> ${logdir}/main.log +echo "cd ${MYSQL_SRC_DIR}" >> ${logdir}/main.log + +if [ -d ${MYSQL_INSTALL_DIR} ];then + echononl "Verschiebe exitierendes Installationsverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi +fi + +echononl "Konfiguriere MySQL .." +echo "" >> ${logdir}/main.log +cat <> ${logdir}/main.log +./configure --prefix=$MYSQL_INSTALL_DIR \ + --without-readline \ + --with-ssl \ + --enable-static \ + --localstatedir=$MYSQL_DATA_DIR \ + --with-mysqld-user=$user +EOF +./configure --prefix=$MYSQL_INSTALL_DIR \ + --without-readline \ + --with-ssl \ + --enable-static \ + --localstatedir=$MYSQL_DATA_DIR \ + --with-mysqld-user=$user \ + > ${logdir}/mysql_configure.log 2>&1 + +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konfiguration fehlgeschlagen. Siehe ${logdir}/mysql_configure.log .. +fi + +echononl "Kompiliere MySQL.." +echo "" >> ${logdir}/main.log +echo "make" >> ${logdir}/main.log +make > ${logdir}/make.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kompilieren der MySQL Sourcen ist fehlgeschlagen. Siehe ${logdir}/make.log .. +fi + +echononl "Installiere MySQL.." +echo "" >> ${logdir}/main.log +echo "make install" >> ${logdir}/main.log +make install > ${logdir}/make_install.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Installieren von MySQL ist fehlgeschlagen. Siehe ${logdir}/make_install.log .. +fi + +echononl "Konfiguriere Manpages.." +_done=false +if [ -f /etc/manpath.config ];then + if ! grep /usr/local/mysql/man /etc/manpath.config > /dev/null 2<&1 ; then + echo >> /etc/manpath.config + echo "MANDATORY_MANPATH /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + echo "MANPATH_MAP /usr/local/mysql/bin /usr/local/mysql/man" >> /etc/manpath.config + echo "MANDB_MAP /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + + _done=true + fi +elif [ -f /etc/man.conf];then + if ! grep /opt/apache2/man /etc/man.conf > /dev/null 2<&1 ; then + echo >> /etc/man.conf + echo "MANPATH /opt/mysql/man /var/cache/man" >> /etc/man.conf + echo "MANPATH_MAP /opt/mysql/bin /opt/apache2/man" >> /etc/man.conf + + _done=true + fi +fi +if $_done ; then + echo_ok +else + echo_skipped +fi + + +if $SYMLINK_INITSCRIPT ; then + + if [ -h "/etc/init.d/mysql.server" ]; then + echononl "Entferne vorhandenen Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "rm /etc/init.d/mysql.server" >> ${logdir}/main.log + rm /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink /etc/init.d/mysql.server nicht entfernen.. + fi + fi + + echononl "Erstelle Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "ln -s $MYSQL_INSTALL_DIR/share/mysql/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log + ln -s $MYSQL_INSTALL_DIR/share/mysql/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Kann Symlink $MYSQL_INSTALL_DIR/share/mysql/mysql.serve --> /etc/init.d/mysql.server nicht erstellen.." + fi + + echononl "Setze ulimit im Startscript.." + echo "" >> ${logdir}/main.log + echo "sed -i \"1 s/\(.*\)/\1\n\nulimit -n \\\`ulimit -Hn\\\`\n/\" /etc/init.d/mysql.server" >> ${logdir}/main.log + sed -i "1 s/\(.*\)/\1\n\nulimit -n \`ulimit -Hn\`\n/" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann \"ulimit\" im Startscript nicht setzen /etc/init.d/mysql.server nicht setzen.." + fi + +fi + +## - Symlink Installationsverzeichnis (i.d.R. /usr/local/mysql) +## - +if $SYMLINK_INSTALL_DIR ; then + + if [ -h `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_INSTALL_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `dirname $MYSQL_INSTALL_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_INSTALL_DIR`/mysql --> $MYSQL_INSTALL_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `basename $MYSQL_INSTALL_DIR` --> `dirname $MYSQL_INSTALL_DIR`/mysql nicht erstellen .. + fi +fi + +## - Symlink Datenverzeichnis +## - +if $SYMLINK_DATA_DIR ; then + + if [ -h `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_DATA_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `dirname $MYSQL_DATA_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_DATA_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Datenverzeichnis \"${MYSQL_DATA_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_DATA_DIR`/mysql --> $MYSQL_DATA_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `basename $MYSQL_DATA_DIR` --> `dirname $MYSQL_DATA_DIR`/mysql nicht erstellen .. + fi +fi + + +echononl "Füge `dirname $MYSQL_INSTALL_DIR`/mysql/bin zur PATH Variable hinzu .." +if [ -f /etc/profile ]; then + _mysql_bin_dir="`dirname $MYSQL_INSTALL_DIR`/mysql/bin" + if ! grep -e "PATH=.*$_mysql_bin_dir" /etc/profile > /dev/null 2<&1 ; then + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s#^([ ]*export[ ]*PATH.*$)#check_dir=\$_mysql_bin_dir\nif [ -d \\\"\\\\\\\$check_dir\\\" ];then\n PATH=\\\\\\\${check_dir}:\\\\\\\$PATH\nfi\n\n\1#\" /etc/profile" >> ${logdir}/main.log 2<&1 + perl -i -n -p -e "s#^([ ]*export[ ]*PATH.*$)#check_dir=$_mysql_bin_dir\nif [ -d \"\\\$check_dir\" ];then\n PATH=\\\${check_dir}:\\\$PATH\nfi\n\n\1#" /etc/profile >> ${logdir}/main.log 2<&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + + if ! echo "$PATH" | grep $_mysql_bin_dir >> ${logdir}/main.log 2>&1 ; then + export PATH=${_mysql_bin_dir}:$PATH + fi + + else + echo_skipped + fi +else + echo_skipped +fi + + +echo +echononl "Erstelle Konfigurationsdatei /etc/ld.so.conf.d/mysql.conf.." +cat << EOF >/etc/ld.so.conf.d/mysql.conf +`dirname $MYSQL_INSTALL_DIR`/mysql/lib +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Kann Datei /etc/ld.so.conf.d/mysql.conf für dynamischen Linker nicht erstellen .. +fi + +echononl "Erstelle symbolische Links auf Libraries (ldconfig).." +echo "" >> ${logdir}/main.log +echo "ldconfig" >> ${logdir}/main.log +ldconfig >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error "Der Befehl \"ldconfig\" ist fehgeschlagen" +fi + +echo +echononl "Richte MySQL Systemtabellen ein.." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql_install_db --ldata=$MYSQL_DATA_DIR " >> ${logdir}/main.log + +${MYSQL_INSTALL_DIR}/bin/mysql_install_db --ldata=$MYSQL_DATA_DIR >> $logdir/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Einrichten der MySQL Systemtabellen ist fehlgeschlagen.. +fi + +echononl "Create directory \"mysql-files\".." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "mkdir mysql-files" >> ${logdir}/main.log +mkdir mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Change rights (770) to directory \"mysql-files\".." +echo "chmod 770 mysql-files" >> ${logdir}/main.log +chmod 770 ${MYSQL_INSTALL_DIR}/mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Change owner ($MYSQL_USER) of directory \"mysql-files\".." +echo "chown $MYSQL_USER mysql-files" >> ${logdir}/main.log +chown $MYSQL_USER ${MYSQL_INSTALL_DIR}/mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Setze Besitzer/Gruppe für das Datenbankverzeichnis.." +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Besitzer/Gruppe für das Datenbankverzeichnis $MYSQL_DATA_DIR nicht setzen.. +fi + + +if [ -f ${MYSQL_INSTALL_DIR}/my.cnf ]; then + echononl "Sichere Konfigurationsdatei.." + echo "" >> ${logdir}/main.log + echo "${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}" >> ${logdir}/main.log + mv ${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}/my.cnf.ORIG + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Konnte Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf nicht sichern.. + fi +fi + +echononl "Erstelle Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf.." + +echo "" >> ${logdir}/main.log +echo "_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l`" >> ${logdir}/main.log +_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l` + +echo "" >> ${logdir}/main.log +echo "let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2" >> ${logdir}/main.log +let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2 + +echo "" >> ${logdir}/main.log +echo "\$MYSQL_THREAD_CONCURRENCY = $MYSQL_THREAD_CONCURRENCY" >> ${logdir}/main.log + +cat << EOF > ${MYSQL_INSTALL_DIR}/my.cnf +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = $MYSQL_UNIX_SOCKET +nice = 0 + +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +# The MySQL server +[mysqld] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +#bind-address = 127.0.0.1 +bind-address = 127.0.0.1 + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +#explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=`dirname $MYSQL_INSTALL_DIR`/mysql/share +## - +## - bis 5.1.x +## - +## - language=`dirname $MYSQL_INSTALL_DIR`/mysql/share/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +#innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +sort_buffer_size = 2M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +key_buffer_size = 384M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +read_buffer_size = 2M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 4M +max_allowed_packet = 32M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +table_open_cache = 512 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +#table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 16 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +thread_cache_size = 8 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = $_mysql_error_log + + +## - Query Log +## - +#general-log = on +#general_log_file = $_mysql_log + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 128M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = $_mysql_slow_query_log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Default: 16777216 (16M) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/my.cnf\" nicht erstellen.. +fi + +echononl "Kopiere \"stopwords_utf8_iso8859-15.txt\" -> ${MYSQL_INSTALL_DIR}.." +if [ -f "${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt" ];then + cp ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt ${MYSQL_INSTALL_DIR} + if [ "$?" = "0" ]; then + echo_ok + + echononl "Aktiviere Stopword Datei.." + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/\" /usr/local/mysql/my.cnf" >> ${logdir}/main.log + perl -i -n -p -e "s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/" /usr/local/mysql/my.cnf >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Konnte Stopword Datei \"stopwords_utf8_iso8859-15.txt\" nicht aktivieren." + fi + + else + echo_failed + warn "Konnte stopwords_utf8_iso8859-15.txt nicht nach ${MYSQL_INSTALL_DIR} kopieren" + fi +else + echo_skipped + warn "Konnte ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt finden." +fi + + +#echononl "Kopiere Startscript nach /etc/init.d/mysql.server.." +#echo "" >> ${logdir}/main.log +#echo "cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log +#cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +# fatal Konnte Startscript nicht nach /etc/init.d/mysql.server kopieren.. +#fi + +#echononl "Ersetze im Startscript: \"mysql-${_MYSQL_VERSION}\" durch \"mysql\".." +#echo "perl -i -n -p -e \"s/mysql-${_MYSQL_VERSION}/mysql/g\" /etc/init.d/mysql.server" >> ${logdir}/main.log +#perl -i -n -p -e "s/mysql-${_MYSQL_VERSION}/mysql/g" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +#fi +# +#echo "" >> ${logdir}/main.log +#echo "chown root:root /etc/init.d/mysql.server" >> ${logdir}/main.log +#chown root:root /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +# +#echo "" >> ${logdir}/main.log +#echo "chmod 755 /etc/init.d/mysql.server" >> ${logdir}/main.log +#chmod 755 /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + + +if ! $UPDATE_MYSQL ; then + + echononl "Starte MySQL Server beim Booten" + echo "" >> ${logdir}/main.log + if $SYSTEMD_EXISTS ; then + echo "systemctl enable mysql.server" >> ${logdir}/main.log + systemctl enable mysql.server >> ${logdir}/main.log 2>&1 + else + echo "update-rc.d mysql.server defaults" >> ${logdir}/main.log + update-rc.d mysql.server defaults >> ${logdir}/main.log 2>&1 + fi + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + if $SYSTEMD_EXISTS ; then + error "Konnte \"mysql.server\" im systemd nicht enablen.." + else + error "Konnte MySQL Init Script Links (autom. boot) nicht erstellen.." + fi + fi + + echononl "Starte MySQL Datenbankserver.." + echo "" >> ${logdir}/main.log + if $SYSTEMD_EXISTS ; then + echo "systemctl start mysql.server" >> ${logdir}/main.log + systemctl start mysql.server >> ${logdir}/main.log 2>&1 + else + echo "/etc/init.d/mysql.server start" >> ${logdir}/main.log + /etc/init.d/mysql.server start >> ${logdir}/main.log 2>&1 + fi + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Konnte MySQL Datenbankserver nicht starten.. + fi +fi + +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"DELETE FROM user where User = ''\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "DELETE FROM user where User = ''" >> ${logdir}/main.log 2>&1 + +echononl "Setze root Passwort für den MySQL Zugang" +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"UPDATE user set Password = password('$MYSQL_ROOT_PW')\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "UPDATE user set Password = password('$MYSQL_ROOT_PW')" \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte MySQL root Zugang fü den MySQL Server nicht setzen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +echo +echononl "Erstelle Passwort für maintance (MySQL) User.." +echo "" >> ${logdir}/main.log +PW_GEN=`which pwgen` +if [ -z "$PW_GEN" ]; then + echo "_maint_passwd=\`cat /dev/urandom|tr -dc \"a-zA-Z0-9-_\$\?\" | fold -w16 | head -n 1\`" >> ${logdir}/main.log + _maint_passwd=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?" | fold -w16 | head -n 1` >> ${logdir}/main.log 2>&1 +else + echo "_maint_passwd=\`$PW_GEN -v -B 16 1\`" >> ${logdir}/main.log + _maint_passwd=`$PW_GEN -v -B 16 1` >> ${logdir}/main.log 2>&1 +fi +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Passwort für maintance \(MySQL\) User nicht erstellen.. +fi + +_maint_user=sys-maint +echononl "Erstelle maintance MySQL User \"${_maint_user}\" - localhost.." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte \(MySQL\) User \"${_maint_user}\" nicht erstellen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +_maint_conf_file=${MYSQL_INSTALL_DIR}/sys-maint.cnf +echononl "Erstelle ${_maint_conf_file}.." +cat << EOF > ${MYSQL_INSTALL_DIR}/sys-maint.cnf +[client] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +[mysql_upgrade] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +basedir = /usr +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/sys-maint.cnf\" nicht erstellen.. +fi + + +echononl "Erstelle Logrotate Definitionsdatei /etc/logrotate.d/mysql.." +cat << EOF > /etc/logrotate.d/mysql +$_mysql_log +$_mysql_error_log +$_mysql_slow_query_log +{ + daily + rotate 7 + missingok + create 644 $MYSQL_USER $MYSQL_GROUP + compress + sharedscripts + postrotate + MYSQL="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysql --defaults-file=$_maint_conf_file" + MYADMIN="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysqladmin --defaults-file=$_maint_conf_file" + if [ -z "\`\$MYADMIN ping 2>/dev/null\`" ]; then + echo "Warning: no mysqld running or missing sys-maint user?" + else + \$MYSQL -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2); FLUSH LOGS; select sleep(2); set global long_query_time=@lqt_save;' > /dev/null + fi + endscript +} +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Logrotate Definitionsdatei \"/etc/logrotate.d/mysql\" nicht erstellen.. +fi + + +echo +exit diff --git a/install_mysql-5.5.sh b/install_mysql-5.5.sh new file mode 100755 index 0000000..27ae090 --- /dev/null +++ b/install_mysql-5.5.sh @@ -0,0 +1,2095 @@ +#!/usr/bin/env bash + +_MYSQL_VERSION=5.5.47 + +_MYSQL_SRC_BASE_DIR=/usr/local/src/mysql + +_MYSQL_LOG_DIR=/var/log/mysql + +_MYSQL_PORT=3306 +_MYSQL_UNIX_SOCKET=/tmp/mysql.sock + + +_MYSQL_USER=mysql +_MYSQL_GROUP=mysql + +_DISTRIBUTION=Debian + + +## - Let make use multiple cores (-j) +## - +export MAKEFLAGS=-j$(expr `grep "^processor" /proc/cpuinfo | sort -u | wc -l` + 1) + + +## --- Some functions +## --- +echononl(){ + echo X\\c > /tmp/shprompt$$ + if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then + echo "$*\\c" 1>&2 + else + echo -e -n "$*" 1>&2 + fi + rm /tmp/shprompt$$ +} + +fatal(){ + echo "" + echo -e "Fehler: $*" + echo "" + echo -e "\t\033[31m\033[1mInstalllation wird abgebrochen\033[m\033[m" + echo "" + exit 1 +} + +warn (){ + echo "" + echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" + echo "" +} + + +echo_ok() { + echo -e "\033[75G[ \033[32mok\033[m ]" + ## echo -e " [ ok ]" +} +echo_failed(){ + echo -e "\033[75G[ \033[1;31mfailed\033[m ]" + ## echo -e " [ failed ]" +} +echo_skipped() { + echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" +} +## --- +## --- END: functions + +_curdir=`pwd` + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo + +## - root user? +## - +if [ "$(id -u)" != "0" ]; then + fatal Skript muss als \"root\" ausgeführt werden +fi + +DISTRIBUTION= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Um welche Linux Distribution handelt es sich?" +echo "" +echo "[1] Debian" +echo "[2] andere" +echo "" +echononl "Eingabe: " + +while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do + read OPTION + case $OPTION in + 1) DISTRIBUTION="Debian" + ;; + 2) DISTRIBUTION="other" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Eingabe:" + ;; + esac +done + +_UPDATE_MYSQL="" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Soll eine vorhanden MySQL Installation geupdateted werden?" +echo "" +echo "[1] Neuinstallation" +echo "[2] Update vorhandener Installation" +echo "" +echononl "Eingabe: " + + +while [ "$_UPDATE_MYSQL" != "update" -a "$_UPDATE_MYSQL" != "new" ];do + read OPTION + case $OPTION in + 1) _UPDATE_MYSQL="new" + ;; + 2) _UPDATE_MYSQL="update" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$_UPDATE_MYSQL" = "update" ];then + UPDATE_MYSQL=true +else + UPDATE_MYSQL=false +fi + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib die Versionsnummer der MySQL-Distribution an." +echo "" +MYSQL_VERSION= +while [ "X$MYSQL_VERSION" = "X" ] +do + echononl "MySQL Version [$_MYSQL_VERSION]: " + read MYSQL_VERSION + if [ "X$MYSQL_VERSION" = "X" ]; then + MYSQL_VERSION=$_MYSQL_VERSION + fi + + _MYSQL_INSTALL_DIR=/usr/local/mysql-$MYSQL_VERSION + _MYSQL_DATA_DIR=/data/mysql-$MYSQL_VERSION + distfile=mysql-${MYSQL_VERSION}.tar.gz +done +MYSQL_MAJOR_VERSION=`echo $MYSQL_VERSION | cut -d '.' -f1,2` + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des MySQL Sourceverzeichnisses an." +echo "" +MYSQL_SRC_BASE_DIR= +while [ "X$MYSQL_SRC_BASE_DIR" = "X" ] +do + echononl "MySQL Sourceverzeichnis [${_MYSQL_SRC_BASE_DIR}]: " + read MYSQL_SRC_BASE_DIR + if [ "X$MYSQL_SRC_BASE_DIR" = "X" ]; then + MYSQL_SRC_BASE_DIR=$_MYSQL_SRC_BASE_DIR + fi +done +MYSQL_SRC_DIR=${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses in das MySQL installiert werden soll an." +echo "" +MYSQL_INSTALL_DIR= +while [ "X$MYSQL_INSTALL_DIR" = "X" ] +do + echononl "MySQL Installationsverzeichnis [${_MYSQL_INSTALL_DIR}]: " + read MYSQL_INSTALL_DIR + if [ "X$MYSQL_INSTALL_DIR" = "X" ]; then + MYSQL_INSTALL_DIR=$_MYSQL_INSTALL_DIR + LINK=yes + fi + + logdir=${MYSQL_SRC_BASE_DIR}/log-$MYSQL_VERSION + +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses für die MySQL-Datenbanken an." +echo "" +MYSQL_DATA_DIR= +while [ "X$MYSQL_DATA_DIR" = "X" ] +do + echononl "MySQL Datenbankverzeichnis [$_MYSQL_DATA_DIR]: " + read MYSQL_DATA_DIR + if [ "X$MYSQL_DATA_DIR" = "X" ]; then + MYSQL_DATA_DIR=$_MYSQL_DATA_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des LOG-Verzeichnisses für die MySQL an. !! NICHT für binäre logfiles !!" +echo "" +MYSQL_LOG_DIR= +while [ "X$MYSQL_LOG_DIR" = "X" ] +do + echononl "MySQL LOG Verzeichniss [$_MYSQL_LOG_DIR]: " + read MYSQL_LOG_DIR + if [ "X$MYSQL_LOG_DIR" = "X" ]; then + MYSQL_LOG_DIR=$_MYSQL_LOG_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den TCP Port für MySQL an (voreingestell \"${MYSQL_PORT}\")." +echo "" +MYSQL_PORT= +while [ "X$MYSQL_PORT" = "X" ] +do + echononl "MySQL TCP Port [$_MYSQL_PORT]: " + read MYSQL_PORT + if [ "X$MYSQL_PORT" = "X" ]; then + MYSQL_PORT=$_MYSQL_PORT + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Unix Socket für MySQL an (voreingestell \"${_MYSQL_UNIX_SOCKET}\")." +echo "" +MYSQL_UNIX_SOCKET= +while [ "X$MYSQL_UNIX_SOCKET" = "X" ] +do + echononl "MySQL UNIX Socket [$_MYSQL_UNIX_SOCKET]: " + read MYSQL_UNIX_SOCKET + if [ "X$MYSQL_UNIX_SOCKET" = "X" ]; then + MYSQL_UNIX_SOCKET=$_MYSQL_UNIX_SOCKET + fi +done + +echo "" +echo "--" +echo "" +echo "Gib den User-Namen und die User-Gruppe unter dem der MySQL-Daemon laufen soll an." +echo "" +MYSQL_USER= +while [ "X$MYSQL_USER" = "X" ] +do + echononl "MySQL-User [${_MYSQL_USER}]: " + read MYSQL_USER + if [ "X$MYSQL_USER" = "X" ]; then + MYSQL_USER=$_MYSQL_USER + fi +done +MYSQL_GROUP= +while [ "X$MYSQL_GROUP" = "X" ] +do + echononl "MySQL-Gruppe [$MYSQL_USER]: " + read MYSQL_GROUP + if [ "X$MYSQL_GROUP" = "X" ]; then + MYSQL_GROUP=$MYSQL_USER + fi +done + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib ein Passwort für den root user an.." +echo "" +_MYSQL_ROOT_PW_1="X" +_MYSQL_ROOT_PW_2="Y" +while [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ] +do + echononl "Passworteingabe: " + read -s _MYSQL_ROOT_PW_1 + echo + if [ "X$_MYSQL_ROOT_PW_1" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPassworteingabe erforderlich!\033[m\n" + continue + fi + echononl "Passwortwiederholung: " + read -s _MYSQL_ROOT_PW_2 + echo + if [ "X$_MYSQL_ROOT_PW_2" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPasswortwiederholung erforderlich!\033[m\n" + continue + fi + if [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ];then + echo -e "\n\t\033[33m\033[1mPassworteingaben sind nicht identisch!\033[m\n" + else + MYSQL_ROOT_PW=$_MYSQL_ROOT_PW_1 + fi +done + +if $UPDATE_MYSQL ; then + __SYMLINK_INITSCRIPT=nein + __SYMLINK_INSTALL_DIR=nein + __SYMLINK_DATA_DIR=nein +else + __SYMLINK_INITSCRIPT=ja + __SYMLINK_INSTALL_DIR=ja + __SYMLINK_DATA_DIR=ja +fi + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Symlinks:" +echo "" +echo " - Setze Symlink für das Init Skript (/etc/init.d/mysql.server)" +echo " - Setze Sysmlink for das Installationsverzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql" +echo " - Setze Sysmlink for das Datenverzeichnis `dirname $MYSQL_DATA_DIR`/mysql" +echo "" +_SYMLINK_INITSCRIPT="" +echononl "Sysmlink für das Init Skript? (ja/nein) [${__SYMLINK_INITSCRIPT}]: " +read _SYMLINK_INITSCRIPT +if [ "X$_SYMLINK_INITSCRIPT" = "X" ];then + _SYMLINK_INITSCRIPT=$__SYMLINK_INITSCRIPT +fi + +while [ "$_SYMLINK_INITSCRIPT" != "ja" \ + -a "$_SYMLINK_INITSCRIPT" != "Ja" \ + -a "$_SYMLINK_INITSCRIPT" != "nein" \ + -a "$_SYMLINK_INITSCRIPT" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INITSCRIPT +done +if [ "$_SYMLINK_INITSCRIPT" = "ja" -o "$_SYMLINK_INITSCRIPT" = "Ja" ]; then + SYMLINK_INITSCRIPT=true +else + SYMLINK_INITSCRIPT=false +fi + +echo "" +_SYMLINK_INSTALL_DIR="" +echononl "Sysmlink für das Installationsverzeichnis? (ja/nein) [${__SYMLINK_INSTALL_DIR}]: " +read _SYMLINK_INSTALL_DIR +if [ "X$_SYMLINK_INSTALL_DIR" = "X" ];then + _SYMLINK_INSTALL_DIR=$__SYMLINK_INSTALL_DIR +fi + +while [ "$_SYMLINK_INSTALL_DIR" != "ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "Ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "nein" \ + -a "$_SYMLINK_INSTALL_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INSTALL_DIR +done +if [ "$_SYMLINK_INSTALL_DIR" = "ja" -o "$_SYMLINK_INSTALL_DIR" = "Ja" ]; then + SYMLINK_INSTALL_DIR=true +else + SYMLINK_INSTALL_DIR=false +fi + +echo "" +_SYMLINK_DATA_DIR="" +echononl "Sysmlink für das Datenverzeichnis? (ja/nein) [${__SYMLINK_DATA_DIR}]: " +read _SYMLINK_DATA_DIR +if [ "X$_SYMLINK_DATA_DIR" = "X" ];then + _SYMLINK_DATA_DIR=$__SYMLINK_DATA_DIR +fi + +while [ "$_SYMLINK_DATA_DIR" != "ja" \ + -a "$_SYMLINK_DATA_DIR" != "Ja" \ + -a "$_SYMLINK_DATA_DIR" != "nein" \ + -a "$_SYMLINK_DATA_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_DATA_DIR +done +if [ "$_SYMLINK_DATA_DIR" = "ja" -o "$_SYMLINK_DATA_DIR" = "Ja" ]; then + SYMLINK_DATA_DIR=true +else + SYMLINK_DATA_DIR=false +fi + +echo "" + +echo "" +clear +echo -e "\033[21G\033[32mStarte Installation mit folgenden Parametern:\033[m" +echo "" +if ! $UPDATE_MYSQL ; then + echo -e "-- \033[33m\033[1mNeusistallation\033[m --" +else + echo -e "-- \033[33m\033[1mUpdate\033[m (Erstzen einer vorhandenen Installation) --" +fi +echo "" +echo "Linuxdistribution.........: $DISTRIBUTION" +echo "MySQL Versionsnummer......: $MYSQL_VERSION" +echo "Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" +echo "Installationsverzeichnis..: $MYSQL_INSTALL_DIR" +echo "Datenbankverzeichnis......: $MYSQL_DATA_DIR" +echo "Log Verzeichnis...........: $MYSQL_LOG_DIR" +echo "TCP Port..................: $MYSQL_PORT" +echo "Unix Socket...............: $MYSQL_UNIX_SOCKET" +echo "MySQL-User................: $MYSQL_USER" +echo "MySQL-Gruppe..............: $MYSQL_GROUP" +echo "" +echo "Symlink Initskript........: $SYMLINK_INITSCRIPT" +echo "Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" +echo "Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" +echo "" +echo "" +echononl "einverstanden [ja/nein]: " +read OK +while [ "X$OK" != "Xja" -a "X$OK" != "XJa" -a "X$OK" != "Xnein" -a "X$OK" != "XNein" ] +do + echononl "falsche Angabe! [ja/nein]: " + read OK +done +[ $OK = "ja" -o $OK = "Ja" ] || fatal wiederhole Installation zur Eingabe anderer Parameter + + + +## - Sorcecode Verzeichnis vorhanden? +## - +if [ ! -d ${MYSQL_SRC_BASE_DIR} ] ; then + fatal "Kann MySQL Sourcecode Verzeichnis \"${MYSQL_SRC_BASE_DIR}\" nicht finden." +fi + + +## - Sorcecode vorhanden? +## - +if [ ! -f ${MYSQL_SRC_BASE_DIR}/$distfile ] ; then + + echo "" + + echononl "Download $distfile ..." + #wget -O ${MYSQL_SRC_BASE_DIR}/$distfile http://sourceforge.net/projects/mysql.mirror/files/MySQL%20${MYSQL_VERSION}/mysql-${MYSQL_VERSION}.tar.gz/download 2> /dev/null + wget -O ${MYSQL_SRC_BASE_DIR}/$distfile https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile 2>/dev/null + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Downloading $distfile von http://sourceforge.net/projects/mysql.mirror/files Fehlgeschlagen." + fi + #fatal "Kann MySQL Sourcecode \"${MYSQL_SRC_BASE_DIR}/$distfile\" nicht finden.\n\nDownload von http://sourceforge.net/projects/mysql.mirror/files" +fi + +echo "" + + +## - Erstelle Logverzeichnis +## - +if [ -d $logdir ]; then + echononl "Verschiebe exitierendes Logverzeichnis ..." + mv $logdir $logdir.`date +"%Y%m%d-%H%M"` + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht verschieben.. + fi +fi + +echononl "Erstelle Logverzeichnis \"${logdir}\".." +mkdir -p $logdir > /dev/null 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht erstellen.. +fi +touch ${logdir}/main.log +echo -e "## - Starte Installation mit folgenden Parametern:" >> ${logdir}/main.log +echo "## -" >> ${logdir}/main.log +if ! $UPDATE_MYSQL ; then + echo "## - Neusistallation" >> ${logdir}/main.log +else + echo "## - Update (Erstzen einer vorhandenen Installation)" >> ${logdir}/main.log +fi +echo "## -" >> ${logdir}/main.log +echo "## - Linuxdistribution.........: $DISTRIBUTION" >> ${logdir}/main.log +echo "## - MySQL Versionsnummer......: $MYSQL_VERSION" >> ${logdir}/main.log +echo "## - Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "## - Installationsverzeichnis..: $MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Datenbankverzeichnis......: $MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "## - Log Verzeichnis...........: $MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "## - TCP Port..................: $MYSQL_PORT" >> ${logdir}/main.log +echo "## - Unix Socket...............: $MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "## - MySQL-User................: $MYSQL_USER" >> ${logdir}/main.log +echo "## - MySQL-Gruppe..............: $MYSQL_GROUP" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Symlink Initskript........: $SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "## - Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +echo "UPDATE_MYSQL=$UPDATE_MYSQL" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "DISTRIBUTION=$DISTRIBUTION" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "MYSQL_VERSION=$MYSQL_VERSION" >> ${logdir}/main.log +echo "MYSQL_SRC_BASE_DIR=$MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "MYSQL_INSTALL_DIR=$MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "MYSQL_DATA_DIR=$MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "MYSQL_LOG_DIR=$MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "MYSQL_PORT=$MYSQL_PORT" >> ${logdir}/main.log +echo "MYSQL_UNIX_SOCKET=$MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "MYSQL_USER=$MYSQL_USER" >> ${logdir}/main.log +echo "MYSQL_GROUP=$MYSQL_GROUP" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "SYMLINK_INITSCRIPT=$SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "SYMLINK_INSTALL_DIR=$SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "SYMLINK_DATA_DIR=$SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + + +_MYSQL_INITSCRIPT= +if [ -f /etc/init.d/mysql.server ];then + _MYSQL_INITSCRIPT="mysql.server" +elif [ -f /etc/init.d/mysql ];then + _MYSQL_INITSCRIPT="mysql" +fi + +if ! $UPDATE_MYSQL ; then + + if [ "X${_MYSQL_INITSCRIPT}X" != "XX" ];then + + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" != "XX" ];then + echononl "Stoppe mysql Server.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/$_MYSQL_INITSCRIPT stop" >> ${logdir}/main.log + /etc/init.d/$_MYSQL_INITSCRIPT stop >> ${logdir}/main.log 2>&1 + sleep 5 + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" = "XX" ]; then + echo_ok + else + echo_failed + + PID=`ps aux | grep "mysqld" | grep -v grep | awk '{print$2}'` + echononl "Abbruch (kill -9) aller mysqld Prozesse.." + echo "" >> ${logdir}/main.log + echo "kill -9 $PID" >> ${logdir}/main.log 2>&1 + kill -9 $PID + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + + fi + + ## - Entferne symbolische Links aus den Run Level Verzeichnissen + ## - + echononl "Entferne symbolische Links aus den Run Level Verzeichnissen" + echo "" >> ${logdir}/main.log + echo "update-rc.d -f $_MYSQL_INITSCRIPT remove" >> ${logdir}/main.log + update-rc.d -f $_MYSQL_INITSCRIPT remove >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann symbolische Links (Run Level Verzeichnisse) nicht entfernen." + fi + + if [ -f "/etc/init.d/$_MYSQL_INITSCRIPT" ]; then + echononl "Entferne existierendes Initskript" + echo "" >> ${logdir}/main.log + echo "rm -f /etc/init.d/$_MYSQL_INITSCRIPT" >> ${logdir}/main.log + rm -f /etc/init.d/$_MYSQL_INITSCRIPT >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Mexistierendes Initskript nicht entfernen." + fi + fi + fi + + ## - Uninstall debian mysql packages if installed + ## - + if [ "$DISTRIBUTION" = "Debian" ]; then + echononl "Deinstalliere Debian MySQL Pakete.." + _INSTALLED_MYSQL_DEB=`dpkg -l | grep mysql | grep -e "^i" | awk '{print$2}'` + INSTALLED_MYSQL_DEB= + for deb in $_INSTALLED_MYSQL_DEB ; do + INSTALLED_MYSQL_DEB="$INSTALLED_MYSQL_DEB $deb" + done + if [ -n "$INSTALLED_MYSQL_DEB" ]; then + echo "" >> ${logdir}/main.log + echo "apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB" >> ${logdir}/main.log + apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann MySQL Packete nicht deinstalieren.. + fi + else + echo_skipped + fi + fi + + + ## - Install cmake if not exists + ## + echononl "Installing \"cmake\".." + _cmake=`which cmake` + if [ "X$_cmake" = "X" ]; then + apt-get install -q -y cmake > ${logdir}/apt-install.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann \"cmake\" nicht installieren.. + fi + else + echo_skipped + fi + + + echononl "Adding Group \"$MYSQL_GROUP\".." + if cat /etc/group | grep -e "^${MYSQL_GROUP}:" > /dev/null 2>&1 ; then + echo_skipped + else + groupadd -r $MYSQL_GROUP > ${logdir}/groupadd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Gruppe \"${MYSQL_GROUP}\" nicht erstellen.. + fi + fi + + echononl "Adding User \"$MYSQL_USER\".." + if id -u $MYSQL_USER > /dev/null 2>&1; then + echo_skipped + else + useradd -r -M -d /noexistent -s /bin/false -g $MYSQL_GROUP $MYSQL_USER > ${logdir}/useradd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann User \"${MYSQL_USER}\" nicht erstellen.. + fi + fi +fi + + +if [ -d $MYSQL_DATA_DIR ]; then + echononl "Verschiebe exitierendes MySQL Datenverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_DATA_DIR ${MYSQL_SRC_BASE_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_DATA_DIR ${MYSQL_DATA_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. + fi +fi + + +echononl "Erstelle Datenbankverzeichnis \"$MYSQL_DATA_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_DATA_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"700\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 700 ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chmod 700 ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + + +echononl "Erstelle LOG Verzeichnis \"$MYSQL_LOG_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_LOG_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_LOG_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok + _mysql_log=${MYSQL_LOG_DIR}/mysql.log + _mysql_error_log=${MYSQL_LOG_DIR}/mysql.err + _mysql_slow_query_log=${MYSQL_LOG_DIR}/slow_query.log +else + echo_failed + fatal Kann LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"2750\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 2750 ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chmod 2750 ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + + +#if [ -d "${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION" ];then +# echononl "Verschiebe exitierendes Sourceverzeichnis ..." +# echo "" >> ${logdir}/main.log +# echo "mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log +# mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +"%Y%m%d-%H%M"` \ +# >> ${logdir}/main.log 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. +# fi +#fi + + +if [ -d "${MYSQL_SRC_DIR}" ];then + echononl "Verschiebe exitierendes Sourceverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_DIR}\" nicht verschieben.. + fi +fi + + +cd $MYSQL_SRC_BASE_DIR +echo "" >> ${logdir}/main.log +echo "cd $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log + +echo +echononl "Entpacke $distfile ..." +echo "" >> ${logdir}/main.log +echo "gunzip < $distfile | tar -xf -" >> ${logdir}/main.log + +gunzip < $distfile | tar -xf - +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann MySQL Sourcearchiv \"${distfile}\" nicht entpacken.. +fi + +cd ${MYSQL_SRC_DIR} +echo "" >> ${logdir}/main.log +echo "cd ${MYSQL_SRC_DIR}" >> ${logdir}/main.log + +echononl "Konfiguriere MySQL (cmake).." +echo "" >> ${logdir}/main.log +echo "cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR -D MYSQL_DATADIR=$MYSQL_DATA_DIR ." >> ${logdir}/main.log +cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR -D MYSQL_DATADIR=$MYSQL_DATA_DIR . > ${logdir}/cmake-conf.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konfiguration fehlgeschlagen. Siehe ${logdir}/cmake-conf.log .. +fi + +echononl "Kompiliere MySQL.." +echo "" >> ${logdir}/main.log +echo "make" >> ${logdir}/main.log +make > ${logdir}/make.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kompilieren der MySQL Sourcen ist fehlgeschlagen. Siehe ${logdir}/make.log .. +fi + +if [ -d ${MYSQL_INSTALL_DIR} ];then + echononl "Verschiebe exitierendes Installationsverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi +fi + +echononl "Installiere MySQL.." +echo "" >> ${logdir}/main.log +echo "make install" >> ${logdir}/main.log +make install > ${logdir}/make_install.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Installieren von MySQL ist fehlgeschlagen. Siehe ${logdir}/make_install.log .. +fi + +echononl "Konfiguriere Manpages.." +_done=false +if [ -f /etc/manpath.config ];then + if ! grep /usr/local/mysql/man /etc/manpath.config > /dev/null 2<&1 ; then + echo >> /etc/manpath.config + echo "MANDATORY_MANPATH /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + echo "MANPATH_MAP /usr/local/mysql/bin /usr/local/mysql/man" >> /etc/manpath.config + echo "MANDB_MAP /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + + _done=true + fi +elif [ -f /etc/man.conf ];then + if ! grep /opt/apache2/man /etc/man.conf > /dev/null 2<&1 ; then + echo >> /etc/man.conf + echo "MANPATH /opt/mysql/man /var/cache/man" >> /etc/man.conf + echo "MANPATH_MAP /opt/mysql/bin /opt/apache2/man" >> /etc/man.conf + + _done=true + fi +fi +if $_done ; then + echo_ok +else + echo_skipped +fi + + +if $SYMLINK_INITSCRIPT ; then + + if [ -h "/etc/init.d/mysql.server" ]; then + echononl "Entferne vorhandenen Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "rm /etc/init.d/mysql.server" >> ${logdir}/main.log + rm /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink /etc/init.d/mysql.server nicht entfernen.. + fi + fi + + echononl "Erstelle Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log + ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Symlink $MYSQL_INSTALL_DIR/support-files/mysql.server --> /etc/init.d/mysql.server nicht erstellen.." + fi + + echononl "Setze ulimit im Startscript.." + echo "" >> ${logdir}/main.log + echo "sed -i \"1 s/\(.*\)/\1\n\nulimit -n \\\`ulimit -Hn\\\`\n/\" /etc/init.d/mysql.server" >> ${logdir}/main.log + sed -i "1 s/\(.*\)/\1\n\nulimit -n \`ulimit -Hn\`\n/" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann \"ulimit\" im Startscript nicht setzen /etc/init.d/mysql.server nicht setzen.." + fi + +fi + +## - Symlink Installadionsverzeichnis (i.d.R. /usr/local/mysql) +## - +if $SYMLINK_INSTALL_DIR ; then + + if [ -h `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_INSTALL_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `dirname $MYSQL_INSTALL_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_INSTALL_DIR`/mysql --> $MYSQL_INSTALL_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `basename $MYSQL_INSTALL_DIR` --> `dirname $MYSQL_INSTALL_DIR`/mysql nicht erstellen .. + fi +fi + +## - Symlink Datenverzeichnis +## - +if $SYMLINK_DATA_DIR ; then + + if [ -h `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_DATA_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `dirname $MYSQL_DATA_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_DATA_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Datenverzeichnis \"${MYSQL_DATA_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_DATA_DIR`/mysql --> $MYSQL_DATA_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `basename $MYSQL_DATA_DIR` --> `dirname $MYSQL_DATA_DIR`/mysql nicht erstellen .. + fi +fi + + +echononl "Füge `dirname $MYSQL_INSTALL_DIR`/mysql/bin zur PATH Variable hinzu .." +if [ -f /etc/profile ]; then + _mysql_bin_dir="`dirname $MYSQL_INSTALL_DIR`/mysql/bin" + if ! grep -e "PATH=.*$_mysql_bin_dir" /etc/profile > /dev/null 2<&1 ; then + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s#^([ ]*export[ ]*PATH.*$)#check_dir=\$_mysql_bin_dir\nif [ -d \\\"\\\\\\\$check_dir\\\" ];then\n PATH=\\\\\\\${check_dir}:\\\\\\\$PATH\nfi\n\n\1#\" /etc/profile" >> ${logdir}/main.log 2<&1 + perl -i -n -p -e "s#^([ ]*export[ ]*PATH.*$)#check_dir=$_mysql_bin_dir\nif [ -d \"\\\$check_dir\" ];then\n PATH=\\\${check_dir}:\\\$PATH\nfi\n\n\1#" /etc/profile >> ${logdir}/main.log 2<&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + + if ! echo "$PATH" | grep $_mysql_bin_dir >> ${logdir}/main.log 2>&1 ; then + export PATH=${_mysql_bin_dir}:$PATH + fi + + else + echo_skipped + fi +else + echo_skipped +fi + + +echo +echononl "Erstelle Konfigurationsdatei /etc/ld.so.conf.d/mysql.conf.." +cat << EOF >/etc/ld.so.conf.d/mysql.conf +`dirname $MYSQL_INSTALL_DIR`/mysql/lib +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datei /etc/ld.so.conf.d/mysql.conf für dynamischen Linker nicht erstellen .. +fi + +echononl "Erstelle symbolische Links auf Libraries (ldconfig).." +echo "" >> ${logdir}/main.log +echo "ldconfig" >> ${logdir}/main.log +ldconfig >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Der Befehl \"ldconfig\" ist fehgeschlagen" +fi + +echo +echononl "Richte MySQL Systemtabellen ein.." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "./scripts/mysql_install_db --no-defaults \ " >> ${logdir}/main.log +echo " --user=$MYSQL_USER \ " >> ${logdir}/main.log +echo " --basedir=$MYSQL_INSTALL_DIR \ " >> ${logdir}/main.log +echo " --datadir=$MYSQL_DATA_DIR \ " >> ${logdir}/main.log +echo " --language=$MYSQL_INSTALL_DIR/share/german" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +./scripts/mysql_install_db --no-defaults \ + --user=$MYSQL_USER \ + --basedir=$MYSQL_INSTALL_DIR \ + --datadir=$MYSQL_DATA_DIR \ + --language=$MYSQL_INSTALL_DIR/share/german \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Einrichten der MySQL Systemtabellen ist fehlgeschlagen.. +fi + +echononl "Setze Besitzer/Gruppe für das Datenbankverzeichnis.." +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Besitzer/Gruppe für das Datenbankverzeichnis $MYSQL_DATA_DIR nicht setzen.. +fi + + +if [ -f ${MYSQL_INSTALL_DIR}/my.cnf ]; then + echononl "Sichere Konfigurationsdatei.." + echo "" >> ${logdir}/main.log + echo "${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}" >> ${logdir}/main.log + mv ${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}/my.cnf.ORIG + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Konnte Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cn nicht sichern.. + fi +fi + +echononl "Erstelle Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf.." + +echo "" >> ${logdir}/main.log +echo "_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l`" >> ${logdir}/main.log +_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l` + +echo "" >> ${logdir}/main.log +echo "let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2" >> ${logdir}/main.log +let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2 + +echo "" >> ${logdir}/main.log +echo "\$MYSQL_THREAD_CONCURRENCY = $MYSQL_THREAD_CONCURRENCY" >> ${logdir}/main.log + +cat << EOF > ${MYSQL_INSTALL_DIR}/my.cnf +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = $MYSQL_UNIX_SOCKET +nice = 0 + +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +# The MySQL server +[mysqld] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +#bind-address = 127.0.0.1 +bind-address = * + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +#explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=`dirname $MYSQL_INSTALL_DIR`/mysql/share +## - +## - bis 5.1.x +## - +## - language=`dirname $MYSQL_INSTALL_DIR`/mysql/share/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 65536 +## - root hard nofile 65536 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +innodb_buffer_pool_size = 1024M +#innodb_buffer_pool_size = 2G:w + + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M +innodb_additional_mem_pool_size = 50M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M +innodb_log_file_size = 750M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M +innodb_log_buffer_size = 64M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +sort_buffer_size = 2M +sort_buffer_size = 256M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +key_buffer_size = 384M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +#read_buffer_size = 2M +read_buffer_size = 4M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 4M +#max_allowed_packet = 32M +max_allowed_packet = 64M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +#table_open_cache = 512 +table_open_cache = 1024 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +#table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 16 +thread_concurrency = 16 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +#thread_cache_size = 8 +thread_cache_size = 32 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = $_mysql_error_log + + +## - Query Log +## - +#general-log = on +#general_log_file = $_mysql_log + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 +ft_min_word_len = 2 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +#query_cache_limit = 4M +query_cache_limit = 16M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 128M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = $_mysql_slow_query_log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +log_queries_not_using_indexes = 1 +#log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K +join_buffer_size = 512K + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 32M +max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Default: 16777216 (16M) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M +tmp_table_size = 128M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 +ft_min_word_len = 2 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/my.cnf\" nicht erstellen.. +fi + +echononl "Kopiere \"stopwords_utf8_iso8859-15.txt\" -> ${MYSQL_INSTALL_DIR}.." +if [ -f "${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt" ];then + cp ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt ${MYSQL_INSTALL_DIR} + if [ "$?" = "0" ]; then + echo_ok + + echononl "Aktiviere Stopword Datei.." + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/\" /usr/local/mysql/my.cnf" >> ${logdir}/main.log + perl -i -n -p -e "s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/" /usr/local/mysql/my.cnf >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Konnte Stopword Datei \"stopwords_utf8_iso8859-15.txt\" nicht aktivieren." + fi + + else + echo_failed + warn "Konnte stopwords_utf8_iso8859-15.txt nicht nach ${MYSQL_INSTALL_DIR} kopieren" + fi +else + echo_skipped + warn "Konnte ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt finden." +fi + + +#echononl "Kopiere Startscript nach /etc/init.d/mysql.server.." +#echo "" >> ${logdir}/main.log +#echo "cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log +#cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +# fatal Konnte Startscript nicht nach /etc/init.d/mysql.server kopieren.. +#fi + +#echononl "Ersetze im Startscript: \"mysql-${_MYSQL_VERSION}\" durch \"mysql\".." +#echo "perl -i -n -p -e \"s/mysql-${_MYSQL_VERSION}/mysql/g\" /etc/init.d/mysql.server" >> ${logdir}/main.log +#perl -i -n -p -e "s/mysql-${_MYSQL_VERSION}/mysql/g" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +#fi +# +#echo "" >> ${logdir}/main.log +#echo "chown root:root /etc/init.d/mysql.server" >> ${logdir}/main.log +#chown root:root /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +# +#echo "" >> ${logdir}/main.log +#echo "chmod 755 /etc/init.d/mysql.server" >> ${logdir}/main.log +#chmod 755 /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + + +if ! $UPDATE_MYSQL ; then + + echononl "Starte MySQL Server beim Booten" + echo "" >> ${logdir}/main.log + echo "update-rc.d mysql.server defaults" >> ${logdir}/main.log + update-rc.d mysql.server defaults >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Konnte MySQL Init Script Links (autom. boot) nicht entfernen.." + fi + + echononl "Starte MySQL Datenbankserver.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/mysql.server start" >> ${logdir}/main.log + /etc/init.d/mysql.server start >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Konnte MySQL Datenbankserver nicht starten.. + fi +fi + +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"DELETE FROM user where User = ''\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "DELETE FROM user where User = ''" >> ${logdir}/main.log 2>&1 + +echononl "Setze root Passwort für den MySQL Zugang" +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"UPDATE user set Password = password('$MYSQL_ROOT_PW')\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "UPDATE user set Password = password('$MYSQL_ROOT_PW')" \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte MySQL root Zugang fü den MySQL Server nicht setzen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +echo +echononl "Erstelle Passwort für maintance (MySQL) User.." +echo "" >> ${logdir}/main.log +PW_GEN=`which pwgen` +if [ -z "$PW_GEN" ]; then + echo "_maint_passwd=\`cat /dev/urandom|tr -dc \"a-zA-Z0-9-_\$\?\" | fold -w16 | head -n 1\`" >> ${logdir}/main.log + _maint_passwd=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?" | fold -w16 | head -n 1` >> ${logdir}/main.log 2>&1 +else + echo "_maint_passwd=\`$PW_GEN -v -B 16 1\`" >> ${logdir}/main.log + _maint_passwd=`$PW_GEN -v -B 16 1` >> ${logdir}/main.log 2>&1 +fi +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Passwort für maintance \(MySQL\) User nicht erstellen.. +fi + +_maint_user=sys-maint +echononl "Erstelle maintance MySQL User \"${_maint_user}\" - localhost.." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte \(MySQL\) User \"${_maint_user}\" nicht erstellen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +_maint_conf_file=${MYSQL_INSTALL_DIR}/sys-maint.cnf +echononl "Erstelle ${_maint_conf_file}.." +cat << EOF > ${MYSQL_INSTALL_DIR}/sys-maint.cnf +[client] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +[mysql_upgrade] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +basedir = /usr +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/sys-maint.cnf\" nicht erstellen.. +fi + + +echononl "Erstelle Logrotate Definitionsdatei /etc/logrotate.d/mysql.." +cat << EOF > /etc/logrotate.d/mysql +$_mysql_log +$_mysql_error_log +$_mysql_slow_query_log +{ + daily + rotate 7 + missingok + create 640 $MYSQL_USER $MYSQL_GROUP + compress + sharedscripts + postrotate + MYSQL="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysql --defaults-file=$_maint_conf_file" + MYADMIN="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysqladmin --defaults-file=$_maint_conf_file" + if [ -z "\`\$MYADMIN ping 2>/dev/null\`" ]; then + echo "Warning: no mysqld running or missing sys-maint user?" + else + \$MYSQL -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2); FLUSH LOGS; select sleep(2); set global long_query_time=@lqt_save;' > /dev/null + fi + endscript +} +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Logrotate Definitionsdatei \"/etc/logrotate.d/mysql\" nicht erstellen.. +fi + + +echo +exit diff --git a/install_mysql-5.6.sh b/install_mysql-5.6.sh new file mode 100755 index 0000000..5cb9ebf --- /dev/null +++ b/install_mysql-5.6.sh @@ -0,0 +1,2078 @@ +#!/usr/bin/env bash + +_MYSQL_VERSION=5.6.35 + +_MYSQL_SRC_BASE_DIR=/usr/local/src/mysql + +_MYSQL_LOG_DIR=/var/log/mysql + +_MYSQL_PORT=3306 +_MYSQL_UNIX_SOCKET=/tmp/mysql.sock + + +_MYSQL_USER=mysql +_MYSQL_GROUP=mysql + +_DISTRIBUTION=Debian + + +## - Let make use multiple cores (-j) +## - +export MAKEFLAGS=-j$(expr `grep "^processor" /proc/cpuinfo | sort -u | wc -l` + 1) + + +## --- Some functions +## --- +echononl(){ + echo X\\c > /tmp/shprompt$$ + if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then + echo "$*\\c" 1>&2 + else + echo -e -n "$*" 1>&2 + fi + rm /tmp/shprompt$$ +} + +fatal(){ + echo "" + echo -e "Fehler: $*" + echo "" + echo -e "\t\033[31m\033[1mInstalllation wird abgebrochen\033[m\033[m" + echo "" + exit 1 +} + +warn (){ + echo "" + echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" + echo "" +} + + +echo_ok() { + echo -e "\033[75G[ \033[32mok\033[m ]" + ## echo -e " [ ok ]" +} +echo_failed(){ + echo -e "\033[75G[ \033[1;31mfailed\033[m ]" + ## echo -e " [ failed ]" +} +echo_skipped() { + echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" +} +## --- +## --- END: functions + +_curdir=`pwd` + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo + +## - root user? +## - +if [ "$(id -u)" != "0" ]; then + fatal Skript muss als \"root\" ausgeführt werden +fi + +DISTRIBUTION= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Um welche Linux Distribution handelt es sich?" +echo "" +echo "[1] Debian" +echo "[2] andere" +echo "" +echononl "Eingabe: " + +while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do + read OPTION + case $OPTION in + 1) DISTRIBUTION="Debian" + ;; + 2) DISTRIBUTION="other" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Eingabe:" + ;; + esac +done + +_UPDATE_MYSQL="" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Soll eine vorhanden MySQL Installation geupdateted werden?" +echo "" +echo "[1] Neuinstallation" +echo "[2] Update vorhandener Installation" +echo "" +echononl "Eingabe: " + + +while [ "$_UPDATE_MYSQL" != "update" -a "$_UPDATE_MYSQL" != "new" ];do + read OPTION + case $OPTION in + 1) _UPDATE_MYSQL="new" + ;; + 2) _UPDATE_MYSQL="update" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$_UPDATE_MYSQL" = "update" ];then + UPDATE_MYSQL=true +else + UPDATE_MYSQL=false +fi + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib die Versionsnummer der MySQL-Distribution an." +echo "" +MYSQL_VERSION= +while [ "X$MYSQL_VERSION" = "X" ] +do + echononl "MySQL Version [$_MYSQL_VERSION]: " + read MYSQL_VERSION + if [ "X$MYSQL_VERSION" = "X" ]; then + MYSQL_VERSION=$_MYSQL_VERSION + fi + + _MYSQL_INSTALL_DIR=/usr/local/mysql-$MYSQL_VERSION + _MYSQL_DATA_DIR=/data/mysql-$MYSQL_VERSION + distfile=mysql-${MYSQL_VERSION}.tar.gz +done +MYSQL_MAJOR_VERSION=`echo $MYSQL_VERSION | cut -d '.' -f1,2` + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des MySQL Sourceverzeichnisses an." +echo "" +MYSQL_SRC_BASE_DIR= +while [ "X$MYSQL_SRC_BASE_DIR" = "X" ] +do + echononl "MySQL Sourceverzeichnis [${_MYSQL_SRC_BASE_DIR}]: " + read MYSQL_SRC_BASE_DIR + if [ "X$MYSQL_SRC_BASE_DIR" = "X" ]; then + MYSQL_SRC_BASE_DIR=$_MYSQL_SRC_BASE_DIR + fi +done +MYSQL_SRC_DIR=${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses in das MySQL installiert werden soll an." +echo "" +MYSQL_INSTALL_DIR= +while [ "X$MYSQL_INSTALL_DIR" = "X" ] +do + echononl "MySQL Installationsverzeichnis [${_MYSQL_INSTALL_DIR}]: " + read MYSQL_INSTALL_DIR + if [ "X$MYSQL_INSTALL_DIR" = "X" ]; then + MYSQL_INSTALL_DIR=$_MYSQL_INSTALL_DIR + LINK=yes + fi + + logdir=${MYSQL_SRC_BASE_DIR}/log-$MYSQL_VERSION + +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses für die MySQL-Datenbanken an." +echo "" +MYSQL_DATA_DIR= +while [ "X$MYSQL_DATA_DIR" = "X" ] +do + echononl "MySQL Datenbankverzeichnis [$_MYSQL_DATA_DIR]: " + read MYSQL_DATA_DIR + if [ "X$MYSQL_DATA_DIR" = "X" ]; then + MYSQL_DATA_DIR=$_MYSQL_DATA_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des LOG-Verzeichnisses für die MySQL an. !! NICHT für binäre logfiles !!" +echo "" +MYSQL_LOG_DIR= +while [ "X$MYSQL_LOG_DIR" = "X" ] +do + echononl "MySQL LOG Verzeichniss [$_MYSQL_LOG_DIR]: " + read MYSQL_LOG_DIR + if [ "X$MYSQL_LOG_DIR" = "X" ]; then + MYSQL_LOG_DIR=$_MYSQL_LOG_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den TCP Port für MySQL an (voreingestell \"${MYSQL_PORT}\")." +echo "" +MYSQL_PORT= +while [ "X$MYSQL_PORT" = "X" ] +do + echononl "MySQL TCP Port [$_MYSQL_PORT]: " + read MYSQL_PORT + if [ "X$MYSQL_PORT" = "X" ]; then + MYSQL_PORT=$_MYSQL_PORT + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Unix Socket für MySQL an (voreingestell \"${_MYSQL_UNIX_SOCKET}\")." +echo "" +MYSQL_UNIX_SOCKET= +while [ "X$MYSQL_UNIX_SOCKET" = "X" ] +do + echononl "MySQL UNIX Socket [$_MYSQL_UNIX_SOCKET]: " + read MYSQL_UNIX_SOCKET + if [ "X$MYSQL_UNIX_SOCKET" = "X" ]; then + MYSQL_UNIX_SOCKET=$_MYSQL_UNIX_SOCKET + fi +done + +echo "" +echo "--" +echo "" +echo "Gib den User-Namen und die User-Gruppe unter dem der MySQL-Daemon laufen soll an." +echo "" +MYSQL_USER= +while [ "X$MYSQL_USER" = "X" ] +do + echononl "MySQL-User [${_MYSQL_USER}]: " + read MYSQL_USER + if [ "X$MYSQL_USER" = "X" ]; then + MYSQL_USER=$_MYSQL_USER + fi +done +MYSQL_GROUP= +while [ "X$MYSQL_GROUP" = "X" ] +do + echononl "MySQL-Gruppe [$MYSQL_USER]: " + read MYSQL_GROUP + if [ "X$MYSQL_GROUP" = "X" ]; then + MYSQL_GROUP=$MYSQL_USER + fi +done + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib ein Passwort für den root user an.." +echo "" +_MYSQL_ROOT_PW_1="X" +_MYSQL_ROOT_PW_2="Y" +while [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ] +do + echononl "Passworteingabe: " + read -s _MYSQL_ROOT_PW_1 + echo + if [ "X$_MYSQL_ROOT_PW_1" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPassworteingabe erforderlich!\033[m\n" + continue + fi + echononl "Passwortwiederholung: " + read -s _MYSQL_ROOT_PW_2 + echo + if [ "X$_MYSQL_ROOT_PW_2" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPasswortwiederholung erforderlich!\033[m\n" + continue + fi + if [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ];then + echo -e "\n\t\033[33m\033[1mPassworteingaben sind nicht identisch!\033[m\n" + else + MYSQL_ROOT_PW=$_MYSQL_ROOT_PW_1 + fi +done + +if $UPDATE_MYSQL ; then + __SYMLINK_INITSCRIPT=nein + __SYMLINK_INSTALL_DIR=nein + __SYMLINK_DATA_DIR=nein +else + __SYMLINK_INITSCRIPT=ja + __SYMLINK_INSTALL_DIR=ja + __SYMLINK_DATA_DIR=ja +fi + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Symlinks:" +echo "" +echo " - Setze Symlink für das Init Skript (/etc/init.d/mysql.server)" +echo " - Setze Sysmlink for das Installationsverzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql" +echo " - Setze Sysmlink for das Datenverzeichnis `dirname $MYSQL_DATA_DIR`/mysql" +echo "" +_SYMLINK_INITSCRIPT="" +echononl "Sysmlink für das Init Skript? (ja/nein) [${__SYMLINK_INITSCRIPT}]: " +read _SYMLINK_INITSCRIPT +if [ "X$_SYMLINK_INITSCRIPT" = "X" ];then + _SYMLINK_INITSCRIPT=$__SYMLINK_INITSCRIPT +fi + +while [ "$_SYMLINK_INITSCRIPT" != "ja" \ + -a "$_SYMLINK_INITSCRIPT" != "Ja" \ + -a "$_SYMLINK_INITSCRIPT" != "nein" \ + -a "$_SYMLINK_INITSCRIPT" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INITSCRIPT +done +if [ "$_SYMLINK_INITSCRIPT" = "ja" -o "$_SYMLINK_INITSCRIPT" = "Ja" ]; then + SYMLINK_INITSCRIPT=true +else + SYMLINK_INITSCRIPT=false +fi + +echo "" +_SYMLINK_INSTALL_DIR="" +echononl "Sysmlink für das Installationsverzeichnis? (ja/nein) [${__SYMLINK_INSTALL_DIR}]: " +read _SYMLINK_INSTALL_DIR +if [ "X$_SYMLINK_INSTALL_DIR" = "X" ];then + _SYMLINK_INSTALL_DIR=$__SYMLINK_INSTALL_DIR +fi + +while [ "$_SYMLINK_INSTALL_DIR" != "ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "Ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "nein" \ + -a "$_SYMLINK_INSTALL_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INSTALL_DIR +done +if [ "$_SYMLINK_INSTALL_DIR" = "ja" -o "$_SYMLINK_INSTALL_DIR" = "Ja" ]; then + SYMLINK_INSTALL_DIR=true +else + SYMLINK_INSTALL_DIR=false +fi + +echo "" +_SYMLINK_DATA_DIR="" +echononl "Sysmlink für das Datenverzeichnis? (ja/nein) [${__SYMLINK_DATA_DIR}]: " +read _SYMLINK_DATA_DIR +if [ "X$_SYMLINK_DATA_DIR" = "X" ];then + _SYMLINK_DATA_DIR=$__SYMLINK_DATA_DIR +fi + +while [ "$_SYMLINK_DATA_DIR" != "ja" \ + -a "$_SYMLINK_DATA_DIR" != "Ja" \ + -a "$_SYMLINK_DATA_DIR" != "nein" \ + -a "$_SYMLINK_DATA_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_DATA_DIR +done +if [ "$_SYMLINK_DATA_DIR" = "ja" -o "$_SYMLINK_DATA_DIR" = "Ja" ]; then + SYMLINK_DATA_DIR=true +else + SYMLINK_DATA_DIR=false +fi + +echo "" + +echo "" +clear +echo -e "\033[21G\033[32mStarte Installation mit folgenden Parametern:\033[m" +echo "" +if ! $UPDATE_MYSQL ; then + echo -e "-- \033[33m\033[1mNeusistallation\033[m --" +else + echo -e "-- \033[33m\033[1mUpdate\033[m (Erstzen einer vorhandenen Installation) --" +fi +echo "" +echo "Linuxdistribution.........: $DISTRIBUTION" +echo "MySQL Versionsnummer......: $MYSQL_VERSION" +echo "Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" +echo "Installationsverzeichnis..: $MYSQL_INSTALL_DIR" +echo "Datenbankverzeichnis......: $MYSQL_DATA_DIR" +echo "Log Verzeichnis...........: $MYSQL_LOG_DIR" +echo "TCP Port..................: $MYSQL_PORT" +echo "Unix Socket...............: $MYSQL_UNIX_SOCKET" +echo "MySQL-User................: $MYSQL_USER" +echo "MySQL-Gruppe..............: $MYSQL_GROUP" +echo "" +echo "Symlink Initskript........: $SYMLINK_INITSCRIPT" +echo "Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" +echo "Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" +echo "" +echo "" +echononl "einverstanden [ja/nein]: " +read OK +while [ "X$OK" != "Xja" -a "X$OK" != "XJa" -a "X$OK" != "Xnein" -a "X$OK" != "XNein" ] +do + echononl "falsche Angabe! [ja/nein]: " + read OK +done +[ $OK = "ja" -o $OK = "Ja" ] || fatal wiederhole Installation zur Eingabe anderer Parameter + + + +## - Sorcecode Verzeichnis vorhanden? +## - +if [ ! -d ${MYSQL_SRC_BASE_DIR} ] ; then + fatal "Kann MySQL Sourcecode Verzeichnis \"${MYSQL_SRC_BASE_DIR}\" nicht finden." +fi + + +## - Sorcecode vorhanden? +## - +if [ ! -f ${MYSQL_SRC_BASE_DIR}/$distfile ] ; then + + echo "" + + echononl "Download $distfile ..." + #wget -O ${MYSQL_SRC_BASE_DIR}/$distfile http://sourceforge.net/projects/mysql.mirror/files/MySQL%20${MYSQL_VERSION}/mysql-${MYSQL_VERSION}.tar.gz/download 2> /dev/null + wget -O ${MYSQL_SRC_BASE_DIR}/$distfile https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile 2>/dev/null + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Downloading $distfile von http://sourceforge.net/projects/mysql.mirror/files Fehlgeschlagen." + fi + #fatal "Kann MySQL Sourcecode \"${MYSQL_SRC_BASE_DIR}/$distfile\" nicht finden.\n\nDownload von http://sourceforge.net/projects/mysql.mirror/files" +fi + +echo "" + + +## - Erstelle Logverzeichnis +## - +if [ -d $logdir ]; then + echononl "Verschiebe exitierendes Logverzeichnis ..." + mv $logdir $logdir.`date +"%Y%m%d-%H%M"` + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht verschieben.. + fi +fi + +echononl "Erstelle Logverzeichnis \"${logdir}\".." +mkdir -p $logdir > /dev/null 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht erstellen.. +fi +touch ${logdir}/main.log +echo -e "## - Starte Installation mit folgenden Parametern:" >> ${logdir}/main.log +echo "## -" >> ${logdir}/main.log +if ! $UPDATE_MYSQL ; then + echo "## - Neusistallation" >> ${logdir}/main.log +else + echo "## - Update (Erstzen einer vorhandenen Installation)" >> ${logdir}/main.log +fi +echo "## -" >> ${logdir}/main.log +echo "## - Linuxdistribution.........: $DISTRIBUTION" >> ${logdir}/main.log +echo "## - MySQL Versionsnummer......: $MYSQL_VERSION" >> ${logdir}/main.log +echo "## - Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "## - Installationsverzeichnis..: $MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Datenbankverzeichnis......: $MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "## - Log Verzeichnis...........: $MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "## - TCP Port..................: $MYSQL_PORT" >> ${logdir}/main.log +echo "## - Unix Socket...............: $MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "## - MySQL-User................: $MYSQL_USER" >> ${logdir}/main.log +echo "## - MySQL-Gruppe..............: $MYSQL_GROUP" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Symlink Initskript........: $SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "## - Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +echo "UPDATE_MYSQL=$UPDATE_MYSQL" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "DISTRIBUTION=$DISTRIBUTION" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "MYSQL_VERSION=$MYSQL_VERSION" >> ${logdir}/main.log +echo "MYSQL_SRC_BASE_DIR=$MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "MYSQL_INSTALL_DIR=$MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "MYSQL_DATA_DIR=$MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "MYSQL_LOG_DIR=$MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "MYSQL_PORT=$MYSQL_PORT" >> ${logdir}/main.log +echo "MYSQL_UNIX_SOCKET=$MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "MYSQL_USER=$MYSQL_USER" >> ${logdir}/main.log +echo "MYSQL_GROUP=$MYSQL_GROUP" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "SYMLINK_INITSCRIPT=$SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "SYMLINK_INSTALL_DIR=$SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "SYMLINK_DATA_DIR=$SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + + +_MYSQL_INITSCRIPT= +if [ -f /etc/init.d/mysql.server ];then + _MYSQL_INITSCRIPT="mysql.server" +elif [ -f /etc/init.d/mysql ];then + _MYSQL_INITSCRIPT="mysql" +fi + +if ! $UPDATE_MYSQL ; then + + if [ "X${_MYSQL_INITSCRIPT}X" != "XX" ];then + + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" != "XX" ];then + echononl "Stoppe mysql Server.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/$_MYSQL_INITSCRIPT stop" >> ${logdir}/main.log + /etc/init.d/$_MYSQL_INITSCRIPT stop >> ${logdir}/main.log 2>&1 + sleep 5 + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" = "XX" ]; then + echo_ok + else + echo_failed + + PID=`ps aux | grep "mysqld" | grep -v grep | awk '{print$2}'` + echononl "Abbruch (kill -9) aller mysqld Prozesse.." + echo "" >> ${logdir}/main.log + echo "kill -9 $PID" >> ${logdir}/main.log 2>&1 + kill -9 $PID + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + + fi + + ## - Entferne symbolische Links aus den Run Level Verzeichnissen + ## - + echononl "Entferne symbolische Links aus den Run Level Verzeichnissen" + echo "" >> ${logdir}/main.log + echo "update-rc.d -f $_MYSQL_INITSCRIPT remove" >> ${logdir}/main.log + update-rc.d -f $_MYSQL_INITSCRIPT remove >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann symbolische Links (Run Level Verzeichnisse) nicht entfernen." + fi + + if [ -f "/etc/init.d/$_MYSQL_INITSCRIPT" ]; then + echononl "Entferne existierendes Initskript" + echo "" >> ${logdir}/main.log + echo "rm -f /etc/init.d/$_MYSQL_INITSCRIPT" >> ${logdir}/main.log + rm -f /etc/init.d/$_MYSQL_INITSCRIPT >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Mexistierendes Initskript nicht entfernen." + fi + fi + fi + + ## - Uninstall debian mysql packages if installed + ## - + if [ "$DISTRIBUTION" = "Debian" ]; then + echononl "Deinstalliere Debian MySQL Pakete.." + _INSTALLED_MYSQL_DEB=`dpkg -l | grep mysql | grep -e "^i" | awk '{print$2}'` + INSTALLED_MYSQL_DEB= + for deb in $_INSTALLED_MYSQL_DEB ; do + INSTALLED_MYSQL_DEB="$INSTALLED_MYSQL_DEB $deb" + done + if [ -n "$INSTALLED_MYSQL_DEB" ]; then + echo "" >> ${logdir}/main.log + echo "apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB" >> ${logdir}/main.log + apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann MySQL Packete nicht deinstalieren.. + fi + else + echo_skipped + fi + fi + + + ## - Install cmake if not exists + ## + echononl "Installing \"cmake\".." + _cmake=`which cmake` + if [ "X$_cmake" = "X" ]; then + apt-get install -q -y cmake > ${logdir}/apt-install.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann \"cmake\" nicht installieren.. + fi + else + echo_skipped + fi + + + echononl "Adding Group \"$MYSQL_GROUP\".." + if cat /etc/group | grep -e "^${MYSQL_GROUP}:" > /dev/null 2>&1 ; then + echo_skipped + else + groupadd -r $MYSQL_GROUP > ${logdir}/groupadd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Gruppe \"${MYSQL_GROUP}\" nicht erstellen.. + fi + fi + + echononl "Adding User \"$MYSQL_USER\".." + if id -u $MYSQL_USER > /dev/null 2>&1; then + echo_skipped + else + useradd -r -M -d /noexistent -s /bin/false -g $MYSQL_GROUP $MYSQL_USER > ${logdir}/useradd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann User \"${MYSQL_USER}\" nicht erstellen.. + fi + fi +fi + + +if [ -d $MYSQL_DATA_DIR ]; then + echononl "Verschiebe exitierendes MySQL Datenverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_DATA_DIR ${MYSQL_SRC_BASE_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_DATA_DIR ${MYSQL_DATA_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. + fi +fi + + +echononl "Erstelle Datenbankverzeichnis \"$MYSQL_DATA_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_DATA_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"700\" für Datenbankverzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 700 ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chmod 700 ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für Datenbankverzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + + +echononl "Erstelle LOG Verzeichnis \"$MYSQL_LOG_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_LOG_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_LOG_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok + _mysql_log=${MYSQL_LOG_DIR}/mysql.log + _mysql_error_log=${MYSQL_LOG_DIR}/mysql.err + _mysql_slow_query_log=${MYSQL_LOG_DIR}/slow_query.log +else + echo_failed + fatal Kann LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"2750\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 2750 ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chmod 2750 ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + + +#if [ -d "${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION" ];then +# echononl "Verschiebe exitierendes Sourceverzeichnis ..." +# echo "" >> ${logdir}/main.log +# echo "mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log +# mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +"%Y%m%d-%H%M"` \ +# >> ${logdir}/main.log 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. +# fi +#fi + + +if [ -d "${MYSQL_SRC_DIR}" ];then + echononl "Verschiebe exitierendes Sourceverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_DIR}\" nicht verschieben.. + fi +fi + + +cd $MYSQL_SRC_BASE_DIR +echo "" >> ${logdir}/main.log +echo "cd $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log + +echo +echononl "Entpacke $distfile ..." +echo "" >> ${logdir}/main.log +echo "gunzip < $distfile | tar -xf -" >> ${logdir}/main.log + +gunzip < $distfile | tar -xf - +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann MySQL Sourcearchiv \"${distfile}\" nicht entpacken.. +fi + +cd ${MYSQL_SRC_DIR} +echo "" >> ${logdir}/main.log +echo "cd ${MYSQL_SRC_DIR}" >> ${logdir}/main.log + +echononl "Konfiguriere MySQL (cmake).." +echo "" >> ${logdir}/main.log +echo "cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR -D MYSQL_DATADIR=$MYSQL_DATA_DIR ." >> ${logdir}/main.log +cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR -D MYSQL_DATADIR=$MYSQL_DATA_DIR . > ${logdir}/cmake-conf.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konfiguration fehlgeschlagen. Siehe ${logdir}/cmake-conf.log .. +fi + +echononl "Kompiliere MySQL.." +echo "" >> ${logdir}/main.log +echo "make" >> ${logdir}/main.log +make > ${logdir}/make.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kompilieren der MySQL Sourcen ist fehlgeschlagen. Siehe ${logdir}/make.log .. +fi + +if [ -d ${MYSQL_INSTALL_DIR} ];then + echononl "Verschiebe exitierendes Installationsverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi +fi + +echononl "Installiere MySQL.." +echo "" >> ${logdir}/main.log +echo "make install" >> ${logdir}/main.log +make install > ${logdir}/make_install.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Installieren von MySQL ist fehlgeschlagen. Siehe ${logdir}/make_install.log .. +fi + +echononl "Konfiguriere Manpages.." +_done=false +if [ -f /etc/manpath.config ];then + if ! grep /usr/local/mysql/man /etc/manpath.config > /dev/null 2<&1 ; then + echo >> /etc/manpath.config + echo "MANDATORY_MANPATH /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + echo "MANPATH_MAP /usr/local/mysql/bin /usr/local/mysql/man" >> /etc/manpath.config + echo "MANDB_MAP /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + + _done=true + fi +elif [ -f /etc/man.conf];then + if ! grep /opt/apache2/man /etc/man.conf > /dev/null 2<&1 ; then + echo >> /etc/man.conf + echo "MANPATH /opt/mysql/man /var/cache/man" >> /etc/man.conf + echo "MANPATH_MAP /opt/mysql/bin /opt/apache2/man" >> /etc/man.conf + + _done=true + fi +fi +if $_done ; then + echo_ok +else + echo_skipped +fi + + +if $SYMLINK_INITSCRIPT ; then + + if [ -h "/etc/init.d/mysql.server" ]; then + echononl "Entferne vorhandenen Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "rm /etc/init.d/mysql.server" >> ${logdir}/main.log + rm /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink /etc/init.d/mysql.server nicht entfernen.. + fi + fi + + echononl "Erstelle Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log + ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Symlink $MYSQL_INSTALL_DIR/support-files/mysql.server --> /etc/init.d/mysql.server nicht erstellen.." + fi + + echononl "Setze ulimit im Startscript.." + echo "" >> ${logdir}/main.log + echo "sed -i \"1 s/\(.*\)/\1\n\nulimit -n \\\`ulimit -Hn\\\`\n/\" /etc/init.d/mysql.server" >> ${logdir}/main.log + sed -i "1 s/\(.*\)/\1\n\nulimit -n \`ulimit -Hn\`\n/" $(realpath /etc/init.d/mysql.server) >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann \"ulimit\" im Startscript nicht setzen /etc/init.d/mysql.server nicht setzen.." + fi + +fi + +## - Symlink Installadionsverzeichnis (i.d.R. /usr/local/mysql) +## - +if $SYMLINK_INSTALL_DIR ; then + + if [ -h `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_INSTALL_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `dirname $MYSQL_INSTALL_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_INSTALL_DIR`/mysql --> $MYSQL_INSTALL_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `basename $MYSQL_INSTALL_DIR` --> `dirname $MYSQL_INSTALL_DIR`/mysql nicht erstellen .. + fi +fi + +## - Symlink Datenverzeichnis +## - +if $SYMLINK_DATA_DIR ; then + + if [ -h `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_DATA_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `dirname $MYSQL_DATA_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_DATA_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Datenverzeichnis \"${MYSQL_DATA_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_DATA_DIR`/mysql --> $MYSQL_DATA_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Symlink `basename $MYSQL_DATA_DIR` --> `dirname $MYSQL_DATA_DIR`/mysql nicht erstellen .. + fi +fi + + +echononl "Füge `dirname $MYSQL_INSTALL_DIR`/mysql/bin zur PATH Variable hinzu .." +if [ -f /etc/profile ]; then + _mysql_bin_dir="`dirname $MYSQL_INSTALL_DIR`/mysql/bin" + if ! grep -e "PATH=.*$_mysql_bin_dir" /etc/profile > /dev/null 2<&1 ; then + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s#^([ ]*export[ ]*PATH.*$)#check_dir=\$_mysql_bin_dir\nif [ -d \\\"\\\\\\\$check_dir\\\" ];then\n PATH=\\\\\\\${check_dir}:\\\\\\\$PATH\nfi\n\n\1#\" /etc/profile" >> ${logdir}/main.log 2<&1 + perl -i -n -p -e "s#^([ ]*export[ ]*PATH.*$)#check_dir=$_mysql_bin_dir\nif [ -d \"\\\$check_dir\" ];then\n PATH=\\\${check_dir}:\\\$PATH\nfi\n\n\1#" /etc/profile >> ${logdir}/main.log 2<&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + + if ! echo "$PATH" | grep $_mysql_bin_dir >> ${logdir}/main.log 2>&1 ; then + export PATH=${_mysql_bin_dir}:$PATH + fi + + else + echo_skipped + fi +else + echo_skipped +fi + + +echo +echononl "Erstelle Konfigurationsdatei /etc/ld.so.conf.d/mysql.conf.." +cat << EOF >/etc/ld.so.conf.d/mysql.conf +`dirname $MYSQL_INSTALL_DIR`/mysql/lib +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datei /etc/ld.so.conf.d/mysql.conf für dynamischen Linker nicht erstellen .. +fi + +echononl "Erstelle symbolische Links auf Libraries (ldconfig).." +echo "" >> ${logdir}/main.log +echo "ldconfig" >> ${logdir}/main.log +ldconfig >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal "Der Befehl \"ldconfig\" ist fehgeschlagen" +fi + +echo +echononl "Richte MySQL Systemtabellen ein.." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "./scripts/mysql_install_db --no-defaults \ " >> ${logdir}/main.log +echo " --user=$MYSQL_USER \ " >> ${logdir}/main.log +echo " --basedir=$MYSQL_INSTALL_DIR \ " >> ${logdir}/main.log +echo " --datadir=$MYSQL_DATA_DIR \ " >> ${logdir}/main.log +echo " --language=$MYSQL_INSTALL_DIR/share/german" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +./scripts/mysql_install_db --no-defaults \ + --user=$MYSQL_USER \ + --basedir=$MYSQL_INSTALL_DIR \ + --datadir=$MYSQL_DATA_DIR \ + --language=$MYSQL_INSTALL_DIR/share/german \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Einrichten der MySQL Systemtabellen ist fehlgeschlagen.. +fi + +echononl "Setze Besitzer/Gruppe für das Datenbankverzeichnis.." +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Besitzer/Gruppe für das Datenbankverzeichnis $MYSQL_DATA_DIR nicht setzen.. +fi + + +if [ -f ${MYSQL_INSTALL_DIR}/my.cnf ]; then + echononl "Sichere Konfigurationsdatei.." + echo "" >> ${logdir}/main.log + echo "${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}" >> ${logdir}/main.log + mv ${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}/my.cnf.ORIG + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Konnte Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cn nicht sichern.. + fi +fi + +echononl "Erstelle Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf.." + +echo "" >> ${logdir}/main.log +echo "_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l`" >> ${logdir}/main.log +_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l` + +echo "" >> ${logdir}/main.log +echo "let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2" >> ${logdir}/main.log +let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2 + +echo "" >> ${logdir}/main.log +echo "\$MYSQL_THREAD_CONCURRENCY = $MYSQL_THREAD_CONCURRENCY" >> ${logdir}/main.log + +cat << EOF > ${MYSQL_INSTALL_DIR}/my.cnf +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = $MYSQL_UNIX_SOCKET +nice = 0 + +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +# The MySQL server +[mysqld] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +#bind-address = 127.0.0.1 +bind-address = 127.0.0.1 + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=`dirname $MYSQL_INSTALL_DIR`/mysql/share +## - +## - bis 5.1.x +## - +## - language=`dirname $MYSQL_INSTALL_DIR`/mysql/share/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +sort_buffer_size = 2M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +key_buffer_size = 384M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +read_buffer_size = 2M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 4M +max_allowed_packet = 32M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +table_open_cache = 512 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +#table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 16 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +thread_cache_size = 8 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = $_mysql_error_log + + +## - Query Log +## - +#general-log = on +#general_log_file = $_mysql_log + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 128M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = $_mysql_slow_query_log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Default: 16777216 (16M) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/my.cnf\" nicht erstellen.. +fi + +echononl "Kopiere \"stopwords_utf8_iso8859-15.txt\" -> ${MYSQL_INSTALL_DIR}.." +if [ -f "${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt" ];then + cp ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt ${MYSQL_INSTALL_DIR} + if [ "$?" = "0" ]; then + echo_ok + + echononl "Aktiviere Stopword Datei.." + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/\" /usr/local/mysql/my.cnf" >> ${logdir}/main.log + perl -i -n -p -e "s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/" /usr/local/mysql/my.cnf >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Konnte Stopword Datei \"stopwords_utf8_iso8859-15.txt\" nicht aktivieren." + fi + + else + echo_failed + warn "Konnte stopwords_utf8_iso8859-15.txt nicht nach ${MYSQL_INSTALL_DIR} kopieren" + fi +else + echo_skipped + warn "Konnte ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt finden." +fi + + +#echononl "Kopiere Startscript nach /etc/init.d/mysql.server.." +#echo "" >> ${logdir}/main.log +#echo "cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log +#cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +# fatal Konnte Startscript nicht nach /etc/init.d/mysql.server kopieren.. +#fi + +#echononl "Ersetze im Startscript: \"mysql-${_MYSQL_VERSION}\" durch \"mysql\".." +#echo "perl -i -n -p -e \"s/mysql-${_MYSQL_VERSION}/mysql/g\" /etc/init.d/mysql.server" >> ${logdir}/main.log +#perl -i -n -p -e "s/mysql-${_MYSQL_VERSION}/mysql/g" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +#fi +# +#echo "" >> ${logdir}/main.log +#echo "chown root:root /etc/init.d/mysql.server" >> ${logdir}/main.log +#chown root:root /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +# +#echo "" >> ${logdir}/main.log +#echo "chmod 755 /etc/init.d/mysql.server" >> ${logdir}/main.log +#chmod 755 /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + + +if ! $UPDATE_MYSQL ; then + + echononl "Starte MySQL Server beim Booten" + echo "" >> ${logdir}/main.log + echo "update-rc.d mysql.server defaults" >> ${logdir}/main.log + update-rc.d mysql.server defaults >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Konnte MySQL Init Script Links (autom. boot) nicht entfernen.." + fi + + echononl "Starte MySQL Datenbankserver.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/mysql.server start" >> ${logdir}/main.log + /etc/init.d/mysql.server start >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Konnte MySQL Datenbankserver nicht starten.. + fi +fi + +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"DELETE FROM user where User = ''\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "DELETE FROM user where User = ''" >> ${logdir}/main.log 2>&1 + +echononl "Setze root Passwort für den MySQL Zugang" +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"UPDATE user set Password = password('$MYSQL_ROOT_PW')\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "UPDATE user set Password = password('$MYSQL_ROOT_PW')" \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte MySQL root Zugang fü den MySQL Server nicht setzen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +echo +echononl "Erstelle Passwort für maintance (MySQL) User.." +echo "" >> ${logdir}/main.log +PW_GEN=`which pwgen` +if [ -z "$PW_GEN" ]; then + echo "_maint_passwd=\`cat /dev/urandom|tr -dc \"a-zA-Z0-9-_\$\?\" | fold -w16 | head -n 1\`" >> ${logdir}/main.log + _maint_passwd=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?" | fold -w16 | head -n 1` >> ${logdir}/main.log 2>&1 +else + echo "_maint_passwd=\`$PW_GEN -v -B 16 1\`" >> ${logdir}/main.log + _maint_passwd=`$PW_GEN -v -B 16 1` >> ${logdir}/main.log 2>&1 +fi +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Passwort für maintance \(MySQL\) User nicht erstellen.. +fi + +_maint_user=sys-maint +echononl "Erstelle maintance MySQL User \"${_maint_user}\" - localhost.." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte \(MySQL\) User \"${_maint_user}\" nicht erstellen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +_maint_conf_file=${MYSQL_INSTALL_DIR}/sys-maint.cnf +echononl "Erstelle ${_maint_conf_file}.." +cat << EOF > ${MYSQL_INSTALL_DIR}/sys-maint.cnf +[client] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +[mysql_upgrade] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +basedir = /usr +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/sys-maint.cnf\" nicht erstellen.. +fi + + +echononl "Erstelle Logrotate Definitionsdatei /etc/logrotate.d/mysql.." +cat << EOF > /etc/logrotate.d/mysql +$_mysql_log +$_mysql_error_log +$_mysql_slow_query_log +{ + daily + rotate 7 + missingok + create 640 $MYSQL_USER $MYSQL_GROUP + compress + sharedscripts + postrotate + MYSQL="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysql --defaults-file=$_maint_conf_file" + MYADMIN="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysqladmin --defaults-file=$_maint_conf_file" + if [ -z "\`\$MYADMIN ping 2>/dev/null\`" ]; then + echo "Warning: no mysqld running or missing sys-maint user?" + else + \$MYSQL -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2); FLUSH LOGS; select sleep(2); set global long_query_time=@lqt_save;' > /dev/null + fi + endscript +} +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konnte Logrotate Definitionsdatei \"/etc/logrotate.d/mysql\" nicht erstellen.. +fi + + +echo +exit diff --git a/install_mysql-5.7.sh b/install_mysql-5.7.sh new file mode 100755 index 0000000..4afdbc0 --- /dev/null +++ b/install_mysql-5.7.sh @@ -0,0 +1,2285 @@ +#!/usr/bin/env bash + +#_MYSQL_VERSION=5.6.26 +_MYSQL_VERSION=5.7.17 + +_MYSQL_SRC_BASE_DIR=$(dirname $(realpath $0)) + +_MYSQL_LOG_DIR=/var/log/mysql + +_MYSQL_PORT=3306 +_MYSQL_UNIX_SOCKET=/tmp/mysql.sock + + +_MYSQL_USER=mysql +_MYSQL_GROUP=mysql + +_DISTRIBUTION=Debian + +#_VSERVER_GUEST=ja +_VSERVER_GUEST=nein + +_required_debian_packages="libevent-dev + libjemalloc-dev + libboost-all-dev + libreadline-gplv2-dev + libjudy-dev + libpam0g-dev + libpcre3-dev + default-jdk" + + +## - Let make use multiple cores (-j) +## - +export MAKEFLAGS=-j$(expr `grep "^processor" /proc/cpuinfo | sort -u | wc -l` + 1) + + +## --- Some functions +## --- +echononl(){ + echo X\\c > /tmp/shprompt$$ + if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then + echo "$*\\c" 1>&2 + else + echo -e -n "$*" 1>&2 + fi + rm /tmp/shprompt$$ +} + +fatal(){ + echo "" + echo -e "fataler Fehler: $*" + echo "" + echo -e "\t\033[31m\033[1mInstalllation wird abgebrochen\033[m\033[m" + echo "" + exit 1 +} + +error(){ + echo "" + echo -e "\t[ \033[31m\033[1mFehler\033[m ]: $*" + echo "" +} + +warn (){ + echo "" + echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" + echo "" +} + + +echo_ok() { + echo -e "\033[75G[ \033[32mok\033[m ]" + ## echo -e " [ ok ]" +} +echo_failed(){ + echo -e "\033[75G[ \033[1;31mfailed\033[m ]" + ## echo -e " [ failed ]" +} +echo_skipped() { + echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" +} +## --- +## --- END: functions + +_curdir=`pwd` + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo + +## - root user? +## - +if [ "$(id -u)" != "0" ]; then + fatal Skript muss als \"root\" ausgeführt werden +fi + +DISTRIBUTION= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Um welche Linux Distribution handelt es sich?" +echo "" +echo "[1] Debian" +echo "[2] andere" +echo "" +echononl "Eingabe: " + +while [ "$DISTRIBUTION" != "Debian" -a "$DISTRIBUTION" != "other" ];do + read OPTION + case $OPTION in + 1) DISTRIBUTION="Debian" + ;; + 2) DISTRIBUTION="other" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Debian ; 2 = andere ]" + echo "" + echononl "Eingabe:" + ;; + esac +done + +_UPDATE_MYSQL="" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Soll eine vorhanden MySQL Installation geupdateted werden?" +echo "" +echo "[1] Neuinstallation" +echo "[2] Update vorhandener Installation" +echo "" +echononl "Eingabe: " + + +while [ "$_UPDATE_MYSQL" != "update" -a "$_UPDATE_MYSQL" != "new" ];do + read OPTION + case $OPTION in + 1) _UPDATE_MYSQL="new" + ;; + 2) _UPDATE_MYSQL="update" + ;; + *) echo "" + echo -e "\tFalsche Eingabe ! [ 1 = Neuinstallation ; 2 = Update ]" + echo "" + echononl "Eingabe:" + ;; + esac +done +if [ "$_UPDATE_MYSQL" = "update" ];then + UPDATE_MYSQL=true +else + UPDATE_MYSQL=false +fi + + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib die Versionsnummer der MySQL-Distribution an." +echo "" +MYSQL_VERSION= +while [ "X$MYSQL_VERSION" = "X" ] +do + echononl "MySQL Version [$_MYSQL_VERSION]: " + read MYSQL_VERSION + if [ "X$MYSQL_VERSION" = "X" ]; then + MYSQL_VERSION=$_MYSQL_VERSION + fi + + _MYSQL_INSTALL_DIR=/usr/local/mysql-$MYSQL_VERSION + _MYSQL_DATA_DIR=/data/mysql-$MYSQL_VERSION + distfile=mysql-${MYSQL_VERSION}.tar.gz +done +MYSQL_MAJOR_VERSION=`echo $MYSQL_VERSION | cut -d '.' -f1,2` + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des MySQL Sourceverzeichnisses an." +echo "" +MYSQL_SRC_BASE_DIR= +while [ "X$MYSQL_SRC_BASE_DIR" = "X" ] +do + echononl "MySQL Sourceverzeichnis [${_MYSQL_SRC_BASE_DIR}]: " + read MYSQL_SRC_BASE_DIR + if [ "X$MYSQL_SRC_BASE_DIR" = "X" ]; then + MYSQL_SRC_BASE_DIR=$_MYSQL_SRC_BASE_DIR + fi +done +MYSQL_SRC_DIR=${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses in das MySQL installiert werden soll an." +echo "" +MYSQL_INSTALL_DIR= +while [ "X$MYSQL_INSTALL_DIR" = "X" ] +do + echononl "MySQL Installationsverzeichnis [${_MYSQL_INSTALL_DIR}]: " + read MYSQL_INSTALL_DIR + if [ "X$MYSQL_INSTALL_DIR" = "X" ]; then + MYSQL_INSTALL_DIR=$_MYSQL_INSTALL_DIR + LINK=yes + fi + + logdir=${MYSQL_SRC_BASE_DIR}/log-$MYSQL_VERSION + +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des Verzeichnisses für die MySQL-Datenbanken an." +echo "" +MYSQL_DATA_DIR= +while [ "X$MYSQL_DATA_DIR" = "X" ] +do + echononl "MySQL Datenbankverzeichnis [$_MYSQL_DATA_DIR]: " + read MYSQL_DATA_DIR + if [ "X$MYSQL_DATA_DIR" = "X" ]; then + MYSQL_DATA_DIR=$_MYSQL_DATA_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Namen des LOG-Verzeichnisses für die MySQL an. !! NICHT für binäre logfiles !!" +echo "" +MYSQL_LOG_DIR= +while [ "X$MYSQL_LOG_DIR" = "X" ] +do + echononl "MySQL LOG Verzeichniss [$_MYSQL_LOG_DIR]: " + read MYSQL_LOG_DIR + if [ "X$MYSQL_LOG_DIR" = "X" ]; then + MYSQL_LOG_DIR=$_MYSQL_LOG_DIR + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den TCP Port für MySQL an (voreingestell \"${MYSQL_PORT}\")." +echo "" +MYSQL_PORT= +while [ "X$MYSQL_PORT" = "X" ] +do + echononl "MySQL TCP Port [$_MYSQL_PORT]: " + read MYSQL_PORT + if [ "X$MYSQL_PORT" = "X" ]; then + MYSQL_PORT=$_MYSQL_PORT + fi +done + +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib den Unix Socket für MySQL an (voreingestell \"${_MYSQL_UNIX_SOCKET}\")." +echo "" +MYSQL_UNIX_SOCKET= +while [ "X$MYSQL_UNIX_SOCKET" = "X" ] +do + echononl "MySQL UNIX Socket [$_MYSQL_UNIX_SOCKET]: " + read MYSQL_UNIX_SOCKET + if [ "X$MYSQL_UNIX_SOCKET" = "X" ]; then + MYSQL_UNIX_SOCKET=$_MYSQL_UNIX_SOCKET + fi +done + +echo "" +echo "--" +echo "" +echo "Gib den User-Namen und die User-Gruppe unter dem der MySQL-Daemon laufen soll an." +echo "" +MYSQL_USER= +while [ "X$MYSQL_USER" = "X" ] +do + echononl "MySQL-User [${_MYSQL_USER}]: " + read MYSQL_USER + if [ "X$MYSQL_USER" = "X" ]; then + MYSQL_USER=$_MYSQL_USER + fi +done +MYSQL_GROUP= +while [ "X$MYSQL_GROUP" = "X" ] +do + echononl "MySQL-Gruppe [$MYSQL_USER]: " + read MYSQL_GROUP + if [ "X$MYSQL_GROUP" = "X" ]; then + MYSQL_GROUP=$MYSQL_USER + fi +done + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Gib ein Passwort für den root user an.." +echo "" +_MYSQL_ROOT_PW_1="X" +_MYSQL_ROOT_PW_2="Y" +while [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ] +do + echononl "Passworteingabe: " + read -s _MYSQL_ROOT_PW_1 + echo + if [ "X$_MYSQL_ROOT_PW_1" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPassworteingabe erforderlich!\033[m\n" + continue + fi + echononl "Passwortwiederholung: " + read -s _MYSQL_ROOT_PW_2 + echo + if [ "X$_MYSQL_ROOT_PW_2" = "X" ]; then + echo -e "\n\t\033[33m\033[1mPasswortwiederholung erforderlich!\033[m\n" + continue + fi + if [ "$_MYSQL_ROOT_PW_1" != "$_MYSQL_ROOT_PW_2" ];then + echo -e "\n\t\033[33m\033[1mPassworteingaben sind nicht identisch!\033[m\n" + else + MYSQL_ROOT_PW=$_MYSQL_ROOT_PW_1 + fi +done + +if $UPDATE_MYSQL ; then + __SYMLINK_INITSCRIPT=nein + __SYMLINK_INSTALL_DIR=nein + __SYMLINK_DATA_DIR=nein +else + __SYMLINK_INITSCRIPT=ja + __SYMLINK_INSTALL_DIR=ja + __SYMLINK_DATA_DIR=ja +fi + +clear +echo -e "\033[21G\033[32mInstallationsscript für die Mysql Datenbank \033[m" +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Symlinks:" +echo "" +echo " - Setze Symlink für das Init Skript (/etc/init.d/mysql.server)" +echo " - Setze Sysmlink for das Installationsverzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql" +echo " - Setze Sysmlink for das Datenverzeichnis `dirname $MYSQL_DATA_DIR`/mysql" +echo "" +_SYMLINK_INITSCRIPT="" +echononl "Sysmlink für das Init Skript? (ja/nein) [${__SYMLINK_INITSCRIPT}]: " +read _SYMLINK_INITSCRIPT +if [ "X$_SYMLINK_INITSCRIPT" = "X" ];then + _SYMLINK_INITSCRIPT=$__SYMLINK_INITSCRIPT +fi + +while [ "$_SYMLINK_INITSCRIPT" != "ja" \ + -a "$_SYMLINK_INITSCRIPT" != "Ja" \ + -a "$_SYMLINK_INITSCRIPT" != "nein" \ + -a "$_SYMLINK_INITSCRIPT" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INITSCRIPT +done +if [ "$_SYMLINK_INITSCRIPT" = "ja" -o "$_SYMLINK_INITSCRIPT" = "Ja" ]; then + SYMLINK_INITSCRIPT=true +else + SYMLINK_INITSCRIPT=false +fi + +echo "" +_SYMLINK_INSTALL_DIR="" +echononl "Sysmlink für das Installationsverzeichnis? (ja/nein) [${__SYMLINK_INSTALL_DIR}]: " +read _SYMLINK_INSTALL_DIR +if [ "X$_SYMLINK_INSTALL_DIR" = "X" ];then + _SYMLINK_INSTALL_DIR=$__SYMLINK_INSTALL_DIR +fi + +while [ "$_SYMLINK_INSTALL_DIR" != "ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "Ja" \ + -a "$_SYMLINK_INSTALL_DIR" != "nein" \ + -a "$_SYMLINK_INSTALL_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_INSTALL_DIR +done +if [ "$_SYMLINK_INSTALL_DIR" = "ja" -o "$_SYMLINK_INSTALL_DIR" = "Ja" ]; then + SYMLINK_INSTALL_DIR=true +else + SYMLINK_INSTALL_DIR=false +fi + +echo "" +_SYMLINK_DATA_DIR="" +echononl "Sysmlink für das Datenverzeichnis? (ja/nein) [${__SYMLINK_DATA_DIR}]: " +read _SYMLINK_DATA_DIR +if [ "X$_SYMLINK_DATA_DIR" = "X" ];then + _SYMLINK_DATA_DIR=$__SYMLINK_DATA_DIR +fi + +while [ "$_SYMLINK_DATA_DIR" != "ja" \ + -a "$_SYMLINK_DATA_DIR" != "Ja" \ + -a "$_SYMLINK_DATA_DIR" != "nein" \ + -a "$_SYMLINK_DATA_DIR" != "Nein" ]; do + echononl "Falsche Eingabe. (ja/nein): " + read _SYMLINK_DATA_DIR +done +if [ "$_SYMLINK_DATA_DIR" = "ja" -o "$_SYMLINK_DATA_DIR" = "Ja" ]; then + SYMLINK_DATA_DIR=true +else + SYMLINK_DATA_DIR=false +fi + + + +OK= +echo "" +echo -e "\033[32m--\033[m" +echo "" +echo "Ist dies ein VServer Gastsystem?" +echo "" +echononl "VServer Gastsystem (ja/nein) [$_VSERVER_GUEST]: " +read OK +if [ "X$OK" = "X" ]; then + OK=$_VSERVER_GUEST +fi +OK=`echo "$OK" | tr '[:upper:]' '[:lower:]'` +while [ "X$OK" != "Xja" -a "X$OK" != "Xnein" ]; do + echo "" + echononl "\twrong entry! [ja/nein]: " + read OK + OK=`echo "$OK" | tr '[:upper:]' '[:lower:]'` +done +if [ "$OK" = "ja" ]; then + SYSTEMD_EXISTS=false +else + if [ "X`which systemd`" = "X" ]; then + SYSTEMD_EXISTS=false + else + SYSTEMD_EXISTS=true + fi +fi + + +clear +echo -e "\033[21G\033[32mStarte Installation mit folgenden Parametern:\033[m" +echo "" +if ! $UPDATE_MYSQL ; then + echo -e "-- \033[33m\033[1mNeusistallation\033[m --" +else + echo -e "-- \033[33m\033[1mUpdate\033[m (Erstzen einer vorhandenen Installation) --" +fi +echo "" +echo "Linuxdistribution.........: $DISTRIBUTION" +echo "" +echo "MySQL Versionsnummer......: $MYSQL_VERSION" +echo " MySQL Major Verion......: $MYSQL_MAJOR_VERSION" +echo "" +echo "Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" +echo "Installationsverzeichnis..: $MYSQL_INSTALL_DIR" +echo "Datenbankverzeichnis......: $MYSQL_DATA_DIR" +echo "Log Verzeichnis...........: $MYSQL_LOG_DIR" +echo "TCP Port..................: $MYSQL_PORT" +echo "Unix Socket...............: $MYSQL_UNIX_SOCKET" +echo "MySQL-User................: $MYSQL_USER" +echo "MySQL-Gruppe..............: $MYSQL_GROUP" +echo "" +echo "Symlink Initskript........: $SYMLINK_INITSCRIPT" +echo "Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" +echo "Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" +echo "" +echo "Using systemd.............: $SYSTEMD_EXISTS" +echo "" +echononl "einverstanden [ja/nein]: " +read OK +while [ "X$OK" != "Xja" -a "X$OK" != "XJa" -a "X$OK" != "Xnein" -a "X$OK" != "XNein" ] +do + echononl "falsche Angabe! [ja/nein]: " + read OK +done +[ $OK = "ja" -o $OK = "Ja" ] || fatal wiederhole Installation zur Eingabe anderer Parameter + + + +## - Sorcecode Verzeichnis vorhanden? +## - +if [ ! -d ${MYSQL_SRC_BASE_DIR} ] ; then + fatal "Kann MySQL Sourcecode Verzeichnis \"${MYSQL_SRC_BASE_DIR}\" nicht finden." +fi + + +## - Sorcecode vorhanden? +## - +if [ ! -f ${MYSQL_SRC_BASE_DIR}/$distfile ] ; then + + echo "" + + echononl "Download $distfile ..." + wget -O ${MYSQL_SRC_BASE_DIR}/$distfile https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile 2>/dev/null + + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Downloading $distfile (https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_MAJOR_VERSION}/$distfile) Fehlgeschlagen." + fi +fi + +echo "" + + +## - Erstelle Logverzeichnis +## - +if [ -d $logdir ]; then + echononl "Verschiebe exitierendes Logverzeichnis ..." + mv $logdir $logdir.`date +"%Y%m%d-%H%M"` + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht verschieben.. + fi +fi + +echononl "Erstelle Logverzeichnis \"${logdir}\".." +mkdir -p $logdir > /dev/null 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Logverzeichnis \"${logdir}\" nicht erstellen.. +fi +touch ${logdir}/main.log +echo -e "## - Starte Installation mit folgenden Parametern:" >> ${logdir}/main.log +echo "## -" >> ${logdir}/main.log +if ! $UPDATE_MYSQL ; then + echo "## - Neusistallation" >> ${logdir}/main.log +else + echo "## - Update (Erstzen einer vorhandenen Installation)" >> ${logdir}/main.log +fi +echo "## -" >> ${logdir}/main.log +echo "## - Linuxdistribution.........: $DISTRIBUTION" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - MySQL Versionsnummer......: $MYSQL_VERSION" >> ${logdir}/main.log +echo "## - MySQL Major Verion.....: $MYSQL_MAJOR_VERSION" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Sourcecodeverzeicnis......: $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "## - Installationsverzeichnis..: $MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Datenbankverzeichnis......: $MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "## - Log Verzeichnis...........: $MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "## - TCP Port..................: $MYSQL_PORT" >> ${logdir}/main.log +echo "## - Unix Socket...............: $MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "## - MySQL-User................: $MYSQL_USER" >> ${logdir}/main.log +echo "## - MySQL-Gruppe..............: $MYSQL_GROUP" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "## - Symlink Initskript........: $SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "## - Symlink Installationsverz.: $SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "## - Symlink Datenverzeichnis..: $SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "## - " >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +echo "UPDATE_MYSQL=$UPDATE_MYSQL" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "DISTRIBUTION=$DISTRIBUTION" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "MYSQL_VERSION=$MYSQL_VERSION" >> ${logdir}/main.log +echo "MYSQL_SRC_BASE_DIR=$MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log +echo "MYSQL_INSTALL_DIR=$MYSQL_INSTALL_DIR" >> ${logdir}/main.log +echo "MYSQL_DATA_DIR=$MYSQL_DATA_DIR" >> ${logdir}/main.log +echo "MYSQL_LOG_DIR=$MYSQL_LOG_DIR" >> ${logdir}/main.log +echo "MYSQL_PORT=$MYSQL_PORT" >> ${logdir}/main.log +echo "MYSQL_UNIX_SOCKET=$MYSQL_UNIX_SOCKET" >> ${logdir}/main.log +echo "MYSQL_USER=$MYSQL_USER" >> ${logdir}/main.log +echo "MYSQL_GROUP=$MYSQL_GROUP" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log +echo "SYMLINK_INITSCRIPT=$SYMLINK_INITSCRIPT" >> ${logdir}/main.log +echo "SYMLINK_INSTALL_DIR=$SYMLINK_INSTALL_DIR" >> ${logdir}/main.log +echo "SYMLINK_DATA_DIR=$SYMLINK_DATA_DIR" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + + +_MYSQL_INITSCRIPT= +if [ -f /etc/init.d/mysql.server ];then + _MYSQL_INITSCRIPT="mysql.server" +elif [ -f /etc/init.d/mysql ];then + _MYSQL_INITSCRIPT="mysql" +fi + +if ! $UPDATE_MYSQL ; then + + if [ "X${_MYSQL_INITSCRIPT}X" != "XX" ];then + + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" != "XX" ];then + echononl "Stoppe mysql Server.." + echo "" >> ${logdir}/main.log + echo "/etc/init.d/$_MYSQL_INITSCRIPT stop" >> ${logdir}/main.log + /etc/init.d/$_MYSQL_INITSCRIPT stop >> ${logdir}/main.log 2>&1 + sleep 5 + PID=`ps aux | grep "mysqld_safe" | grep -v grep | awk '{print$2}'` + if [ "X${PID}X" = "XX" ]; then + echo_ok + else + echo_failed + + PID=`ps aux | grep "mysqld" | grep -v grep | awk '{print$2}'` + echononl "Abbruch (kill -9) aller mysqld Prozesse.." + echo "" >> ${logdir}/main.log + echo "kill -9 $PID" >> ${logdir}/main.log 2>&1 + kill -9 $PID + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + fi + + fi + + ## - Entferne symbolische Links aus den Run Level Verzeichnissen + ## - + echononl "Entferne symbolische Links aus den Run Level Verzeichnissen" + echo "" >> ${logdir}/main.log + echo "update-rc.d -f $_MYSQL_INITSCRIPT remove" >> ${logdir}/main.log + update-rc.d -f $_MYSQL_INITSCRIPT remove >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann symbolische Links (Run Level Verzeichnisse) nicht entfernen." + fi + + if [ -f "/etc/init.d/$_MYSQL_INITSCRIPT" ]; then + echononl "Entferne existierendes Initskript" + echo "" >> ${logdir}/main.log + echo "rm -f /etc/init.d/$_MYSQL_INITSCRIPT" >> ${logdir}/main.log + rm -f /etc/init.d/$_MYSQL_INITSCRIPT >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann Mexistierendes Initskript nicht entfernen." + fi + fi + fi + + ## - Uninstall debian mysql packages if installed + ## - + if [ "$DISTRIBUTION" = "Debian" ]; then + echononl "Deinstalliere Debian MySQL Pakete.." + _INSTALLED_MYSQL_DEB=`dpkg -l | grep mysql | grep -e "^i" | awk '{print$2}'` + INSTALLED_MYSQL_DEB= + for deb in $_INSTALLED_MYSQL_DEB ; do + INSTALLED_MYSQL_DEB="$INSTALLED_MYSQL_DEB $deb" + done + if [ -n "$INSTALLED_MYSQL_DEB" ]; then + echo "" >> ${logdir}/main.log + echo "apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB" >> ${logdir}/main.log + apt-get remove --purge -q -y $INSTALLED_MYSQL_DEB >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann MySQL Packete nicht deinstalieren.. + fi + else + echo_skipped + fi + fi + + + echononl "Update index files of the debian repositories" + echo "apt-get update" >> ${logdir}/apt-install.log + apt-get update >> ${logdir}/apt-install.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + echo "" >> ${logdir}/apt-install.log + else + echo_failed + fatal "\"apt-get update\" failed!" + fi + + + ## - Install cmake if not exists + ## + echononl "Installing \"cmake\".." + _cmake=`which cmake` + if [ "X$_cmake" = "X" ]; then + echo "DEBIAN_FRONTEND=noninteractive apt-get install -q -y cmake" >> ${logdir}/apt-install.log + DEBIAN_FRONTEND=noninteractive apt-get install -q -y cmake >> ${logdir}/apt-install.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + echo "" >> ${logdir}/apt-install.log + else + echo_failed + fatal Kann \"cmake\" nicht installieren.. + fi + else + echo_skipped + fi + + ## - Install further debian packages + ## - + declare -a deb_package_arr + for _debian_pkg in $_required_debian_packages ; do + deb_package_arr+=("$_debian_pkg") + done + + for _debian_pkg in ${deb_package_arr[@]} ; do + + echononl "Installing $_debian_pkg .." + if ! dpkg -l $_debian_pkg 2> /dev/null | grep -e "^ii" > /dev/null 2>&1 ; then + + echo "" >> ${logdir}/apt-install.log + echo "DEBIAN_FRONTEND=noninteractive apt-get install -q -y $_debian_pkg" >> ${logdir}/apt-install.log + + DEBIAN_FRONTEND=noninteractive apt-get install -q -y $_debian_pkg >> ${_logdir}/debian-install.log 2>&1 + if [ "$?" = 0 ]; then + echo_ok + echo "" >> ${logdir}/apt-install.log + else + echo_failed + fatal "Installing debian package \"$_debian_pkg\" failed!" + fi + else + echo_skipped + fi + done + + if ! grep -q -E "export\s*JAVA_HOME" /etc/profile.d/* > /dev/null 2>&1 ; then + echo "export JAVA_HOME=/usr/lib/jvm/default-java" >> /etc/profile.d/java.sh + export JAVA_HOME=/usr/lib/jvm/default-java + fi + + ## - Install dependency packages for \"mysql-server\" + ## - + echononl "Installing dependency packages for \"mysql-server\"" + echo "DEBIAN_FRONTEND=noninteractive apt-get -q -y build-dep mysql-server" >> ${logdir}/apt-install.log 2>&1 + + DEBIAN_FRONTEND=noninteractive apt-get -q -y build-dep mysql-server >> ${logdir}/apt-install.log 2>&1 + if [ "$?" = 0 ]; then + echo_ok + echo "" >> ${logdir}/apt-install.log + else + echo_failed + fatal "Installing dependency packages for \"mysql-server\" failed!" + fi + +# if apt-cache search mariadb-server | grep -q -E "^mariadb-server" > /dev/null 2>&1 ; then +# echononl "Installing dependency packages for \"mariadb-server\"" +# echo "DEBIAN_FRONTEND=noninteractive apt-get -q -y build-dep mariadb-server" >> ${logdir}/apt-install.log 2>&1 +# +# DEBIAN_FRONTEND=noninteractive apt-get -q -y build-dep mariadb-server >> ${logdir}/apt-install.log 2>&1 +# if [ "$?" = 0 ]; then +# echo_ok +# echo "" >> ${logdir}/apt-install.log +# else +# echo_failed +# fatal "Installing dependency packages for \"mariadb-server\" failed!" +# fi +# fi + + + echononl "Adding Group \"$MYSQL_GROUP\".." + if cat /etc/group | grep -e "^${MYSQL_GROUP}:" > /dev/null 2>&1 ; then + echo_skipped + else + groupadd -r $MYSQL_GROUP > ${logdir}/groupadd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Gruppe \"${MYSQL_GROUP}\" nicht erstellen.. + fi + fi + + echononl "Adding User \"$MYSQL_USER\".." + if id -u $MYSQL_USER > /dev/null 2>&1; then + echo_skipped + else + useradd -r -M -d /noexistent -s /bin/false -g $MYSQL_GROUP $MYSQL_USER > ${logdir}/useradd.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann User \"${MYSQL_USER}\" nicht erstellen.. + fi + fi +fi + + +if [ -d $MYSQL_DATA_DIR ]; then + echononl "Verschiebe exitierendes MySQL Datenbank-Verzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_DATA_DIR ${MYSQL_DATA_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_DATA_DIR ${MYSQL_DATA_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Datenbank-Verzeichnis \"${MYSQL_DATA_DIR}\" nicht verschieben.. + fi +fi + + +echononl "Erstelle Datenbank-Verzeichnis \"$MYSQL_DATA_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_DATA_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Datenbank-Verzeichnis \"${MYSQL_DATA_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für Datenbank-Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für Datenbank-Verzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"700\" für Datenbank-Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 700 ${MYSQL_DATA_DIR}" >> ${logdir}/main.log +chmod 700 ${MYSQL_DATA_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für Datenbank-Verzeichnis \"${MYSQL_DATA_DIR}\" nicht ändern.. +fi + + +echononl "Erstelle LOG Verzeichnis \"$MYSQL_LOG_DIR\".." +echo "" >> ${logdir}/main.log +echo "mkdir -p $MYSQL_LOG_DIR" >> ${logdir}/main.log +mkdir -p $MYSQL_LOG_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok + _mysql_log=${MYSQL_LOG_DIR}/mysql.log + _mysql_error_log=${MYSQL_LOG_DIR}/mysql.err + _mysql_slow_query_log=${MYSQL_LOG_DIR}/slow_query.log +else + echo_failed + fatal Kann LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht erstellen.. +fi + +echononl "Setze Besitzer \"${MYSQL_USER}:${MYSQL_GROUP}\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:${MYSQL_GROUP} ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Besitzer für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + +echononl "Setze Verzeichnisrechte \"2750\" für LOG Verzeichnis" +echo "" >> ${logdir}/main.log +echo "chmod 2750 ${MYSQL_LOG_DIR}" >> ${logdir}/main.log +chmod 2750 ${MYSQL_LOG_DIR} >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann Verzeichnisrechte für LOG Verzeichnis \"${MYSQL_LOG_DIR}\" nicht ändern.. +fi + + +#if [ -d "${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION" ];then +# echononl "Verschiebe exitierendes Sourceverzeichnis ..." +# echo "" >> ${logdir}/main.log +# echo "mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log +# mv ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION ${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION.`date +"%Y%m%d-%H%M"` \ +# >> ${logdir}/main.log 2>&1 +# if [ "$?" = "0" ]; then +# echo_ok +# else +# echo_failed +# fatal Kann Sourceverzeichnis \"${MYSQL_SRC_BASE_DIR}/mysql-$MYSQL_VERSION\" nicht verschieben.. +# fi +#fi + + +if [ -d "${MYSQL_SRC_DIR}" ];then + echononl "Verschiebe exitierendes Sourceverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv ${MYSQL_SRC_DIR} ${MYSQL_SRC_DIR}.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Sourceverzeichnis \"${MYSQL_SRC_DIR}\" nicht verschieben.. + fi +fi + + +cd $MYSQL_SRC_BASE_DIR +echo "" >> ${logdir}/main.log +echo "cd $MYSQL_SRC_BASE_DIR" >> ${logdir}/main.log + +echo +echononl "Entpacke $distfile ..." +echo "" >> ${logdir}/main.log +echo "gunzip < $distfile | tar -xf -" >> ${logdir}/main.log + +gunzip < $distfile | tar -xf - +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kann MySQL Sourcearchiv \"${distfile}\" nicht entpacken.. +fi + +cd ${MYSQL_SRC_DIR} +echo "" >> ${logdir}/main.log +echo "cd ${MYSQL_SRC_DIR}" >> ${logdir}/main.log + +if [ -d ${MYSQL_INSTALL_DIR} ];then + echononl "Verschiebe exitierendes Installationsverzeichnis ..." + echo "" >> ${logdir}/main.log + echo "mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +\"%Y%m%d-%H%M\"`" >> ${logdir}/main.log + mv $MYSQL_INSTALL_DIR $MYSQL_INSTALL_DIR.`date +"%Y%m%d-%H%M"` >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi +fi + +echononl "Konfiguriere MySQL (cmake).." +echo "" >> ${logdir}/main.log +echo "cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR -D MYSQL_DATADIR=$MYSQL_DATA_DIR . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$MYSQL_INSTALL_DIR" >> ${logdir}/main.log +cmake -D CMAKE_INSTALL_PREFIX=$MYSQL_INSTALL_DIR \ + -D MYSQL_DATADIR=$MYSQL_DATA_DIR . \ + -DDOWNLOAD_BOOST=1 \ + -DWITH_BOOST=$MYSQL_INSTALL_DIR > ${logdir}/cmake-conf.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Konfiguration fehlgeschlagen. Siehe ${logdir}/cmake-conf.log .. +fi + +echononl "Kompiliere MySQL.." +echo "" >> ${logdir}/main.log +echo "make" >> ${logdir}/main.log +make > ${logdir}/make.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Kompilieren der MySQL Sourcen ist fehlgeschlagen. Siehe ${logdir}/make.log .. +fi + +echononl "Installiere MySQL.." +echo "" >> ${logdir}/main.log +echo "make install" >> ${logdir}/main.log +make install > ${logdir}/make_install.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Installieren von MySQL ist fehlgeschlagen. Siehe ${logdir}/make_install.log .. +fi + +echononl "Konfiguriere Manpages.." +_done=false +if [ -f /etc/manpath.config ];then + if ! grep /usr/local/mysql/man /etc/manpath.config > /dev/null 2<&1 ; then + echo >> /etc/manpath.config + echo "MANDATORY_MANPATH /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + echo "MANPATH_MAP /usr/local/mysql/bin /usr/local/mysql/man" >> /etc/manpath.config + echo "MANDB_MAP /usr/local/mysql/man /var/cache/man" >> /etc/manpath.config + + _done=true + fi +elif [ -f /etc/man.conf];then + if ! grep /opt/apache2/man /etc/man.conf > /dev/null 2<&1 ; then + echo >> /etc/man.conf + echo "MANPATH /opt/mysql/man /var/cache/man" >> /etc/man.conf + echo "MANPATH_MAP /opt/mysql/bin /opt/apache2/man" >> /etc/man.conf + + _done=true + fi +fi +if $_done ; then + echo_ok +else + echo_skipped +fi + + +if $SYMLINK_INITSCRIPT ; then + + if [ -h "/etc/init.d/mysql.server" ]; then + echononl "Entferne vorhandenen Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "rm /etc/init.d/mysql.server" >> ${logdir}/main.log + rm /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink /etc/init.d/mysql.server nicht entfernen.. + fi + fi + + echononl "Erstelle Symlink \"/etc/init.d/mysql.server\".." + echo "" >> ${logdir}/main.log + echo "ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log + ln -s $MYSQL_INSTALL_DIR/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error "Kann Symlink $MYSQL_INSTALL_DIR/support-files/mysql.server --> /etc/init.d/mysql.server nicht erstellen.." + fi + + echononl "Setze ulimit im Startscript.." + echo "" >> ${logdir}/main.log + echo "sed -i \"1 s/\(.*\)/\1\n\nulimit -n \\\`ulimit -Hn\\\`\n/\" /etc/init.d/mysql.server" >> ${logdir}/main.log + sed -i "1 s/\(.*\)/\1\n\nulimit -n \`ulimit -Hn\`\n/" $(realpath /etc/init.d/mysql.server) >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fatal "Kann \"ulimit\" im Startscript nicht setzen /etc/init.d/mysql.server nicht setzen.." + fi + +fi + +## - Symlink Installationsverzeichnis (i.d.R. /usr/local/mysql) +## - +if $SYMLINK_INSTALL_DIR ; then + + if [ -h `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_INSTALL_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `dirname $MYSQL_INSTALL_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_INSTALL_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_INSTALL_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_INSTALL_DIR`/mysql `dirname $MYSQL_INSTALL_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Installationsverzeichnis \"${MYSQL_INSTALL_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_INSTALL_DIR`/mysql --> $MYSQL_INSTALL_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_INSTALL_DIR` `dirname $MYSQL_INSTALL_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `basename $MYSQL_INSTALL_DIR` --> `dirname $MYSQL_INSTALL_DIR`/mysql nicht erstellen .. + fi +fi + +## - Symlink Datenverzeichnis +## - +if $SYMLINK_DATA_DIR ; then + + if [ -h `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Entferne vorhandenen Symlink `dirname $MYSQL_DATA_DIR`/mysql.." + echo "" >> ${logdir}/main.log + echo "rm `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + rm `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `dirname $MYSQL_DATA_DIR`/mysql nicht entfernen.. + fi + fi + + if [ -d `dirname $MYSQL_DATA_DIR`/mysql ]; then + echononl "Verschiebe Verzeichnis `dirname $MYSQL_DATA_DIR`/mysql ..." + echo "" >> ${logdir}/main.log + echo "mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +\"%Y%m%d-%H%M\"`" \ + >> ${logdir}/main.log + mv `dirname $MYSQL_DATA_DIR`/mysql `dirname $MYSQL_DATA_DIR`/mysql.`date +"%Y%m%d-%H%M"` \ + >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Datenverzeichnis \"${MYSQL_DATA_DIR}\" nicht verschieben.. + fi + fi + + echononl "Erstelle Symlink `dirname $MYSQL_DATA_DIR`/mysql --> $MYSQL_DATA_DIR" + echo "" >> ${logdir}/main.log + echo "ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql" >> ${logdir}/main.log + ln -s `basename $MYSQL_DATA_DIR` `dirname $MYSQL_DATA_DIR`/mysql >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Kann Symlink `basename $MYSQL_DATA_DIR` --> `dirname $MYSQL_DATA_DIR`/mysql nicht erstellen .. + fi +fi + + +echononl "Füge `dirname $MYSQL_INSTALL_DIR`/mysql/bin zur PATH Variable hinzu .." +if [ -f /etc/profile ]; then + _mysql_bin_dir="`dirname $MYSQL_INSTALL_DIR`/mysql/bin" + if ! grep -e "PATH=.*$_mysql_bin_dir" /etc/profile > /dev/null 2<&1 ; then + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s#^([ ]*export[ ]*PATH.*$)#check_dir=\$_mysql_bin_dir\nif [ -d \\\"\\\\\\\$check_dir\\\" ];then\n PATH=\\\\\\\${check_dir}:\\\\\\\$PATH\nfi\n\n\1#\" /etc/profile" >> ${logdir}/main.log 2<&1 + perl -i -n -p -e "s#^([ ]*export[ ]*PATH.*$)#check_dir=$_mysql_bin_dir\nif [ -d \"\\\$check_dir\" ];then\n PATH=\\\${check_dir}:\\\$PATH\nfi\n\n\1#" /etc/profile >> ${logdir}/main.log 2<&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + fi + + if ! echo "$PATH" | grep $_mysql_bin_dir >> ${logdir}/main.log 2>&1 ; then + export PATH=${_mysql_bin_dir}:$PATH + fi + + else + echo_skipped + fi +else + echo_skipped +fi + + +echo +echononl "Erstelle Konfigurationsdatei /etc/ld.so.conf.d/mysql.conf.." +cat << EOF >/etc/ld.so.conf.d/mysql.conf +`dirname $MYSQL_INSTALL_DIR`/mysql/lib +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Kann Datei /etc/ld.so.conf.d/mysql.conf für dynamischen Linker nicht erstellen .. +fi + +echononl "Erstelle symbolische Links auf Libraries (ldconfig).." +echo "" >> ${logdir}/main.log +echo "ldconfig" >> ${logdir}/main.log +ldconfig >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error "Der Befehl \"ldconfig\" ist fehgeschlagen" +fi + +echo +echononl "Richte MySQL Systemtabellen ein.." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "./bin/mysqld --initialize-insecure \ " >> ${logdir}/main.log +echo " --user=$MYSQL_USER \ " >> ${logdir}/main.log +echo " --basedir=$MYSQL_INSTALL_DIR \ " >> ${logdir}/main.log +echo " --datadir=$MYSQL_DATA_DIR \ " >> ${logdir}/main.log +echo " --language=$MYSQL_INSTALL_DIR/share/german" >> ${logdir}/main.log +echo "" >> ${logdir}/main.log + +./bin/mysqld --initialize-insecure \ + --user=$MYSQL_USER \ + --basedir=$MYSQL_INSTALL_DIR \ + --datadir=$MYSQL_DATA_DIR \ + --lc-messages-dir=$MYSQL_INSTALL_DIR/share/german \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + fatal Das Einrichten der MySQL Systemtabellen ist fehlgeschlagen.. +fi + +echononl "Create directory \"mysql-files\".." +cd $MYSQL_INSTALL_DIR +echo "" >> ${logdir}/main.log +echo "mkdir mysql-files" >> ${logdir}/main.log +mkdir mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Change rights (770) to directory \"mysql-files\".." +echo "chmod 770 mysql-files" >> ${logdir}/main.log +chmod 770 ${MYSQL_INSTALL_DIR}/mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Change owner ($MYSQL_USER) of directory \"mysql-files\".." +echo "chown $MYSQL_USER mysql-files" >> ${logdir}/main.log +chown $MYSQL_USER ${MYSQL_INSTALL_DIR}/mysql-files >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Generate MySQL SSL Certificate and RSA Key.." +cd $MYSQL_INSTALL_DIR +echo "bin/mysql_ssl_rsa_setup --datadir=$MYSQL_DATA_DIR .." >> ${logdir}/main.log +bin/mysql_ssl_rsa_setup --datadir=$MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed +fi + +echononl "Setze Besitzer/Gruppe für das Datenbankverzeichnis.." +echo "" >> ${logdir}/main.log +echo "chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR" >> ${logdir}/main.log +chown -R ${MYSQL_USER}:$MYSQL_GROUP $MYSQL_DATA_DIR >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Besitzer/Gruppe für das Datenbankverzeichnis $MYSQL_DATA_DIR nicht setzen.. +fi + + +if [ -f ${MYSQL_INSTALL_DIR}/my.cnf ]; then + echononl "Sichere Konfigurationsdatei.." + echo "" >> ${logdir}/main.log + echo "${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}" >> ${logdir}/main.log + mv ${MYSQL_INSTALL_DIR}/my.cnf ${MYSQL_INSTALL_DIR}/my.cnf.ORIG + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Konnte Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf nicht sichern.. + fi +fi + +echononl "Erstelle Konfigurationsdatei ${MYSQL_INSTALL_DIR}/my.cnf.." + +echo "" >> ${logdir}/main.log +echo "_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l`" >> ${logdir}/main.log +_number_cpus=`grep "^processor" /proc/cpuinfo | sort -u | wc -l` + +echo "" >> ${logdir}/main.log +echo "let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2" >> ${logdir}/main.log +let MYSQL_THREAD_CONCURRENCY=$_number_cpus*2 + +echo "" >> ${logdir}/main.log +echo "\$MYSQL_THREAD_CONCURRENCY = $MYSQL_THREAD_CONCURRENCY" >> ${logdir}/main.log + +cat << EOF > ${MYSQL_INSTALL_DIR}/my.cnf +# Example MySQL config file for very large systems. +# +# This is for a large system with memory of 1G-2G where the system runs mainly +# MySQL. +# +# You can copy this file to +# /etc/my.cnf to set global options, +# mysql-data-dir/my.cnf to set server-specific options (in this +# installation this directory is /var/lib/mysql) or +# ~/.my.cnf to set user-specific options. +# +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program +# with the "--help" option. + +# The following options will be passed to all MySQL clients +[client] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +# Here follows entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = $MYSQL_UNIX_SOCKET +nice = 0 + +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +# The MySQL server +[mysqld] +port = $MYSQL_PORT +socket = $MYSQL_UNIX_SOCKET + +## - skip_external_locking +## - +## - Affects only MyISAM table access. +## - +## - This is OFF if mysqld uses external locking (system locking), +## - ON if external locking is disabled. +## - +## - Default: ON +## - +skip-external-locking + + +# Don't listen on a TCP/IP port at all. This can be a security enhancement, +# if all processes that need to connect to mysqld run on the same host. +# All interaction with mysqld must be made via Unix sockets or named pipes. +# Note that using this option without enabling named pipes on Windows +# (via the "enable-named-pipe" option) will render mysqld useless! +# +#skip-networking + + +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +# +#bind-address = 127.0.0.1 +bind-address = 127.0.0.1 + + +# Replication Master Server (default) +# binary logging is required for replication +#log-bin=mysql-bin + +# required unique id between 1 and 2^32 - 1 +# defaults to 1 if master-host is not set +# but will not function as a master if omitted +server-id = 1 + +# Replication Slave (comment out master section to use this) +# +# To configure this host as a replication slave, you can choose between +# two methods : +# +# 1) Use the CHANGE MASTER TO command (fully described in our manual) - +# the syntax is: +# +# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=, +# MASTER_USER=, MASTER_PASSWORD= ; +# +# where you replace , , by quoted strings and +# by the master's port number (3306 by default). +# +# Example: +# +# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306, +# MASTER_USER='joe', MASTER_PASSWORD='secret'; +# +# OR +# +# 2) Set the variables below. However, in case you choose this method, then +# start replication for the first time (even unsuccessfully, for example +# if you mistyped the password in master-password and the slave fails to +# connect), the slave will create a master.info file, and any later +# change in this file to the variables' values below will be ignored and +# overridden by the content of the master.info file, unless you shutdown +# the slave server, delete master.info and restart the slaver server. +# For that reason, you may want to leave the lines below untouched +# (commented) and instead use CHANGE MASTER TO (see above) +# +# required unique id between 2 and 2^32 - 1 +# (and different from the master) +# defaults to 2 if master-host is set +# but will not function as a slave if omitted +#server-id = 2 +# +# The replication master for this slave - required +#master-host = +# +# The username the slave will use for authentication when connecting +# to the master - required +#master-user = +# +# The password the slave will authenticate with when connecting to +# the master - required +#master-password = +# +# The port the master is listening on. +# optional - defaults to 3306 +#master-port = +# +# binary logging - not required for slaves, but recommended +#log-bin=mysql-bin +# +# binary logging format - mixed recommended +#binlog_format=mixed + +# Point the following paths to different dedicated disks +#tmpdir = /tmp/ +#log-update = /path-to-dedicated-directory/hostname + + +## - max_connections +## - +## - Die zulässige Anzahl nebenläufiger Clientverbindungen. Wenn dieser Wert erhöht +## - wird, erhöht sich auch die Anzahl der Dateideskriptoren, die mysqld benötigt. +## - +## - Vorgabewert ist 100 +## - +#max_connections = 300 + + +## - explicit_defaults_for_timestamp +## - +## - This variable was added in MySQL 5.6.6 +## - +## - In MySQL, the TIMESTAMP data type differs in nonstandard ways +## - from other data types. See MySQL Dokumentation. +## - +## - [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. +## - Please use --explicit_defaults_for_timestamp server option (see +## - documentation for more details). +## - +## - As indicated by the warning, to turn off the nonstandard behaviors, +## - enable the new . +## - +explicit_defaults_for_timestamp = TRUE + + +## - MySQL Fehlermeldungen +## - +## - !! Notice +## - erst ab für mysql 5.5.x +## - +## - lc-messages=de_DE +## - lc-messages-dir=`dirname $MYSQL_INSTALL_DIR`/mysql/share +## - +## - bis 5.1.x +## - +## - language=`dirname $MYSQL_INSTALL_DIR`/mysql/share/german +## - + + +## - low-priority-updates +## - +## - Give table-modifying operations (INSERT, REPLACE, DELETE, +## - UPDATE) lower priority than selects. +## - +## - +low-priority-updates = 1 + + +## - concurrent_insert +## - +## - If activated (1 or AUTO, the default), MySQL permits INSERT +## - and SELECT statements to run concurrently for MyISAM tables +## - that have no free blocks in the middle of the data file. +## - +## - If set to 2 or ALWAYS, MySQL enables concurrent inserts for +## - all MyISAM tables, even those that have holes. For a table with +## - a hole, new rows are inserted at the end of the table if it is +## - in use by another thread. Otherwise, MySQL acquires a normal +## - write lock and inserts the row into the hole. +## - +concurrent_insert = 2 + + +## - open-files-limit +## - +## - put the following lines into /etc/security/limits.conf +## - +## - @staff hard nofile 32768 +## - root hard nofile 32768 +## - +## - see also http://linux-vserver.org/Ulimit_Nofiles +## - +open-files-limit = `ulimit -Hn` +innodb_open_files = `ulimit -Hn` + + +## ------------------------- +## InnoDB specific variables + +## - innodb_file_per_table +## - +## - When innodb_file_per_table is enabled (the default in 5.6.6 and higher), +## - InnoDB stores the data and indexes for each newly created table in a +## - separate .ibd file, rather than in the system tablespace. +## - +innodb_file_per_table + +## - innodb_data_home_dir +## - +## - Default: MySQL data directory +## - +#innodb_data_home_dir = /data/mysql + +#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend + +## - innodb_log_group_home_dir +## - +## - The directory path to the InnoDB redo log files, whose number +## - is specified by innodb_log_files_in_group. +## - +## - If you do not specify any InnoDB log variables, the default is +## - to create two files named ib_logfile0 and ib_logfile1 in the MySQL +## - data directory. Their size is given by the size of the +## - innodb_log_file_size system variable. +## - +#innodb_log_group_home_dir = /var/lib/mysql/ + +## - innodb_buffer_pool_size +## - +## - The size in bytes of the buffer pool, the memory area where InnoDB +## - caches table and index data. +## - +## - You can set .._buffer_pool_size up to 50 - 80 % +## - of RAM but beware of setting memory usage too high +## - +## - Note: +## - When the size of the buffer pool is greater than 1GB, setting +## - innodb_buffer_pool_instances to a value greater than 1 can improve +## - the scalability on a busy server. +## - +## - default: 134217728 (128M) +## - +#innodb_buffer_pool_size = 384M +#innodb_buffer_pool_size = 1024M + + +## - innodb_additional_mem_pool_size +## - +## - The size in bytes of a memory pool InnoDB uses to store data dictionary +## - information and other internal data structures. +## - +## - Default: 8388608 (8M) +## - +#innodb_additional_mem_pool_size = 20M +#innodb_additional_mem_pool_size = 40M + + +## - innodb_buffer_pool_instances +## - +## - The number of regions that the InnoDB buffer pool is divided into. +## - +## - Note: +## - For systems with buffer pools in the multi-gigabyte range, dividing +## - the buffer pool into separate instances can improve concurrency, by +## - reducing contention as different threads read and write to cached pages. +## - +## - Default: 1 +## - +#innodb_buffer_pool_instances = 1 + + +## - innodb_log_file_size +## - +## - The size in bytes of each log file in a log group. +## - +## - Default: 5242880 (5M) +## - +## (Set .._log_file_size to 25 % of buffer pool size) +## - +#innodb_log_file_size = 100M +#innodb_log_file_size = 256M + +## - innodb_log_buffer_size +## - +## - The size in bytes of the buffer that InnoDB uses to write to the +## - log files on disk. +## - +## - Default: 8388608 (8M) +## - +#innodb_log_buffer_size = 8M +#innodb_log_buffer_size = 32M + +## - innodb_flush_log_at_trx_commit +## - +## - Controls the balance between strict ACID compliance for commit +## - operations, and higher performance that is possible when +## - commit-related I/O operations are rearranged and done in batches. +## - You can achieve better performance by changing the default value, +## - but then you can lose up to one second worth of transactions in a crash. +## - +## - In case of extrem slowly restores set +## - +## - innodb_flush_log_at_trx_commit = 2 +## - innodb_log_file_size = 256M +## - +## - Also try to add (befor DROP/CREATE/INSET Statements) to the dumpfile: +## - +## - ... +## - SET FOREIGN_KEY_CHECKS=0; +## - SET unique_checks=0; +## - SET AUTOCOMMIT=0; +## - +## - DROP TABLE IF EXISTS.. +## - ... +## - +#innodb_flush_log_at_trx_commit = 1 +#innodb_flush_log_at_trx_commit = 2 + +## - innodb_lock_wait_timeout +## - +## - The length of time in seconds an InnoDB transaction waits for a row +## - lock before giving up. +## - +## - Default: 50 +## - +#innodb_lock_wait_timeout = 50 + +## InnoDB specific variables +## ------------------------- + + +## - sort_buffer_size +## - +## - Each session that needs to do a sort allocates a buffer of this size. +## - sort_buffer_size is not specific to any storage engine and applies +## - in a general manner for optimization. +## - +## - Default: 2097152 (2M) +## - +sort_buffer_size = 2M + + +## - key_buffer_size +## - +## - key_buffer_size" is a MyISAM parameter ! +## - +## - Index blocks for MyISAM tables are buffered and are shared by all threads. +## - key_buffer_size is the size of the buffer used for index blocks. The key +## - buffer is also known as the key cache. +## - +## - Default: 8388608 (8M) +## - +key_buffer_size = 384M + + +## - read_buffer_size +## - +## - Each thread that does a sequential scan for a MyISAM table allocates +## - a buffer of this size (in bytes) for each table it scans. If you do +## - many sequential scans, you might want to increase this value. +## - +## - Default: 131072 (128K) +## - +read_buffer_size = 2M + +## - read_rnd_buffer_size +## - +## - This variable is used for reads from MyISAM tables, and, for any +## - storage engine, for Multi-Range Read optimization. +## - +## - Default: 262144 (256K) +## - +read_rnd_buffer_size = 8M + + +## - myisam_sort_buffer_size +## - +## - The size of the buffer that is allocated when sorting MyISAM indexes +## - during a REPAIR TABLE or when creating indexes with CREATE INDEX or +## - ALTER TABLE. +## - +## - Default: 8388608 (8M) +## - +myisam_sort_buffer_size = 64M + + +## - max_allowed_packet +## - +## - The maximum size of one packet or any generated/intermediate string, or +## - any parameter sent by the mysql_stmt_send_long_data() C API function. +## +## - Default: 4MB (MySQL 5.6.6), 1MB before that. +## - +#max_allowed_packet = 4M +max_allowed_packet = 32M + + +## - table_open_cache +## - +## - The number of open tables for all threads. Increasing this value +## - increases the number of file descriptors that mysqld requires. +## - +## - You can check whether you need to increase the table cache by checking +## - the Opened_tables status variable. If the value of Opened_tables is large +## - and you do not use FLUSH TABLES often (which just forces all tables to be +## - closed and reopened), then you should increase the value of the +## - table_open_cache variable. +## - +table_open_cache = 512 + +## - table_definition_cache +## - +## - The number of table definitions (from .frm files) that can be stored +## - in the definition cache. +## - +## - Default: (400 + (table_open_cache / 2) since 5.6.8, 400 before +## - +#table_definition_cache = 1680 + +## - max_connect_errors +## - +## - Default: 100 (5.6.6), 10 (before) +## - +max_connect_errors = 999999 + +## - thread_concurrency +## - +## - NOTE: +## - This variable is specific to Solaris 8 and earlier systems. +## - +## - This variable is deprecated as of MySQL 5.6.1 and is removed in MySQL 5.7. +## - You should remove this from MySQL configuration files whenever you see it +## - unless they are for Solaris 8 or earlier +## - +## - (Try number of CPU's*2 for thread_concurrency) +## - +#thread_concurrency = 16 + +## - thread_cache_size +## - +## - How many threads the server should cache for reuse. When a client +## - disconnects, the client's threads are put in the cache if there are +## - fewer than thread_cache_size threads there. +## - +## - Default: 8 + (max_connections / 100) (5.6.8) , 0 (before) +## - +thread_cache_size = 8 + +## - thread_stack +## - +## - The stack size for each thread. Many of the limits detected by +## - the crash-me test are dependent on this value. +## - +## - The default of 192KB (256KB for 64-bit systems) is large enough +## - for normal operation. If the thread stack size is too small, it +## - limits the complexity of the SQL statements that the server can handle, +## - the recursion depth of stored procedures, and other memory-consuming +## - actions. +## - Default: 262144 (256K) +## - +thread_stack = 262144 + + +## - Unbenutze Datenbank Engines deaktivieren +## - + +## - skip-innodb +## - +## - Deaktiviert die Unterstützung für InnoDB +## - +## - Sincs version 5.5, you have to set default-storage-engine +## - to MyISAM, if using skip-innodb +## - +#default-storage-engine=MyISAM +#skip-innodb + + +## - log-error +## - +## - Log errors and startup messages to this file. If you omit the file +## - name, MySQL uses host_name.err. If the file name has no extension, +## - the server adds an extension of .err. +## - +log-error = $_mysql_error_log + + +## - Query Log +## - +#general-log = on +#general_log_file = $_mysql_log + + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +#ft_min_word_len = 3 + +## - ft_stopword_file +## - +## - Datei, aus der die Liste der Stoppwörter für die Volltextsuche ausgelesen wird. +## - Es werden alle Wörter aus der Datei verwendet; Kommentare hingegen werden nicht +## - berücksichtigt. Standardmäßig wird eine eingebaute Liste mit Stoppwörtern (wie +## - in der Datei myisam/ft_static.c definiert) verwendet. Wird diesee Variable auf den +## - Leer-String gesetzt (''), wird die Ausfilterung von Stoppwörtern deaktiviert. +## - +## - Hinweis: Wird diese Variable geändern oder den Inhalt der Stoppwortdatei selbst, +## - müssen die FULLTEXT-Indizes neu erstellt werden (REPAIR TABLE tbl_name QUICK. ). +## - +#ft_stopword_file = /usr/local/mysql/stopwords_utf8_iso8859-15.txt + + + +## ------------- +## - query cache + + +## - query_cache_type +## - +## - 0 : verhindert das Speichern von Abfragen im und +## - das Abrufen aus dem Cache +## - 1 : gestattet das Speichern von Abfragen im Cache. +## - Ausgenommen sind Anweisungen, die mit +## - SELECT SQL_NO_CACHE beginnen. +## - 2 : speichert nur diejenigen Anweisungen im Cache, +## - die mit SELECT SQL_CACHE beginnen. +query_cache_type = 1 + + +## - query_cache_limit +## - +## - Gibt die maximale Größe einzelner Abfrageergebnisse an, die im +## - Cache gespeichert werden können. +## - +## - Vorgeabewert ist 1Mbyte +## - +query_cache_limit = 4M + + +## - query_cache_min_res_unit +## - +## - Die im Abfrage-Cache abgelegten Ergebnisse, werden nicht am Stück +## - verwaltet. Der Abfrage-Cache reserviert Blöcke zur Speicherung dieser +## - Daten nach Bedarf, d. h. wenn ein Block voll ist, wird der nächste +## - zugewiesen. Da der Speicherreservierungsvorgang (in zeitlicher Hinsicht) +## - aufwändig ist, reserviert der Abfrage-Cache die Blöcke mit einer +## - Mindestgröße, die durch die Systemvariable query_cache_min_res_unit +## - festgelegt wird. Wird eine Abfrage ausgeführt, dann wird der letzte +## - Ergebnisblock auf die tatsächliche Datengröße zugeschnitten, sodass +## - unbenutzter Speicher freigegeben wird. +## - +## - Siehe auch http://dev.mysql.com/doc/refman/5.1/de/query-cache-configuration.html +## - +## - Vorgabewert ist 4Kbyte +## - +query_cache_min_res_unit = 8K + + +## - query_cache_size +## - +## - Die Größe des Abfrage-Caches. +## - +## - Wird query_cache_size auf einen Wert größer Null gesetzt, so ist zu beachten, +## - dass der Abfrage-Cache eine Mindestgröße von ca. 40 Kbyte benötigt, um seine +## - Strukturen zuzuweisen. (Der exakte Wert hängt von der Systemarchitektur ab.) +## - Wird der Wert zu niedrig angesetzt, wird eine Warnung ausgegeben. +## - +## - Vorgabewert ist 0, d. h. der Abfrage-Cache ist vorgabeseitig deaktiviert. +## - +#query_cache_size = 32M +query_cache_size = 128M + +## - query cache +## ------------- + + +## -------------- +## - slow queries + +## - slow_query_log +## - +## - Gibt an, ob das Logging für langsame Abfragen eingeschaltet (1 oder ON) +## - bzw ausgeschaltet (0 oder OFF) ist. +## - +## - Vorgabewert ist 0 oder OFF +## - +slow_query_log = 1 + + +## - long_query_time +## - +## - Wenn eine Abfrage länger dauert als durch diese Variable (in Sekunden) angegeben, +## - erhöht der Server die Statusvariable Slow_queries entsprechend. Wird die Option +## - --log-slow-queries verwendet, wird die Abfrage in der Logdatei für langsame Abfragen +## - protokolliert. Dieser Wert wird als Echtzeit (nicht als Prozessorzeit) gemessen, d. h. +## - eine Abfrage, die bei einem System mit geringer Belastung den Schwellwert +## - unterschreitet, kann bei einem stark belasteten System bereits darüber liegen. +## - Der Mindestwert ist 1. +## - +## - Vorgabewert ist 10 +## - +long_query_time = 1 + + +## - slow_query_log_file +## - +## - Name der Logdatei, in die langsame Abfragen gespeichert werden. +## - +## - Vorgabewert ist -slow.log +## - +slow_query_log_file = $_mysql_slow_query_log + + +## - log-queries-not-using-indexes +## - +## - Gibt an, ob Abfragen, die keine Indizes benutzen in der Logdatei +## - für langsame Abfragen mitgespeichert werden sollen. +## - +## - Vorgabewert ist 0 +## - +#log_queries_not_using_indexes = 1 +log_queries_not_using_indexes = 0 + +## - slow queries +## -------------- + +## - join_buffer_size +## - +## - Die Größe des Puffers, der für Joins benutzt wird, die keine Indizes verwenden +## - und deswegen vollständige Tabellenscans durchführen. Normalerweise besteht die +## - beste Möglichkeit der Realisierung schneller Joins darin, Indizes hinzuzufügen. +## - Erhöhen Sie den Wert von join_buffer_size, um einen schnelleren vollständigen +## - Join zu implementieren, wenn das Hinzufügen von Indizes nicht möglich ist. Für +## - jeden vollständigen Join zwischen zwei Tabellen wird ein Join-Puffer hinzugefügt. +## - Für einen komplexen Join zwischen mehreren Tabellen, für den Indizes nicht verwendet +## - werden, sind unter Umständen mehrere Join-Puffer erforderlich. +## - +## - Wird die Option --log-slow-queries (ON) verwendet, werden Abfragen, die keine +## - Indizes verwenden, in das Log für langsame Abfragen geschrieben. +## - +## - Vorgabewert ist 128K +## - +#join_buffer_size = 384K + + + +## - max_heap_table_size +## - +## - Diese Variable bestimmt die maximale Größe, auf die MEMORY-Tabellen anwachsen dürfen. +## - Der Wert der Variable wird zur Berechnung von MAX_ROWS-Werte für MEMORY-Tabellen +## - verwendet. Die Einstellung der Variable hat keine Auswirkungen auf bereits vorhandene +## - MEMORY-Tabellen, sofern diese nicht mit einer Anweisung wie CREATE TABLE neu erstellt +## - oder mit ALTER TABLE oder TRUNCATE TABLE modifiziert werden. +## - +## - Vorgabewert ist 16Mbyte +## - +#max_heap_table_size = 96M + + +## - tmp_table_size +## - +## - Überschreitet eine temporäre Tabelle im Arbeitsspeicher diese Größe, wandelt MySQL +## - sie automatisch in eine MyISAM-Tabelle auf der Festplatte um. +## - +## - Werden viele erweiterte GROUP-BY-Anfragen ausgeführt (und ist genügend Speicher +## - vorhanden), so sollte diese Variable erhöht werden. +## +## - Default: 16777216 (16M) +## - +## - Note: +## - Effective in-memory tmp_table_size is limited to max_heap_table_size. +## - +#tmp_table_size = 96M + + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqldump] +quick +max_allowed_packet = 32M + +[mysql] +no-auto-rehash +# Remove the next comment character if you are not familiar with SQL +#safe-updates + +[myisamchk] +key_buffer_size = 256M +sort_buffer_size = 256M +read_buffer = 2M +write_buffer = 2M + + +## ------------------------------------------ +## - angepasste Einstellungen + +## - ft_min_word_len +## - +## - Die minimale Länge des Wortes, das in einem FULLTEXT-Index enthalten sein darf. +## - +## - Notice! +## - if you set +## - [mysqld] +## - ft_min_word_len=3 +## - +## - you should also set +## - [myisamchk] +## - ft_min_word_len=3 +## - +## - +## - Vorgabewert ist 4 +ft_min_word_len = 3 + +## - angepasste Einstellungen +## ------------------------------------------ + + +[mysqlhotcopy] +interactive-timeout + +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/my.cnf\" nicht erstellen.. +fi + +echononl "Kopiere \"stopwords_utf8_iso8859-15.txt\" -> ${MYSQL_INSTALL_DIR}.." +if [ -f "${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt" ];then + cp ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt ${MYSQL_INSTALL_DIR} + if [ "$?" = "0" ]; then + echo_ok + + echononl "Aktiviere Stopword Datei.." + echo "" >> ${logdir}/main.log + echo "perl -i -n -p -e \"s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/\" /usr/local/mysql/my.cnf" >> ${logdir}/main.log + perl -i -n -p -e "s/^(\s*#\s*)(ft_stopword_file.*)/#\1\2\n\2/" /usr/local/mysql/my.cnf >> ${logdir}/main.log 2>&1 + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + warn "Konnte Stopword Datei \"stopwords_utf8_iso8859-15.txt\" nicht aktivieren." + fi + + else + echo_failed + warn "Konnte stopwords_utf8_iso8859-15.txt nicht nach ${MYSQL_INSTALL_DIR} kopieren" + fi +else + echo_skipped + warn "Konnte ${MYSQL_SRC_BASE_DIR}/stopwords_utf8_iso8859-15.txt finden." +fi + + +#echononl "Kopiere Startscript nach /etc/init.d/mysql.server.." +#echo "" >> ${logdir}/main.log +#echo "cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server" >> ${logdir}/main.log +#cp -a ${MYSQL_INSTALL_DIR}/support-files/mysql.server /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +# fatal Konnte Startscript nicht nach /etc/init.d/mysql.server kopieren.. +#fi + +#echononl "Ersetze im Startscript: \"mysql-${_MYSQL_VERSION}\" durch \"mysql\".." +#echo "perl -i -n -p -e \"s/mysql-${_MYSQL_VERSION}/mysql/g\" /etc/init.d/mysql.server" >> ${logdir}/main.log +#perl -i -n -p -e "s/mysql-${_MYSQL_VERSION}/mysql/g" /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +#if [ "$?" = "0" ]; then +# echo_ok +#else +# echo_failed +#fi +# +#echo "" >> ${logdir}/main.log +#echo "chown root:root /etc/init.d/mysql.server" >> ${logdir}/main.log +#chown root:root /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 +# +#echo "" >> ${logdir}/main.log +#echo "chmod 755 /etc/init.d/mysql.server" >> ${logdir}/main.log +#chmod 755 /etc/init.d/mysql.server >> ${logdir}/main.log 2>&1 + + +if ! $UPDATE_MYSQL ; then + + echononl "Starte MySQL Server beim Booten" + echo "" >> ${logdir}/main.log + if $SYSTEMD_EXISTS ; then + echo "systemctl enable mysql.server" >> ${logdir}/main.log + systemctl enable mysql.server >> ${logdir}/main.log 2>&1 + echo "systemctl daemon-reload" >> ${logdir}/main.log + systemctl daemon-reload >> ${logdir}/main.log 2>&1 + else + echo "update-rc.d mysql.server defaults" >> ${logdir}/main.log + update-rc.d mysql.server defaults >> ${logdir}/main.log 2>&1 + fi + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + if $SYSTEMD_EXISTS ; then + error "Konnte \"mysql.server\" im systemd nicht enablen.." + else + error "Konnte MySQL Init Script Links (autom. boot) nicht erstellen.." + fi + fi + + echononl "Starte MySQL Datenbankserver.." + echo "" >> ${logdir}/main.log + if $SYSTEMD_EXISTS ; then + echo "systemctl start mysql.server" >> ${logdir}/main.log + systemctl start mysql.server >> ${logdir}/main.log 2>&1 + else + echo "/etc/init.d/mysql.server start" >> ${logdir}/main.log + /etc/init.d/mysql.server start >> ${logdir}/main.log 2>&1 + fi + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed + error Konnte MySQL Datenbankserver nicht starten.. + fi +fi + +echononl "Run \"mysql_upgrade -uroot\".." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql_upgrade -uroot >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error "Script \"mysql_upgrade -uroot\" failed!" +fi + +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"DELETE FROM user where User = ''\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "DELETE FROM user where User = ''" >> ${logdir}/main.log 2>&1 + +echononl "Setze root Passwort für den MySQL Zugang" +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"UPDATE user set authentication_string = password('$MYSQL_ROOT_PW')\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "UPDATE user set authentication_string = password('$MYSQL_ROOT_PW')" \ + >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte MySQL root Zugang fü den MySQL Server nicht setzen.. +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +echo +echononl "Erstelle Passwort für maintance (MySQL) User.." +echo "" >> ${logdir}/main.log +PW_GEN=`which pwgen` +if [ -z "$PW_GEN" ]; then + echo "_maint_passwd=\`cat /dev/urandom|tr -dc \"a-zA-Z0-9-_\$\?\" | fold -w16 | head -n 1\`" >> ${logdir}/main.log + _maint_passwd=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?" | fold -w16 | head -n 1` >> ${logdir}/main.log 2>&1 +else + echo "_maint_passwd=\`$PW_GEN -v -B 16 1\`" >> ${logdir}/main.log + _maint_passwd=`$PW_GEN -v -B 16 1` >> ${logdir}/main.log 2>&1 +fi +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Passwort für maintance \(MySQL\) User nicht erstellen.. +fi + +_maint_user=sys-maint +echononl "Erstelle maintance MySQL User \"${_maint_user}\" - localhost.." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "GRANT ALL ON *.* TO '${_maint_user}'@'localhost' IDENTIFIED BY '$_maint_passwd'" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte \(MySQL\) User \"${_maint_user}\" nicht erstellen.. +fi + +echononl "Give \"Grant\" permission to MySQL User \"${_maint_user}\".." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "UPDATE user SET Grant_priv = 'y' WHERE user = '${_maint_user}';" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Giving \"Grant\"-permission to \(MySQL\) User \"${_maint_user}\" failed +fi + +echononl "Neu Einlesen der Berechtigung (MySQL Server).." +echo "" >> ${logdir}/main.log +echo "${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e \"FLUSH PRIVILEGES\"" >> ${logdir}/main.log +${MYSQL_INSTALL_DIR}/bin/mysql -uroot -p$MYSQL_ROOT_PW mysql -N -s -e "FLUSH PRIVILEGES" >> ${logdir}/main.log 2>&1 +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Das Laden/Erneuern der Berechtigungen für die MySQL Datenbank ist fehlgeschlagen.. +fi + + +_maint_conf_file=${MYSQL_INSTALL_DIR}/sys-maint.cnf +echononl "Erstelle ${_maint_conf_file}.." +cat << EOF > ${MYSQL_INSTALL_DIR}/sys-maint.cnf +[client] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +[mysql_upgrade] +host = localhost +user = $_maint_user +password = $_maint_passwd +socket = $MYSQL_UNIX_SOCKET +basedir = /usr +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Konfigurationsdatei \"${MYSQL_INSTALL_DIR}/sys-maint.cnf\" nicht erstellen.. +fi + + +echononl "Erstelle Logrotate Definitionsdatei /etc/logrotate.d/mysql.." +cat << EOF > /etc/logrotate.d/mysql +$_mysql_log +$_mysql_error_log +$_mysql_slow_query_log +{ + daily + rotate 7 + missingok + create 644 $MYSQL_USER $MYSQL_GROUP + compress + sharedscripts + postrotate + MYSQL="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysql --defaults-file=$_maint_conf_file" + MYADMIN="`dirname $MYSQL_INSTALL_DIR`/mysql/bin/mysqladmin --defaults-file=$_maint_conf_file" + if [ -z "\`\$MYADMIN ping 2>/dev/null\`" ]; then + echo "Warning: no mysqld running or missing sys-maint user?" + else + \$MYSQL -e 'select @@global.long_query_time into @lqt_save; set global long_query_time=2000; select sleep(2); FLUSH LOGS; select sleep(2); set global long_query_time=@lqt_save;' > /dev/null + fi + endscript +} +EOF +if [ "$?" = "0" ]; then + echo_ok +else + echo_failed + error Konnte Logrotate Definitionsdatei \"/etc/logrotate.d/mysql\" nicht erstellen.. +fi + + +echo +exit diff --git a/stopwords_iso8859-15.txt b/stopwords_iso8859-15.txt new file mode 100644 index 0000000..4b17ce9 --- /dev/null +++ b/stopwords_iso8859-15.txt @@ -0,0 +1,1022 @@ +a + +ab +aber +abgerufen +abgerufene +abgerufener +abgerufenes +acht +hnlich +alle +allein +allem +allen +aller +allerdings +allerlei +alles +allgemein +allmhlich +allzu +als +alsbald +also +am +an +ander +andere +anderem +anderen +anderer +andererseits +anderes +anderm +andern +andernfalls +anders +anerkannt +anerkannte +anerkannter +anerkanntes +anfangen +anfing +angefangen +angesetze +angesetzt +angesetzten +angesetzter +ansetzen +anstatt +arbeiten +auch +auf +aufgehrt +aufgrund +aufhren +aufhrte +aufzusuchen +aus +ausdrcken +ausdrckt +ausdrckte +ausgenommen +auen +ausser +auer +ausserdem +auerdem +auerhalb +author +autor +b +bald +bearbeite +bearbeiten +bearbeitete +bearbeiteten +bedarf +bedrfen +bedurfte +befragen +befragte +befragten +befragter +begann +beginnen +begonnen +behalten +behielt +bei +beide +beiden +beiderlei +beides +beim +beinahe +beitragen +beitrugen +bekannt +bekannte +bekannter +bekennen +benutzt +bereits +berichten +berichtet +berichtete +berichteten +besonders +besser +bestehen +besteht +betrchtlich +bevor +bezglich +bietet +bin +bis +bis +bisher +bislang +bist +bleiben +blieb +bloss +blo +bden +brachte +brachten +brauchen +braucht +bruchte +bringen +bsp. +bzw +c +ca +d +da +dabei +dadurch +dafr +dagegen +daher +dahin +damals +damit +danach +daneben +dank +danke +danken +dann +dannen +daran +darauf +daraus +darf +darfst +darin +darber +darberhinaus +darum +darunter +das +dass +da +dasselbe +davon +davor +dazu +dein +deine +deinem +deinen +deiner +deines +dem +demnach +demselben +den +denen +denn +dennoch +denselben +der +derart +derartig +derem +deren +derer +derjenige +derjenigen +derselbe +derselben +derzeit +des +deshalb +desselben +dessen +desto +deswegen +dich +die +diejenige +dies +diese +dieselbe +dieselben +diesem +diesen +dieser +dieses +diesseits +dinge +dir +direkt +direkte +direkten +direkter +doch +doppelt +dort +dorther +dorthin +drauf +drei +dreiig +drin +dritte +drber +drunter +du +dunklen +durch +durchaus +drfen +durfte +drfte +durften +e +eben +ebenfalls +ebenso +ehe +eher +eigenen +eigenes +eigentlich +ein +einban +eine +einem +einen +einer +einerseits +eines +einfach +einfhren +einfhrte +einfhrten +eingesetzt +einig +einige +einigem +einigen +einiger +einigermaen +einiges +einmal +eins +einseitig +einseitige +einseitigen +einseitiger +einst +einstmals +einzig +ende +entsprechend +entweder +er +ergnze +ergnzen +ergnzte +ergnzten +erhlt +erhalten +erhielt +erhielten +erneut +erffne +erffnen +erffnet +erffnete +erffnetes +erst +erste +ersten +erster +es +etc +etliche +etwa +etwas +euch +euer +eure +eurem +euren +eurer +eures +f +fall +falls +fand +fast +ferner +finden +findest +findet +folgende +folgenden +folgender +folgendes +folglich +fordern +fordert +forderte +forderten +fortsetzen +fortsetzt +fortsetzte +fortsetzten +fragte +frau +frei +freie +freier +freies +fuer +fnf +fr +g +gab +gngig +gngige +gngigen +gngiger +gngiges +ganz +ganze +ganzem +ganzen +ganzer +ganzes +gnzlich +gar +gbr +geb +geben +geblieben +gebracht +gedurft +geehrt +geehrte +geehrten +geehrter +gefallen +geflligst +gefllt +gefiel +gegeben +gegen +gehabt +gehen +geht +gekommen +gekonnt +gemacht +gemss +gemocht +genommen +genug +gern +gesagt +gesehen +gestern +gestrige +getan +geteilt +geteilte +getragen +gewesen +gewissermaen +gewollt +geworden +ggf +gib +gibt +gleich +gleichwohl +gleichzeitig +glcklicherweise +gmbh +gratulieren +gratuliert +gratulierte +gute +guten +h +hab +habe +haben +haette +halb +hallo +hast +hat +htt +hatte +htte +hatten +htten +hattest +hattet +heraus +herein +heute +heutige +hier +hiermit +hiesige +hin +hinein +hinten +hinter +hinterher +hoch +hchstens +hundert +i +ich +igitt +ihm +ihn +ihnen +ihr +ihre +ihrem +ihren +ihrer +ihres +im +immer +immerhin +important +in +indem +indessen +info +infolge +innen +innerhalb +ins +insofern +inzwischen +irgend +irgendeine +irgendwas +irgendwen +irgendwer +irgendwie +irgendwo +ist +j +ja +jhrig +jhrige +jhrigen +jhriges +je +jede +jedem +jeden +jedenfalls +jeder +jederlei +jedes +jedoch +jemand +jene +jenem +jenen +jener +jenes +jenseits +jetzt +k +kam +kann +kannst +kaum +kein +keine +keinem +keinen +keiner +keinerlei +keines +keines +keineswegs +klar +klare +klaren +klares +klein +kleinen +kleiner +kleines +koennen +koennt +koennte +koennten +komme +kommen +kommt +konkret +konkrete +konkreten +konkreter +konkretes +knn +knnen +knnt +konnte +knnte +konnten +knnten +knftig +l +lag +lagen +langsam +lngst +lngstens +lassen +laut +lediglich +leer +legen +legte +legten +leicht +leider +lesen +letze +letzten +letztendlich +letztens +letztes +letztlich +lichten +liegt +liest +links +m +mache +machen +machst +macht +machte +machten +mag +magst +mal +man +manche +manchem +manchen +mancher +mancherorts +manches +manchmal +mann +margin +mehr +mehrere +mein +meine +meinem +meinen +meiner +meines +meist +meiste +meisten +meta +mich +mindestens +mir +mit +mithin +mochte +mchte +mchten +mchtest +mgen +mglich +mgliche +mglichen +mglicher +mglicherweise +morgen +morgige +muessen +muesst +muesste +muss +mu +mssen +musst +mut +mt +musste +msste +mte +mussten +mssten +n +nach +nachdem +nacher +nachhinein +nchste +nacht +nahm +nmlich +natrlich +neben +nebenan +nehmen +nein +neu +neue +neuem +neuen +neuer +neues +neun +nicht +nichts +nie +niemals +niemand +nimm +nimmer +nimmt +nirgends +nirgendwo +noch +ntigenfalls +nun +nur +nutzen +nutzt +ntzt +nutzung +o + +ob +oben +oberhalb +obgleich +obschon +obwohl +oder +oft +ohne +p +per +pfui +pltzlich +pro +q +reagiere +reagieren +reagiert +reagierte +rechts +regelmig +rief +rund +s +sage +sagen +sagt +sagte +sagten +sagtest +smtliche +sang +sangen +schtzen +schtzt +schtzte +schtzten +schlechter +schlielich +schnell +schon +schreibe +schreiben +schreibens +schreiber +schwierig +sechs +sect +sehe +sehen +sehr +sehrwohl +seht +sei +seid +sein +seine +seinem +seinen +seiner +seines +seit +seitdem +seite +seiten +seither +selber +selbst +senke +senken +senkt +senkte +senkten +setzen +setzt +setzte +setzten +sich +sicher +sicherlich +sie +sieben +siebte +siehe +sieht +sind +singen +singt +so +sobald +soda +soeben +sofern +sofort +sog +sogar +solange +solch +solche +solchem +solchen +solcher +solches +soll +sollen +sollst +sollt +sollte +sollten +solltest +somit +sondern +sonst +sonstwo +sooft +soviel +soweit +sowie +sowohl +spter +spielen +startet +startete +starteten +statt +stattdessen +steht +steige +steigen +steigt +stets +stieg +stiegen +such +suchen +t +tages +tat +tt +tatschlich +tatschlichen +tatschlicher +tatschliches +tausend +teile +teilen +teilte +teilten +titel +total +trage +tragen +trgt +trotzdem +trug +tun +tust +tut +txt +u + +bel +ber +berall +berallhin +berdies +bermorgen +brig +brigens +ueber +um +umso +unbedingt +und +ungefhr +unmglich +unmgliche +unmglichen +unmglicher +unntig +uns +unse +unsem +unsen +unser +unser +unsere +unserem +unseren +unserer +unseres +unserm +unses +unten +unter +unterbrach +unterbrechen +unterhalb +unwichtig +usw +v +vergangen +vergangene +vergangener +vergangenes +vermag +vermgen +vermutlich +verffentlichen +verffentlicher +verffentlicht +verffentlichte +verffentlichten +verffentlichtes +verrate +verraten +verriet +verrieten +version +versorge +versorgen +versorgt +versorgte +versorgten +versorgtes +viel +viele +vielen +vieler +vieles +vielleicht +vielmals +vier +vllig +vollstndig +vom +von +vor +voran +vorbei +vorgestern +vorher +vorne +vorber +w +wachen +waere +whrend +whrend +whrenddessen +wann +war +wr +wre +waren +wren +warst +warum +was +weder +weg +wegen +weil +wei +weiter +weitere +weiterem +weiteren +weiterer +weiteres +weiterhin +welche +welchem +welchen +welcher +welches +wem +wen +wenig +wenige +weniger +wenigstens +wenn +wenngleich +wer +werde +werden +werdet +weshalb +wessen +wichtig +wie +wieder +wieso +wieviel +wiewohl +will +willst +wir +wird +wirklich +wirst +wo +wodurch +wogegen +woher +wohin +wohingegen +wohl +wohlweislich +wolle +wollen +wollt +wollte +wollten +wolltest +wolltet +womit +woraufhin +woraus +worin +wurde +wurden +wrden +x +y +z +zahlreich +z.B. +zehn +zeitweise +ziehen +zieht +zog +zogen +zu +zudem +zuerst +zufolge +zugleich +zuletzt +zum +zumal +zur +zurck +zusammen +zuviel +zwanzig +zwar +zwei +zwischen +zwlf diff --git a/stopwords_utf8.txt b/stopwords_utf8.txt new file mode 100644 index 0000000..5880cd2 --- /dev/null +++ b/stopwords_utf8.txt @@ -0,0 +1,1022 @@ +a +ä +ab +aber +abgerufen +abgerufene +abgerufener +abgerufenes +acht +ähnlich +alle +allein +allem +allen +aller +allerdings +allerlei +alles +allgemein +allmählich +allzu +als +alsbald +also +am +an +ander +andere +anderem +anderen +anderer +andererseits +anderes +anderm +andern +andernfalls +anders +anerkannt +anerkannte +anerkannter +anerkanntes +anfangen +anfing +angefangen +angesetze +angesetzt +angesetzten +angesetzter +ansetzen +anstatt +arbeiten +auch +auf +aufgehört +aufgrund +aufhören +aufhörte +aufzusuchen +aus +ausdrücken +ausdrückt +ausdrückte +ausgenommen +außen +ausser +außer +ausserdem +außerdem +außerhalb +author +autor +b +bald +bearbeite +bearbeiten +bearbeitete +bearbeiteten +bedarf +bedürfen +bedurfte +befragen +befragte +befragten +befragter +begann +beginnen +begonnen +behalten +behielt +bei +beide +beiden +beiderlei +beides +beim +beinahe +beitragen +beitrugen +bekannt +bekannte +bekannter +bekennen +benutzt +bereits +berichten +berichtet +berichtete +berichteten +besonders +besser +bestehen +besteht +beträchtlich +bevor +bezüglich +bietet +bin +bis +bis +bisher +bislang +bist +bleiben +blieb +bloss +bloß +böden +brachte +brachten +brauchen +braucht +bräuchte +bringen +bsp. +bzw +c +ca +d +da +dabei +dadurch +dafür +dagegen +daher +dahin +damals +damit +danach +daneben +dank +danke +danken +dann +dannen +daran +darauf +daraus +darf +darfst +darin +darüber +darüberhinaus +darum +darunter +das +dass +daß +dasselbe +davon +davor +dazu +dein +deine +deinem +deinen +deiner +deines +dem +demnach +demselben +den +denen +denn +dennoch +denselben +der +derart +derartig +derem +deren +derer +derjenige +derjenigen +derselbe +derselben +derzeit +des +deshalb +desselben +dessen +desto +deswegen +dich +die +diejenige +dies +diese +dieselbe +dieselben +diesem +diesen +dieser +dieses +diesseits +dinge +dir +direkt +direkte +direkten +direkter +doch +doppelt +dort +dorther +dorthin +drauf +drei +dreißig +drin +dritte +drüber +drunter +du +dunklen +durch +durchaus +dürfen +durfte +dürfte +durften +e +eben +ebenfalls +ebenso +ehe +eher +eigenen +eigenes +eigentlich +ein +einbaün +eine +einem +einen +einer +einerseits +eines +einfach +einführen +einführte +einführten +eingesetzt +einig +einige +einigem +einigen +einiger +einigermaßen +einiges +einmal +eins +einseitig +einseitige +einseitigen +einseitiger +einst +einstmals +einzig +ende +entsprechend +entweder +er +ergänze +ergänzen +ergänzte +ergänzten +erhält +erhalten +erhielt +erhielten +erneut +eröffne +eröffnen +eröffnet +eröffnete +eröffnetes +erst +erste +ersten +erster +es +etc +etliche +etwa +etwas +euch +euer +eure +eurem +euren +eurer +eures +f +fall +falls +fand +fast +ferner +finden +findest +findet +folgende +folgenden +folgender +folgendes +folglich +fordern +fordert +forderte +forderten +fortsetzen +fortsetzt +fortsetzte +fortsetzten +fragte +frau +frei +freie +freier +freies +fuer +fünf +für +g +gab +gängig +gängige +gängigen +gängiger +gängiges +ganz +ganze +ganzem +ganzen +ganzer +ganzes +gänzlich +gar +gbr +geb +geben +geblieben +gebracht +gedurft +geehrt +geehrte +geehrten +geehrter +gefallen +gefälligst +gefällt +gefiel +gegeben +gegen +gehabt +gehen +geht +gekommen +gekonnt +gemacht +gemäss +gemocht +genommen +genug +gern +gesagt +gesehen +gestern +gestrige +getan +geteilt +geteilte +getragen +gewesen +gewissermaßen +gewollt +geworden +ggf +gib +gibt +gleich +gleichwohl +gleichzeitig +glücklicherweise +gmbh +gratulieren +gratuliert +gratulierte +gute +guten +h +hab +habe +haben +haette +halb +hallo +hast +hat +hätt +hatte +hätte +hatten +hätten +hattest +hattet +heraus +herein +heute +heutige +hier +hiermit +hiesige +hin +hinein +hinten +hinter +hinterher +hoch +höchstens +hundert +i +ich +igitt +ihm +ihn +ihnen +ihr +ihre +ihrem +ihren +ihrer +ihres +im +immer +immerhin +important +in +indem +indessen +info +infolge +innen +innerhalb +ins +insofern +inzwischen +irgend +irgendeine +irgendwas +irgendwen +irgendwer +irgendwie +irgendwo +ist +j +ja +jährig +jährige +jährigen +jähriges +je +jede +jedem +jeden +jedenfalls +jeder +jederlei +jedes +jedoch +jemand +jene +jenem +jenen +jener +jenes +jenseits +jetzt +k +kam +kann +kannst +kaum +kein +keine +keinem +keinen +keiner +keinerlei +keines +keines +keineswegs +klar +klare +klaren +klares +klein +kleinen +kleiner +kleines +koennen +koennt +koennte +koennten +komme +kommen +kommt +konkret +konkrete +konkreten +konkreter +konkretes +könn +können +könnt +konnte +könnte +konnten +könnten +künftig +l +lag +lagen +langsam +längst +längstens +lassen +laut +lediglich +leer +legen +legte +legten +leicht +leider +lesen +letze +letzten +letztendlich +letztens +letztes +letztlich +lichten +liegt +liest +links +m +mache +machen +machst +macht +machte +machten +mag +magst +mal +man +manche +manchem +manchen +mancher +mancherorts +manches +manchmal +mann +margin +mehr +mehrere +mein +meine +meinem +meinen +meiner +meines +meist +meiste +meisten +meta +mich +mindestens +mir +mit +mithin +mochte +möchte +möchten +möchtest +mögen +möglich +mögliche +möglichen +möglicher +möglicherweise +morgen +morgige +muessen +muesst +muesste +muss +muß +müssen +musst +mußt +müßt +musste +müsste +müßte +mussten +müssten +n +nach +nachdem +nacher +nachhinein +nächste +nacht +nahm +nämlich +natürlich +neben +nebenan +nehmen +nein +neu +neue +neuem +neuen +neuer +neues +neun +nicht +nichts +nie +niemals +niemand +nimm +nimmer +nimmt +nirgends +nirgendwo +noch +nötigenfalls +nun +nur +nutzen +nutzt +nützt +nutzung +o +ö +ob +oben +oberhalb +obgleich +obschon +obwohl +oder +oft +ohne +p +per +pfui +plötzlich +pro +q +reagiere +reagieren +reagiert +reagierte +rechts +regelmäßig +rief +rund +s +sage +sagen +sagt +sagte +sagten +sagtest +sämtliche +sang +sangen +schätzen +schätzt +schätzte +schätzten +schlechter +schließlich +schnell +schon +schreibe +schreiben +schreibens +schreiber +schwierig +sechs +sect +sehe +sehen +sehr +sehrwohl +seht +sei +seid +sein +seine +seinem +seinen +seiner +seines +seit +seitdem +seite +seiten +seither +selber +selbst +senke +senken +senkt +senkte +senkten +setzen +setzt +setzte +setzten +sich +sicher +sicherlich +sie +sieben +siebte +siehe +sieht +sind +singen +singt +so +sobald +sodaß +soeben +sofern +sofort +sog +sogar +solange +solch +solche +solchem +solchen +solcher +solches +soll +sollen +sollst +sollt +sollte +sollten +solltest +somit +sondern +sonst +sonstwo +sooft +soviel +soweit +sowie +sowohl +später +spielen +startet +startete +starteten +statt +stattdessen +steht +steige +steigen +steigt +stets +stieg +stiegen +such +suchen +t +tages +tat +tät +tatsächlich +tatsächlichen +tatsächlicher +tatsächliches +tausend +teile +teilen +teilte +teilten +titel +total +trage +tragen +trägt +trotzdem +trug +tun +tust +tut +txt +u +ü +übel +über +überall +überallhin +überdies +übermorgen +übrig +übrigens +ueber +um +umso +unbedingt +und +ungefähr +unmöglich +unmögliche +unmöglichen +unmöglicher +unnötig +uns +unse +unsem +unsen +unser +unser +unsere +unserem +unseren +unserer +unseres +unserm +unses +unten +unter +unterbrach +unterbrechen +unterhalb +unwichtig +usw +v +vergangen +vergangene +vergangener +vergangenes +vermag +vermögen +vermutlich +veröffentlichen +veröffentlicher +veröffentlicht +veröffentlichte +veröffentlichten +veröffentlichtes +verrate +verraten +verriet +verrieten +version +versorge +versorgen +versorgt +versorgte +versorgten +versorgtes +viel +viele +vielen +vieler +vieles +vielleicht +vielmals +vier +völlig +vollständig +vom +von +vor +voran +vorbei +vorgestern +vorher +vorne +vorüber +w +wachen +waere +während +während +währenddessen +wann +war +wär +wäre +waren +wären +warst +warum +was +weder +weg +wegen +weil +weiß +weiter +weitere +weiterem +weiteren +weiterer +weiteres +weiterhin +welche +welchem +welchen +welcher +welches +wem +wen +wenig +wenige +weniger +wenigstens +wenn +wenngleich +wer +werde +werden +werdet +weshalb +wessen +wichtig +wie +wieder +wieso +wieviel +wiewohl +will +willst +wir +wird +wirklich +wirst +wo +wodurch +wogegen +woher +wohin +wohingegen +wohl +wohlweislich +wolle +wollen +wollt +wollte +wollten +wolltest +wolltet +womit +woraufhin +woraus +worin +wurde +wurden +würden +x +y +z +zahlreich +z.B. +zehn +zeitweise +ziehen +zieht +zog +zogen +zu +zudem +zuerst +zufolge +zugleich +zuletzt +zum +zumal +zur +zurück +zusammen +zuviel +zwanzig +zwar +zwei +zwischen +zwölf diff --git a/stopwords_utf8_iso8859-15.txt b/stopwords_utf8_iso8859-15.txt new file mode 100644 index 0000000..a8ad28d --- /dev/null +++ b/stopwords_utf8_iso8859-15.txt @@ -0,0 +1,1159 @@ + +a +ä +ab +aber +abgerufen +abgerufene +abgerufener +abgerufenes +acht +ähnlich +alle +allein +allem +allen +aller +allerdings +allerlei +alles +allgemein +allmählich +allmhlich +allzu +als +alsbald +also +am +an +ander +andere +anderem +anderen +anderer +andererseits +anderes +anderm +andern +andernfalls +anders +anerkannt +anerkannte +anerkannter +anerkanntes +anfangen +anfing +angefangen +angesetze +angesetzt +angesetzten +angesetzter +ansetzen +anstatt +arbeiten +auch +auen +auer +auerdem +auerhalb +auf +aufgehört +aufgehrt +aufgrund +aufhören +aufhörte +aufhren +aufhrte +aufzusuchen +aus +ausdrcken +ausdrckt +ausdrckte +ausdrücken +ausdrückt +ausdrückte +ausgenommen +außen +ausser +außer +ausserdem +außerdem +außerhalb +author +autor +b +bald +bden +bearbeite +bearbeiten +bearbeitete +bearbeiteten +bedarf +bedrfen +bedürfen +bedurfte +befragen +befragte +befragten +befragter +begann +beginnen +begonnen +behalten +behielt +bei +beide +beiden +beiderlei +beides +beim +beinahe +beitragen +beitrugen +bekannt +bekannte +bekannter +bekennen +bel +benutzt +ber +berall +berallhin +berdies +bereits +berichten +berichtet +berichtete +berichteten +bermorgen +besonders +besser +bestehen +besteht +beträchtlich +betrchtlich +bevor +bezglich +bezüglich +bietet +bin +bis +bisher +bislang +bist +bleiben +blieb +blo +bloss +bloß +böden +brachte +brachten +brauchen +braucht +bräuchte +brig +brigens +bringen +bruchte +bsp. +bzw +c +ca +d +da +da +dabei +dadurch +dafr +dafür +dagegen +daher +dahin +damals +damit +danach +daneben +dank +danke +danken +dann +dannen +daran +darauf +daraus +darber +darberhinaus +darf +darfst +darin +darüber +darüberhinaus +darum +darunter +das +dass +daß +dasselbe +davon +davor +dazu +dein +deine +deinem +deinen +deiner +deines +dem +demnach +demselben +den +denen +denn +dennoch +denselben +der +derart +derartig +derem +deren +derer +derjenige +derjenigen +derselbe +derselben +derzeit +des +deshalb +desselben +dessen +desto +deswegen +dich +die +diejenige +dies +diese +dieselbe +dieselben +diesem +diesen +dieser +dieses +diesseits +dinge +dir +direkt +direkte +direkten +direkter +doch +doppelt +dort +dorther +dorthin +drauf +drber +drei +dreiig +dreißig +drfen +drfte +drin +dritte +drüber +drunter +du +dunklen +durch +durchaus +dürfen +durfte +dürfte +durften +e +eben +ebenfalls +ebenso +ehe +eher +eigenen +eigenes +eigentlich +ein +einban +einbaün +eine +einem +einen +einer +einerseits +eines +einfach +einfhren +einfhrte +einfhrten +einführen +einführte +einführten +eingesetzt +einig +einige +einigem +einigen +einiger +einigermaen +einigermaßen +einiges +einmal +eins +einseitig +einseitige +einseitigen +einseitiger +einst +einstmals +einzig +ende +entsprechend +entweder +er +erffne +erffnen +erffnet +erffnete +erffnetes +ergänze +ergänzen +ergänzte +ergänzten +ergnze +ergnzen +ergnzte +ergnzten +erhält +erhalten +erhielt +erhielten +erhlt +erneut +eröffne +eröffnen +eröffnet +eröffnete +eröffnetes +erst +erste +ersten +erster +es +etc +etliche +etwa +etwas +euch +euer +eure +eurem +euren +eurer +eures +f +fall +falls +fand +fast +ferner +finden +findest +findet +fnf +folgende +folgenden +folgender +folgendes +folglich +fordern +fordert +forderte +forderten +fortsetzen +fortsetzt +fortsetzte +fortsetzten +fr +fragte +frau +frei +freie +freier +freies +fuer +fünf +für +g +gab +gängig +gängige +gängigen +gängiger +gängiges +ganz +ganze +ganzem +ganzen +ganzer +ganzes +gänzlich +gar +gbr +geb +geben +geblieben +gebracht +gedurft +geehrt +geehrte +geehrten +geehrter +gefallen +gefälligst +gefällt +gefiel +geflligst +gefllt +gegeben +gegen +gehabt +gehen +geht +gekommen +gekonnt +gemacht +gemäss +gemocht +gemss +genommen +genug +gern +gesagt +gesehen +gestern +gestrige +getan +geteilt +geteilte +getragen +gewesen +gewissermaen +gewissermaßen +gewollt +geworden +ggf +gib +gibt +glcklicherweise +gleich +gleichwohl +gleichzeitig +glücklicherweise +gmbh +gngig +gngige +gngigen +gngiger +gngiges +gnzlich +gratulieren +gratuliert +gratulierte +gute +guten +h +hab +habe +haben +haette +halb +hallo +hast +hat +hätt +hatte +hätte +hatten +hätten +hattest +hattet +hchstens +heraus +herein +heute +heutige +hier +hiermit +hiesige +hin +hinein +hinten +hinter +hinterher +hnlich +hoch +höchstens +htt +htte +htten +hundert +i +ich +igitt +ihm +ihn +ihnen +ihr +ihre +ihrem +ihren +ihrer +ihres +im +immer +immerhin +important +in +indem +indessen +info +infolge +innen +innerhalb +ins +insofern +inzwischen +irgend +irgendeine +irgendwas +irgendwen +irgendwer +irgendwie +irgendwo +ist +j +ja +jährig +jährige +jährigen +jähriges +je +jede +jedem +jeden +jedenfalls +jeder +jederlei +jedes +jedoch +jemand +jene +jenem +jenen +jener +jenes +jenseits +jetzt +jhrig +jhrige +jhrigen +jhriges +k +kam +kann +kannst +kaum +kein +keine +keinem +keinen +keiner +keinerlei +keines +keineswegs +klar +klare +klaren +klares +klein +kleinen +kleiner +kleines +knftig +knn +knnen +knnt +knnte +knnten +koennen +koennt +koennte +koennten +komme +kommen +kommt +konkret +konkrete +konkreten +konkreter +konkretes +könn +können +könnt +konnte +könnte +konnten +könnten +künftig +l +lag +lagen +langsam +längst +längstens +lassen +laut +lediglich +leer +legen +legte +legten +leicht +leider +lesen +letze +letzten +letztendlich +letztens +letztes +letztlich +lichten +liegt +liest +links +lngst +lngstens +m +mache +machen +machst +macht +machte +machten +mag +magst +mal +man +manche +manchem +manchen +mancher +mancherorts +manches +manchmal +mann +margin +mchte +mchten +mchtest +mehr +mehrere +mein +meine +meinem +meinen +meiner +meines +meist +meiste +meisten +meta +mgen +mglich +mgliche +mglichen +mglicher +mglicherweise +mich +mindestens +mir +mit +mithin +mochte +möchte +möchten +möchtest +mögen +möglich +mögliche +möglichen +möglicher +möglicherweise +morgen +morgige +mssen +msste +mssten +mt +mte +mu +muessen +muesst +muesste +muss +muß +müssen +musst +mußt +müßt +musste +müsste +müßte +mussten +müssten +mut +n +nach +nachdem +nacher +nachhinein +nächste +nacht +nahm +nämlich +natrlich +natürlich +nchste +neben +nebenan +nehmen +nein +neu +neue +neuem +neuen +neuer +neues +neun +nicht +nichts +nie +niemals +niemand +nimm +nimmer +nimmt +nirgends +nirgendwo +nmlich +noch +nötigenfalls +ntigenfalls +ntzt +nun +nur +nutzen +nutzt +nützt +nutzung +o +ö +ob +oben +oberhalb +obgleich +obschon +obwohl +oder +oft +ohne +p +per +pfui +plötzlich +pltzlich +pro +q +reagiere +reagieren +reagiert +reagierte +rechts +regelmäßig +regelmig +rief +rund +s +sage +sagen +sagt +sagte +sagten +sagtest +sämtliche +sang +sangen +schätzen +schätzt +schätzte +schätzten +schlechter +schlielich +schließlich +schnell +schon +schreibe +schreiben +schreibens +schreiber +schtzen +schtzt +schtzte +schtzten +schwierig +sechs +sect +sehe +sehen +sehr +sehrwohl +seht +sei +seid +sein +seine +seinem +seinen +seiner +seines +seit +seitdem +seite +seiten +seither +selber +selbst +senke +senken +senkt +senkte +senkten +setzen +setzt +setzte +setzten +sich +sicher +sicherlich +sie +sieben +siebte +siehe +sieht +sind +singen +singt +smtliche +so +sobald +soda +sodaß +soeben +sofern +sofort +sog +sogar +solange +solch +solche +solchem +solchen +solcher +solches +soll +sollen +sollst +sollt +sollte +sollten +solltest +somit +sondern +sonst +sonstwo +sooft +soviel +soweit +sowie +sowohl +später +spielen +spter +startet +startete +starteten +statt +stattdessen +steht +steige +steigen +steigt +stets +stieg +stiegen +such +suchen +t +tages +tat +tät +tatsächlich +tatsächlichen +tatsächlicher +tatsächliches +tatschlich +tatschlichen +tatschlicher +tatschliches +tausend +teile +teilen +teilte +teilten +titel +total +trage +tragen +trägt +trgt +trotzdem +trug +tt +tun +tust +tut +txt +u +ü +übel +über +überall +überallhin +überdies +übermorgen +übrig +übrigens +ueber +um +umso +unbedingt +und +ungefähr +ungefhr +unmglich +unmgliche +unmglichen +unmglicher +unmöglich +unmögliche +unmöglichen +unmöglicher +unnötig +unntig +uns +unse +unsem +unsen +unser +unsere +unserem +unseren +unserer +unseres +unserm +unses +unten +unter +unterbrach +unterbrechen +unterhalb +unwichtig +usw +v +verffentlichen +verffentlicher +verffentlicht +verffentlichte +verffentlichten +verffentlichtes +vergangen +vergangene +vergangener +vergangenes +vermag +vermgen +vermögen +vermutlich +veröffentlichen +veröffentlicher +veröffentlicht +veröffentlichte +veröffentlichten +veröffentlichtes +verrate +verraten +verriet +verrieten +version +versorge +versorgen +versorgt +versorgte +versorgten +versorgtes +viel +viele +vielen +vieler +vieles +vielleicht +vielmals +vier +vllig +völlig +vollständig +vollstndig +vom +von +vor +voran +vorbei +vorber +vorgestern +vorher +vorne +vorüber +w +wachen +waere +während +währenddessen +wann +war +wär +wäre +waren +wären +warst +warum +was +weder +weg +wegen +wei +weil +weiß +weiter +weitere +weiterem +weiteren +weiterer +weiteres +weiterhin +welche +welchem +welchen +welcher +welches +wem +wen +wenig +wenige +weniger +wenigstens +wenn +wenngleich +wer +werde +werden +werdet +weshalb +wessen +whrend +whrenddessen +wichtig +wie +wieder +wieso +wieviel +wiewohl +will +willst +wir +wird +wirklich +wirst +wo +wodurch +wogegen +woher +wohin +wohingegen +wohl +wohlweislich +wolle +wollen +wollt +wollte +wollten +wolltest +wolltet +womit +woraufhin +woraus +worin +wr +wrden +wre +wren +wurde +wurden +würden +x +y +z +zahlreich +z.B. +zehn +zeitweise +ziehen +zieht +zog +zogen +zu +zudem +zuerst +zufolge +zugleich +zuletzt +zum +zumal +zur +zurck +zurück +zusammen +zuviel +zwanzig +zwar +zwei +zwischen +zwlf +zwölf