my.cnf di mysql domanda

scusate la domanda magari stupida “senza magari” il file di configurazione di mysql e sempre questo “my.cnf” se lo apro ce scritto :

[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

To allow mysqld to connect to a MySQL Cluster management daemon, uncomment

these lines and adjust the connectstring as needed.

#ndbcluster
#ndb-connectstring=“nodeid=4;host=localhost:1186”

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[ndbd]

If you are running a MySQL Cluster storage daemon (ndbd) on this machine,

adjust its connection to the management daemon here.

Note: ndbd init script requires this to include nodeid!

connect-string=“nodeid=2;host=localhost:1186”

[ndb_mgm]

connection string for MySQL Cluster management tool

connect-string=“host=localhost:1186”

Anche se e un test vorrei capire se posso inserire i parametri per il mio server oppure e un altro file che gestisce il mysql. Di solito ero abituato trovare questo:

Example MySQL config file for medium systems.

This is for a system with little memory (32M - 64M) where MySQL plays

an important part, or systems up to 128M where MySQL is used together with

other programs (such as a web server)

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/lib/mysql/mysql.sock

Here follows entries for some specific programs

The MySQL server

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 3072M
max_allowed_packet = 512M
table_cache = 1024
sort_buffer_size = 512M
net_buffer_length = 64M
read_buffer_size = 256M
read_rnd_buffer_size = 512M
myisam_sort_buffer_size = 128M

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

sto sbalgiano file o cosa??

Non ho fedora sottomano, per cui al momento ti do solo un http://www.brennan.id.au/17-MySQL_Server.html, verificherò poi…

Puoi modificare il file inserendo le opzioni a te necessarie (in ottemperanza alle specifiche della versione installata di MySql), oppure puoi andare a vedere nella directory:

/usr/share/mysql

Qualche esempio di configurazione; infatti le fai:

ll /usr/share/mysql/my-*.cnf

Trovi vari esempi di files my.cnf:

-rw-r--r-- 1 root root 4972 2 ott 01:29 /usr/share/mysql/my-huge.cnf -rw-r--r-- 1 root root 20970 2 ott 01:29 /usr/share/mysql/my-innodb-heavy-4G.cnf -rw-r--r-- 1 root root 4948 2 ott 01:29 /usr/share/mysql/my-large.cnf -rw-r--r-- 1 root root 4955 2 ott 01:29 /usr/share/mysql/my-medium.cnf -rw-r--r-- 1 root root 2525 2 ott 01:29 /usr/share/mysql/my-small.cnf
Ne scegli uno a te congeniale e lo modifichi in base alle tue necessità.

Evviva ho combinato la mia dopo aver eliminato il file “my.cnf” senza tenere una copia e mettendo un file nuovo mi da questo errore:

error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
error: Found option without preceding group in config file: /etc/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
Timeout error occurred trying to start MySQL Daemon.

Qualche idea per risolvere o mi conviene eliminare mysql e installare uno nuovo ???

Avevi postato il my.cnf, prova a ricopiarlo e verifica il ripristino dello stato iniziale.

Ok risolto infatto avevo mancato una cosa, grazie mille. ho trovato in /usr/share/mysql le possibili configurazione, ma sono troppo leggere, in sostanza il mysql va a leggere il file my.cnf in qesta cartella per configurare il mysql. Ok adesso devo solo rinominare uno di questi file in my.cnf e la configurazione piu adatta al server, grazie mille a tutti.

[quote=l2nova]
in sostanza il mysql va a leggere il file my.cnf in qesta cartella per configurare il mysql[/quote]
Lo so, ma non solo, dipende che tipo di configurazione intendi dare al server… :wink:

ti posto la configurazione del server, in questo caso e un servergame che ho attivato ed e’ gratuito. dato che il povero mysql e sotto stress ogni 2 secondi e’ stata creata appositamete questa configurazione:

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-locking
set-variable = key_buffer=3072M
set-variable = max_allowed_packet=1M
set-variable = table_cache=4096
set-variable = sort_buffer=8M
set-variable = record_buffer=8M
set-variable = thread_cache=16

Try number of CPU’s*2 for thread_concurrency

set-variable = thread_concurrency=16
set-variable = myisam_sort_buffer_size=256M
log-bin
server-id = 1

Point the following paths to different dedicated disks

#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

Uncomment the following if you are using BDB tables

#set-variable = bdb_cache_size=512M
#set-variable = bdb_max_lock=100000

Uncomment the following if you are using Innobase tables

innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
innodb_data_home_dir = /var/lib/mysql/
innodb_log_group_home_dir = /var/lib/mysql/
innodb_log_arch_dir = /var/lib/mysql/
set-variable = innodb_mirrored_log_groups=1
set-variable = innodb_log_files_in_group=3
set-variable = innodb_log_file_size=20M
set-variable = innodb_log_buffer_size=32M
innodb_flush_log_at_trx_commit=1
innodb_log_archive=0
set-variable = innodb_buffer_pool_size=32M
set-variable = innodb_additional_mem_pool_size=4M
set-variable = innodb_file_io_threads=8
set-variable = innodb_lock_wait_timeout=50

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[mysql]
no-auto-rehash

Remove the next comment character if you are not familiar with SQL

#safe-updates

[isamchk]
set-variable = key_buffer=512M
set-variable = sort_buffer=512M
set-variable = read_buffer=4M
set-variable = write_buffer=4M

[myisamchk]
set-variable = key_buffer=512M
set-variable = sort_buffer=512M
set-variable = read_buffer=4M
set-variable = write_buffer=4M

[mysqlhotcopy]
interactive-timeout

e un gioco che si basa su java e di conseguenza un po per pazzia e altro e mi sono lanciato su linux. Comunque funziona anche su win ma i problemi sono doppi …
doppio processore xeon da 2,66 e 16 gb di ram dedicate, 2 dischi da 10.000 rpm da 40 gb dato che ne uso solo 20 gb massimo. Configurato cosi il mysql dovrebbe sfruttare tutti gli 8 processori xeon.