Archive

Archive for the ‘MySQL’ Category

MySQL & Remote access

June 2, 2010 admin No comments
# mysql -u root -p
GRANT ALL PRIVILEGES ON ris.* TO 'ris'@'%' IDENTIFIED BY 'myPassword';

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 3306 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
# service iptables restart
Categories: MySQL Tags:

Tuning MySQL

May 7, 2010 admin No comments
# cp /etc/my.cnf /etc/my.cnf.orig
# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

binlog_cache_size=1M
default_table_type=InnoDB
ft_min_word_len=4

innodb_additional_mem_pool_size=16M
innodb_buffer_pool_size=512M
innodb_data_file_path=ibdata1:10M:autoextend
innodb_file_per_table=1
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size=8M
innodb_log_files_in_group=2
innodb_log_file_size=100M
innodb_status_file=0
innodb_thread_concurrency=0

join_buffer_size=1M
max_allowed_packet=1M
max_connections=3000
max_heap_table_size=64M
max_prepared_stmt_count=1000000
query_cache_size=0
skip_grant_tables
skip_locking
sort_buffer_size=512K
table_cache=2048
thread_cache_size=16
thread_concurrency=16
thread_stack=196K
tmp_table_size=64M
transaction_isolation=REPEATABLE-READ
local-infile=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# /etc/init.d/mysqld stop
# rm /var/lib/mysql/ib_logfile*
# /etc/init.d/mysqld start
# less /var/log/mysqld.log

http://www.administrator.de/index.php?content=820
http://dev.mysql.com/doc/refman/5.0/en/innodb-configuration.html

http://www.zabbix.com/forum/showthread.php?p=24581
http://www.bigresource.com/Web_Hosting-optimizing-Mysql-server-in-plesk-VPS-CTV3Wkw8.html
http://www.mysqlperformanceblog.com/2008/09/16/when-is-it-a-time-to-upgrade-memory/#comment-693350

!!!! http://tuxmining.blogspot.com/2008/05/mysql-51-2-weeks-of-stresstests.html
!!!! http://www.thomas-krenn.com/de/wiki/MySQL_Performance_Tuning

Categories: MySQL Tags:

How to install MySQL (CentOS 5.4)

February 17, 2010 admin No comments
# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

 

# mysql -u root -p
CREATE DATABASE ris CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'ris'@'localhost' IDENTIFIED BY 'myPassword';
GRANT ALL ON ris.* TO 'ris'@'localhost';
Categories: CentOS, MySQL Tags: