Benutzer-Werkzeuge

Webseiten-Werkzeuge


howto:gentoo_mysql

Howto MySQL

Version 1.0
Stand: 10.04.2008

Author: sledge

1.0 Installation MySQL Server

Portage Tree

cat >> /etc/portage/package.use << "EOF"
dev-db/mysql  -berkdb
EOF

Pakete installieren

emerge mysql

2.0 Konfiguration

Es handelt sich hierbei um die Standardkonfiguration von MySQL. Sie ist eigentlich vollkommen ausreichend für den eigenen Gebrauch, muss aber bei größeren Projekten entsprechend angepasst werden.

2.1 my.cnf

cat > /etc/mysql/my.cnf
[client]
port						= 3306
socket						= /var/run/mysqld/mysqld.sock

[mysql]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqladmin]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlcheck]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqldump]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlimport]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlshow]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[myisamchk]
character-sets-dir=/usr/share/mysql/charsets

[myisampack]
character-sets-dir=/usr/share/mysql/charsets

[mysqld_safe]
err-log						= /var/log/mysql/mysql.err

[mysqld]
character-set-server		                = utf8
default-character-set		                = utf8
user 						= mysql
port 						= 3306
socket 						= /var/run/mysqld/mysqld.sock
pid-file 					= /var/run/mysqld/mysqld.pid
log-error 					= /var/log/mysql/mysqld.err
basedir 					= /usr
datadir 					= /var/lib/mysql
skip-locking
key_buffer 					= 16M
max_allowed_packet 			        = 1M
table_cache 				        = 64
sort_buffer_size 			        = 512K
net_buffer_length 			        = 8K
read_buffer_size 			        = 256K
read_rnd_buffer_size 		                = 512K
myisam_sort_buffer_size 	                = 8M
language 					= /usr/share/mysql/english
bind-address				        = 127.0.0.1
log-bin
server-id 					= 1
tmpdir 						= /tmp/
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_data_file_path = ibdata1:10M:autoextend:max:128M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
set-variable = innodb_log_files_in_group=2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet 			        = 16M

[mysql]

[isamchk]
key_buffer 					= 20M
sort_buffer_size 			        = 20M
read_buffer 				        = 2M
write_buffer 				        = 2M

[myisamchk]
key_buffer 					= 20M
sort_buffer_size 			        = 20M
read_buffer 				        = 2M
write_buffer 				        = 2M

[mysqlhotcopy]
interactive-timeout
EOF

2.2 Passwort für MySQL-Rootuser und MySQL Start

emerge --config dev-db/mysql

Wir starten MySQL

/etc/init.d/mysql start

2.3 mysql-secure-installation

Wir entfernen nun die Testdatenbank, anonymen Testuser… Der entstehende Kontext ist selbsterklärend.

/usr/bin/mysql_secure_installation

Anschließend starten wir den MySQL Server neu

/etc/init.d/mysql restart

3.0 MySQL beim Systemstart verfügbar machen

rc-update add mysql default

Zurück zum Index

howto/gentoo_mysql.txt · Zuletzt geändert: 2022/10/11 10:55 (Externe Bearbeitung)

Seiten-Werkzeuge