Welcome, Guest. Please Login or Register
FUG-FR logo
 
  HomeHelpSearchLoginRegister  
 
Erreur MySQL (Read 7030 times)
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Erreur MySQL
08. Nov 2010 at 12:07
 
Bonjour,

Voila j'ai un souci avec mysql. J'ai installé mysql55-server mysql55-client sur le server mais cela ne fonctionne pas.

Je vous laisse regarder :
Code:
# /usr/local/libexec/mysqld status
101108 10:04:58 [Warning] option 'tmp_table_size': unsigned value 128 adjusted to 1024
101108 10:04:58 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

101108 10:04:58 [ERROR] Aborting

101108 10:04:58 [Note] /usr/local/libexec/mysqld: Shutdown complete
 



Code:
# mysql -h localhost -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 



Je suis vraiment perdu je ne voit pas d'ou vient le problème Sad

Merci de m'aider.
Back to top
 
 
IP Logged
 
fgudin
Global Moderator
*****
Offline


PouetPouetBSD roul3z

Posts: 1552
Thonon (74)
Gender: male
Re: Erreur MySQL
Reply #1 - 08. Nov 2010 at 12:31
 
Le lancement devrait être effectué à travers un script RC (/usr/local/etc/rc.d/mysql, non ?) et à voir la seconde erreur, ça ne doit pas être le cas… Que dit 'ps ax' ?

Sinon, les binaires sous libexec/ ne sont pas là pour être appelés directement, en général, mais à l'aide de wrappers qui gèrent correctement leurs environnement, options, etc.
Back to top
 
 
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #2 - 08. Nov 2010 at 14:07
 
Voici j'ai donc lancer mysql :
Code:
# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
 



Voila ce que me dit ps ax:
Code:
ps aux | grep mysql
root     94503  0.0  0.0  5932  1088  p0  R+   12:04PM   0:00.00 grep mysql
 



Bizard on dirait qu'il ne me le lance pas...

Et quand j'essaie de me connecter a mysql :
Code:
# mysql -h localhost -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
 



Je suis débutant sur FreeBSD, j'utilise surtout Debian.

Merci de votre aide.




Back to top
 
 
IP Logged
 
fgudin
Global Moderator
*****
Offline


PouetPouetBSD roul3z

Posts: 1552
Thonon (74)
Gender: male
Re: Erreur MySQL
Reply #3 - 08. Nov 2010 at 14:21
 
Bon, je vois dans ports/databases/mysql50-server/files/mysql-server.sh.in qu'il y a un petit truc à toucher:
Quote:
# Add the following line to /etc/rc.conf to enable mysql:
# mysql_enable (bool):      Set to "NO" by default.
#                  Set it to "YES" to enable MySQL.

C'est le cas ?
Back to top
 
 
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #4 - 08. Nov 2010 at 14:39
 
Alors dans ports/databases/mysql50-server/files/mysql-server.sh.in , il y a bien :

Code:
# Add the following line to /etc/rc.conf to enable mysql:
# mysql_enable (bool):      Set to "NO" by default.
#                  Set it to "YES" to enable MySQL. 



J'ai vérifié dans /etc/rc.conf, et il y a bien
Code:
mysql_enable="YES" 

Back to top
 
 
IP Logged
 
David Marec
Senior Member
****
Offline



Posts: 386
Toulouse
Gender: male
Re: Erreur MySQL
Reply #5 - 08. Nov 2010 at 21:04
 
C'est curieux.

Vous avez bien configuré je pense mysql en démarrage automatique. Sinon, le lancement du script RC de «mysql»  aurait râlé.

Notez que depuis la 7.3, la commande service fait le même boulot.
Code:
service mysql-server start
david:~#service mysql-server status
mysql is running as pid 1702. 



J'ai ici un server Mysql dans une jail:
Code:
david:~#jexec 1 grep mysql /etc/rc.conf
mysql_enable="yes"
david:~#jexec 1 ps ax | grep mysql
 1651  ??  IsJ    0:00,01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/v
 1702  ??  IJ     0:00,42 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/va
david:~#mysql -h wiki.dmarec.local -V
mysql  Ver 14.14 Distrib 5.1.52, for portbld-freebsd8.1 (amd64) using  5.2
 



Vous n'avez aucun message sur la console pour indiquer que quelque chose a dérapé ?

Sinon, consultez le journal:
Code:
david:~#jexec 1 tail -f /var/db/mysql/wiki.dmarec.local.err
101108 18:12:37  InnoDB: Shutdown completed; log sequence number 0 9551170
101108 18:12:37 [Note] /usr/local/libexec/mysqld: Shutdown complete

101108 18:12:37 mysqld_safe mysqld from pid file /var/db/mysql/wiki.dmarec.local.pid ended
101108 19:21:31 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
101108 19:21:31 [Note] Plugin 'FEDERATED' is disabled.
101108 19:21:31  InnoDB: Started; log sequence number 0 9551170
101108 19:21:31 [Note] Event Scheduler: Loaded 0 events
101108 19:21:31 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.1.52'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-5.1.52
 



dans /var/db/mysql/hostname.err

Vous avez bien un hostname au fait ?
Je crois que le bidule est allergique au machine sans nom.

Vérifiez aussi que ce fichier
Code:
ls -l  /tmp/mysql.sock
srwxrwxrwx  1 mysql  wheel  0  8 nov 19:21 /tmp/mysql.sock
 



Appartiennent bien à mysql.
Attention, sur votre version il peut se trouver ailleurs ( sous /var/ par exemple )
Back to top
« Last Edit: 08. Nov 2010 at 21:22 by David Marec »  
WWW WWW https://diaspora.lapinbilly.eu/stream https://diaspora.lapinbilly.eu/stream  
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #6 - 09. Nov 2010 at 10:37
 
Alors voici le récupitulatif que tu m'as demandé de regarder Wink

Code:
# service mysql-server start
service: Command not found.
 



Code:
# /usr/local/libexec/mysqld start
101109  8:26:44 [Warning] option 'tmp_table_size': unsigned value 128 adjusted to 1024
101109  8:26:44 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

101109  8:26:44 [ERROR] Aborting

101109  8:26:44 [Note] /usr/local/libexec/mysqld: Shutdown complete
 



Code:
# /usr/local/etc/rc.d/mysql-server start
Starting mysql.

# grep mysql /etc/rc.conf
mysql_enable="YES"

# ps ax | grep mysql
 1624  p0  D+     0:00.00 grep mysql
 



Code:
# ls -l  /tmp/mysql.sock
ls: /tmp/mysql.sock: No such file or directory 



Je suis vraiment perdu la :x



Back to top
 
 
IP Logged
 
David Marec
Senior Member
****
Offline



Posts: 386
Toulouse
Gender: male
Re: Erreur MySQL
Reply #7 - 09. Nov 2010 at 12:32
 
JulSa_ wrote on 09. Nov 2010 at 10:37:
Alors voici le récupitulatif que tu m'as demandé de regarder Wink

Code:
# service mysql-server start
service: Command not found.
 




Euh, vous avez quelle version de FreeBSD ?
Je croyais que cette commande était dans la base depuis la 7.3...

Quote:
Code:
# /usr/local/libexec/mysqld start 




Il ne faut pas utiliser cette commande en tant que root, je pense.
Elle est lancée en tant que service, de mémoire.

Quote:
Je suis vraiment perdu la :x


Il reste à connaître votre hostname

Code:
wiki# hostname
wiki.dmarec.localwiki# grep hostname /etc/rc.conf
hostname="wiki.dmarec.local"    # Set this!
 



Et enfin, de consulter les logs de mysql, attaché à votre machine. Dans l'exemple ci dessous, ma machine se nomme «wiki.dmarec.local»
Code:
wiki# ls /var/db/mysql/*.err
/var/db/mysql/wiki.dmarec.local.err
 



Code:
wiki# tail -5 /var/db/mysql/wiki.dmarec.local.err
101109 11:21:19 [Note] Plugin 'FEDERATED' is disabled.
101109 11:21:19  InnoDB: Started; log sequence number 0 9551170
101109 11:21:19 [Note] Event Scheduler: Loaded 0 events
101109 11:21:19 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.1.52'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-5.1.52
 



Pour en savoir plus.

Back to top
 
WWW WWW https://diaspora.lapinbilly.eu/stream https://diaspora.lapinbilly.eu/stream  
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #8 - 09. Nov 2010 at 12:47
 
Voici mon hostname :
Code:
cedricnicole# hostname
cedricnicole.theplamet.com
cedricnicole# grep hostname /etc/rc.conf
hostname="cedricnicole.theplamet.com"
 



Voici les logs lors de la tentative de lancement :
Code:
101109 08:52:10 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
101109  8:52:11 [Warning] option 'tmp_table_size': unsigned value 128 adjusted to 1024
101109  8:52:11 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101109  8:52:11  InnoDB: highest supported file format is Barracuda.
101109  8:52:11 InnoDB 1.1.2 started; log sequence number 10351124882
101109  8:52:11 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-locking'
101109  8:52:11 [ERROR] Aborting

101109  8:52:11  InnoDB: Starting shutdown...
101109  8:52:16  InnoDB: Shutdown completed; log sequence number 10351124882
101109  8:52:16 [Note] /usr/local/libexec/mysqld: Shutdown complete

101109 08:52:16 mysqld_safe mysqld from pid file /var/db/mysql/cedricnicole.theplamet.com.pid ended
 



Sinon comment je peux connaitre ma version de FreeBSD ?

Merci pour ton aide en tout cas Smiley
Back to top
 
 
IP Logged
 
David Marec
Senior Member
****
Offline



Posts: 386
Toulouse
Gender: male
Re: Erreur MySQL
Reply #9 - 09. Nov 2010 at 13:07
 
JulSa_ wrote on 09. Nov 2010 at 12:47:
Voici les logs lors de la tentative de lancement :
Code:
101109  8:52:11 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-locking'
 




D'où sort cette option “skip-locking” !?

vous devez avoir un fichier de configuration quelque part
- /etc/my.cnf
- /usr/local/etc/my.cnf
- /var/db/mysql/my.cnf
- ?
qui comporte cette option

Quote:
Sinon comment je peux connaitre ma version de FreeBSD ?


Code:
uname -r
 


Back to top
« Last Edit: 09. Nov 2010 at 13:22 by David Marec »  
WWW WWW https://diaspora.lapinbilly.eu/stream https://diaspora.lapinbilly.eu/stream  
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #10 - 09. Nov 2010 at 13:56
 
Voici ma versione :
Code:
# uname -r
7.2-RELEASE
 



Et voici le contenu de mon /usr/local/etc/my.cnf
Code:
# 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/db/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		= /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port		= 3306
socket		= /tmp/mysql.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 200M
table_open_cache = 128
tmp_table_size = 128
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# 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

# binary logging format - mixed recommended
binlog_format=mixed

# 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=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> 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     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# 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/db/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/db/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 = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[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 = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
 



Il y a bien l'option "skip-locking" dans la partir [mysqld]

J'en fait quoi ? Je la commente ?
Back to top
 
 
IP Logged
 
JulSa_
YaBB Newbies
*
Offline


I Love BSD!

Posts: 7
Re: Erreur MySQL
Reply #11 - 09. Nov 2010 at 14:32
 
Alors j'ai commenté la ligne.

Code:
cedricnicole# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
cedricnicole# ps aux | grep mysql
mysql   3558  0.0  0.0  7064  1816  ??  Ss   12:21PM   0:00.02 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/va
mysql   3814  0.0  0.5 204916 45248  ??  S    12:21PM   0:00.06 [mysqld]
root    3544  0.0  0.0  4604   900  p0  S+   12:21PM   0:00.00 tail -f /var/db/mysql/cedricnicole.theplamet.com.err
root    3829  0.0  0.0  5932  1224  p1  D+   12:22PM   0:00.00 grep mysql
 



Dans les log :
Code:
101109 12:21:47 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
101109 12:21:47 [Warning] option 'tmp_table_size': unsigned value 128 adjusted to 1024
101109 12:21:47 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101109 12:21:47  InnoDB: highest supported file format is Barracuda.
101109 12:21:47 InnoDB 1.1.2 started; log sequence number 10351124882
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_CURRENT' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_HISTORY' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_HISTORY_LONG' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'SETUP_CONSUMERS' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'SETUP_INSTRUMENTS' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'SETUP_TIMERS' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'PERFORMANCE_TIMERS' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'THREADS' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_SUMMARY_BY_INSTANCE' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'FILE_SUMMARY_BY_EVENT_NAME' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'FILE_SUMMARY_BY_INSTANCE' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'MUTEX_INSTANCES' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'RWLOCK_INSTANCES' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'COND_INSTANCES' has the wrong structure
101109 12:21:47 [ERROR] Native table 'performance_schema'.'FILE_INSTANCES' has the wrong structure
101109 12:21:47 [Note] Event Scheduler: Loaded 0 events
101109 12:21:47 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.5.6-rc-log'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-5.5.6_1
 



Mysql ce lance mais visiblement il y a plein d'erreur.

Back to top
 
 
IP Logged
 
David Marec
Senior Member
****
Offline



Posts: 386
Toulouse
Gender: male
Re: Erreur MySQL
Reply #12 - 09. Nov 2010 at 18:59
 
JulSa_ wrote on 09. Nov 2010 at 14:32:
Alors j'ai commenté la ligne.


Normalement, ce fichier n'est pas installé par défaut.
Il vient d'une installation antérieure ?

Quote:
Mysql ce lance mais visiblement il y a plein d'erreur.



Ce sont de fausses alertes.
http://bugs.mysql.com/bug.php?id=54467



Back to top
 
WWW WWW https://diaspora.lapinbilly.eu/stream https://diaspora.lapinbilly.eu/stream  
IP Logged