Stopping MySQL database server

[code]root@kmcs:/home/kmc# cat /etc/mysql/my.cnf

The MySQL database server configuration file.

You can copy this to one of:

- “/etc/mysql/my.cnf” to set global options,

- “~/.my.cnf” to set user-specific options.

One can use all long options that the program supports.

Run program with --help to get a list of available options and with

–print-defaults to see which it would actually understand and use.

For explanations see

http://dev.mysql.com/doc/mysql/en/server-system-variables.html

This will be passed to all mysql clients

It has been reported that passwords should be enclosed with ticks/quotes

escpecially if they contain “#” chars…

Remember to edit /etc/mysql/debian.cnf when changing the socket location.

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

Here is 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

[mysqld]

* Basic Settings

user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

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

* Fine Tuning

key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8

This replaces the startup script and checks MyISAM tables if needed

the first time they are touched

myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10

* Query Cache Configuration

query_cache_limit = 1M
query_cache_size = 16M

* Logging and Replication

Both location gets rotated by the cronjob.

Be aware that this log type is a performance killer.

As of 5.1 you can enable the log at runtime!

#general_log_file = /var/log/mysql/mysql.log
general_log_file = /var/log/mysql.log
general_log = 1

Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.

Here you can see queries with especially long duration

#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes

The following can be used as easy to replay backup logs or for replication.

note: if you are setting up a replication slave, see README.Debian about

other settings you may need to change.

#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name

* InnoDB

InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.

Read the manual for more InnoDB related options. There are many!

* Security Features

Read the manual, too, if you want chroot!

chroot = /var/lib/mysql/

For generating SSL certificates I recommend the OpenSSL GUI “tinyca”.

ssl-ca=/etc/mysql/cacert.pem

ssl-cert=/etc/mysql/server-cert.pem

ssl-key=/etc/mysql/server-key.pem

[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

* IMPORTANT: Additional settings that can override those from this file!

The files must end with ‘.cnf’, otherwise they’ll be ignored.

!includedir /etc/mysql/conf.d/
[/code]

J’ai trouvé le pb: Suite à une modif de /etc/network/interfaces, 127.0.0.1 ne ping plus.

Tout refonctionne en reprenant l’interface d’origine

[code]root@kmcs:/etc/network# cat interfaces

This file describes the network interfaces available on your system

and how to activate them. For more information, see interfaces(5).

The loopback network interface

auto lo
iface lo inet loopback
root@kmcs:/etc/network# service networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
[ ok ] Reconfiguring network interfaces…done.
root@kmcs:/etc/network# ifconfig
eth0 Link encap:Ethernet HWaddr 80:fa:5b:09:15:77
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr f8:16:54:6b:ed:ba
inet adr:192.168.1.15 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::fa16:54ff:fe6b:edba/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3132583 errors:0 dropped:0 overruns:0 frame:0
TX packets:990969 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:4329179045 (4.0 GiB) TX bytes:119879485 (114.3 MiB)

root@kmcs:/etc/network# ifup lo
root@kmcs:/etc/network# ifconfig
eth0 Link encap:Ethernet HWaddr 80:fa:5b:09:15:77
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr f8:16:54:6b:ed:ba
inet adr:192.168.1.15 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::fa16:54ff:fe6b:edba/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3134355 errors:0 dropped:0 overruns:0 frame:0
TX packets:992243 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:4330747848 (4.0 GiB) TX bytes:120140606 (114.5 MiB)

root@kmcs:/home/kmc# service mysql restart
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Starting MySQL database server: mysqld …
[info] Checking for tables which need an upgrade, are corrupt or were
not closed cleanly…

[/code]

:whistle:

[quote=“debianhadic”][quote=“fran.b”]Oui, mais on bosse…
[/quote]
Et encore un prof qui va nous faire croire qu’il bosse un dimanche, de plus premier dimanche de leurs vacances de 60 jours …[/quote]


et effectivement Dimanche en 8, je démarrais à 6:30 pour finir à 20:00 :smiley:
L’EN n’est plus ce qu’elle était!

Sinon il faut rajouter

dans /etc/network/interfaces