View previous topic :: View next topic |
Author |
Message |
itay n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 12 Oct 2002 Posts: 32
|
Posted: Sat Sep 06, 2003 11:01 am Post subject: can't use mysql! |
|
|
i've emerge mysql-4.0.14-r1 and it doesn't seem to work i've did config to the ebuild and copied /etc/mysql/my.cnf-4.0.14-r1 to /etc/mysql/my.cnf and configurate him and started the service (/etc/init.d/mysql start) and it doesn't seem to work!
ltrace of mysqladmin -u root password '123':
Code: |
__libc_start_main(0x08049788, 5, 0xbffff924, 0x0804b54c, 0x0804b57d <unfinished ...>
my_init(0x40007f68, 0x40059997, 0x40059997, 0x40039770, 0x4002d210) = 0
mysql_init(0xbffff6a0, 0x40059997, 0x40059997, 0x40039770, 0x4002d210) = 0xbffff6a0
load_defaults(0x0804b80c, 0x0804d8e0, 0xbffff8e0, 0xbffff8e4, 0x4002d210) = 0
handle_options(0xbffff8e0, 0xbffff8e4, 0x0804d100, 0x0804b3be, 0x4002d210 <unfinished ...>
my_no_flags_free(0, 0, 0xbffff5f8, 0x40107774, 0x0804b681) = 0
my_strdup(0x0806f96b, 8, 0xbffff5f8, 0x40107774, 0x0804b681) = 0x0806eff0
<... handle_options resumed> ) = 0
signal(2, 0x0804b1c8) = NULL
signal(15, 0x0804b1c8) = NULL
mysql_options(0xbffff6a0, 0, 0xbffff69c, 0x0804b3be, 0x4002d210) = 0
mysql_real_connect(0xbffff6a0, 0, 0x0806f000, 0x0806eff0, 0) = 0
mysql_error(0xbffff6a0, 0x40110bc6, 0x0806f000, 0x0806eff0, 0) = 0xbffff6dc
my_printf_error(0, 0x0804c200, 4, 0x0804b81e, 0xbffff6dc) = 0
mysql_errno(0xbffff6a0, 0x0804c200, 4, 0x0804b81e, 0xbffff6dc) = 2002
fprintf(0x403c3f60, "Check that mysqld is running and"...) = 88
my_no_flags_free(0x0806eff0, 0, 0xbffff69c, 0x0804b3be, 0x4002d210) = 0
my_no_flags_free(0x0806f000, 0, 0xbffff69c, 0x0804b3be, 0x4002d210) = 0
free_defaults(0x0806f9d0, 0, 0xbffff69c, 0x0804b3be, 0x4002d210) = 0
my_end(0, 0, 0xbffff69c, 0x0804b3be, 0x4002d210) = 0x403c3f60
exit(1 <unfinished ...>
+++ exited (status 1) +++
|
and the outpad:
Code: |
box root # mysqladmin -u root password '123'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
|
i don't know what to do... i've searched every single config file ![Confused :?](images/smiles/icon_confused.gif) _________________ yours, itay ![Cool 8)](images/smiles/icon_cool.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
slartibartfasz Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_kif.gif)
Joined: 29 Oct 2002 Posts: 1462 Location: Vienna, Austria
|
Posted: Sat Sep 06, 2003 11:49 am Post subject: |
|
|
it seems like your mysql is not running - try to start it manually and see what that does for you
if u upgraded from a previous version make sure that your init scripts are ok. the wrapper script that is used to start mysql has been renamed from safe_mysqld to mysqld_safe - perhaps this is the problem... _________________ To an engineer the glass is neither half full, nor half empty - it is just twice as big as it needs to be. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
itay n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 12 Oct 2002 Posts: 32
|
Posted: Sat Sep 06, 2003 12:30 pm Post subject: |
|
|
i didn't upgade, and the /etc/init.d/mysql seems to be fine:
Code: | #!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /home/cvsroot/gentoo-x86/dev-db/mysql/files/mysql-4.0.rc6,v 1.5 2003/04/22 10:00:18 robbat2 Exp $
depend() {
need net
use dns
}
checkconfig() {
if [ ! -f /etc/mysql/my.cnf ] ; then
eerror "No /etc/mysql/my.cnf file exists!"
fi
dir=`my_print_defaults mysqld | grep -- --datadir | sed -e "s|^.*=\(.*\)|\1|"`
if [ ! -d $dir/mysql ] ; then
eerror "You dont appear to have the mysql database installed yet."
eerror "Please run /usr/bin/mysql_install_db to have this done..."
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting mysqld"
start-stop-daemon --start --quiet --exec /usr/bin/mysqld_safe \
--background -- >/dev/null 2>&1
eend $?
}
stop () {
ebegin "Stopping mysqld"
start-stop-daemon --stop --quiet --pidfile=/var/run/mysqld/mysqld.pid
eend $?
} |
but i can't be closed (the service) and the pidfile doesn't seem to exist. _________________ yours, itay ![Cool 8)](images/smiles/icon_cool.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
itay n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 12 Oct 2002 Posts: 32
|
Posted: Sat Sep 06, 2003 12:36 pm Post subject: |
|
|
my /etc/mysql/my.cnf:
Code: | # /etc/mysql/my.cnf: The global mysql configuration file.
# $Header: /home/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.0.14-r1,v 1.1 2003/08/11 10:40:38 robbat2 Exp $
#
# This file can be simultaneously placed in three places:
# 1. /etc/mysql/my.cnf to set global options.
# 2. /var/lib/mysql/my.cnf to set server-specific options.
# 3. ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of them.
#
# The following values assume you have at least 32M RAM!
[client]
password = 123
port = 3306
socket = /var/run/mysqld/mysqld.sock
[safe_mysqld]
err-log = /var/log/mysql/mysql.err
[mysqld]
skip-innodb
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
log-error = /var/log/mysql/mysqld.err
# If set, mysql logs all queries(general query log). This will be deprecated in
# 5.0. This logs all queries, even error queries and is slow.
# log = /var/log/mysql/mysql.log
#
# If you really need logging, use rather binary logging. Especially when doing
# replication. Read
# file:/usr/share/doc/mysql-*/manual.html.gz#Replication
# You can use PURGE MASTER LOGS TO '$hostname-bin.010' to get rid of old logs
# from $hostname-bin.01 up to $hostname-bin.09 while the slave server is
# running.
# Before doing that, check which logfile slave curently uses by running
# mysql> SHOW SLAVE STATUS
# To list logfiles on master do:
# mysql> SHOW MASTER LOGS
# Then use PURGE for those not needed anymore only! Never remove the files
# manually!
#
# Also consult RESET MASTER and RESET SLAVE commands before doing any changes
# mysql> RESET MASTER - Deletes all binary logs listed in the index
# file, resetting the binlog index file to be empty.
# mysql> RESET SLAVE - Makes the slave forget its replication position in
# the master logs.
# mysql> SET SQL_LOG_BIN=0 - this turns off logging (execute on MASTER only)
# mysql> SET SQL_LOG_BIN=1 - this turns on logging (execute on MASTER only)
#
# log-bin
# set-variable = binlog-do-db=non_existant
# set-variable = binlog-ignore-db=database_name
#
# server-id has to unique for each master or slave in your network,
# lets use last number from IP address
# server-id = 207
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
# keep secure by default!
bind-address = 127.0.0.1
port = 3306
# this can make it even more secure:
#skip-networking
[mysqldump]
quick
set-variable = max_allowed_packet=1M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
set-variable = key_buffer=16M
|
_________________ yours, itay ![Cool 8)](images/smiles/icon_cool.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
JohanH n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/9581006063e98d0ebe7ae5.jpg)
Joined: 12 Apr 2003 Posts: 27 Location: Fishers, IN
|
Posted: Wed Sep 10, 2003 2:10 am Post subject: |
|
|
I don't know if this is related, but anyhow:
I run snort with logging to a mysql database. In my snort init script I have listed mysql as a need dependency to ensure that snort starts after mysql, which it does. Everything reports OK on startup, but snort doesn't log anything and my kernel log says:
Code: | Sep 9 18:57:57 [snort] FATAL ERROR: database: mysql_error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) |
There are no mysqld messages in the log. After zapping the snort service and running /etc/init.d/snort start manually, snort can connect to mysql and runs normally. However, should I manually stop mysqld before zapping and starting snort again, snort says it starts mysqld first and then snort, but I get the same kernel log error and I have to zap and start snort again.
Does mysql somehow take a few seconds to be reachable after reporting being up (similar to Windows being unresponsive a fair while after showing the login screen )?
EDIT: Turns out that mysql does take an extra second to fully start. Inserting a loop in the snort init script that waits for the above .sock file to exist fixes it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|