Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mysql won't start [SOLLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Mon Jun 21, 2010 1:57 am    Post subject: mysql won't start [SOLLVED] Reply with quote

$ sudo emerge --config dev-db/mysql


Configuring pkg...

* Please provide a password for the mysql 'root' user now,
* or in the MYSQL_ROOT_PASSWORD env var.
* Avoid ["'\_%] characters in the password
>
* Retype the password
>
* Creating the mysql database and setting proper
* permissions on it ...
* Starting mysqld ...
.100620 21:45:05 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
100620 21:45:05 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
100620 21:45:05 [Warning] //usr/sbin/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead. [ ok ]
* Setting root password ... [ ok ]
* Loading "zoneinfo", this step may require a few seconds ... ... [ ok ]
* Stopping the server ...
* Done

$ sudo /etc/init.d/mysql start
* Starting ...
* Starting (/etc/mysql/my.cnf)
* MySQL NOT started (0) [ !! ]
* ERROR: mysql failed to start

$ sudo ls -l /var/lib/mysql
total 21268
-rw-rw---- 1 mysql mysql 5242880 Jun 20 21:49 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Jun 20 21:45 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 Jun 20 21:49 ibdata1
drwx------ 2 mysql mysql 4096 Jun 20 21:45 mysql
-rw-rw---- 1 mysql mysql 19775 Jun 20 21:45 mysqld-bin.000001
-rw-rw---- 1 mysql mysql 717389 Jun 20 21:45 mysqld-bin.000002
-rw-rw---- 1 mysql mysql 125 Jun 20 21:45 mysqld-bin.000003
-rw-rw---- 1 mysql mysql 125 Jun 20 21:49 mysqld-bin.000004
-rw-rw---- 1 mysql mysql 80 Jun 20 21:49 mysqld-bin.index
drwx------ 2 mysql mysql 4096 Jun 20 21:45 test

/etc/mysql/my.cnf:
# /etc/mysql/my.cnf: The global mysql configuration file.
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.1,v 1.4 2008/11/1
4 02:16:25 robbat2 Exp $

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysql]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqladmin]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlcheck]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqldump]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlimport]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[mysqlshow]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8

[myisamchk]
character-sets-dir=/usr/share/mysql/charsets

[myisampack]
character-sets-dir=/usr/share/mysql/charsets

# use [safe_mysqld] with mysql-3
[mysqld_safe]
err-log = /var/log/mysql/mysql.err

# add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
[mysqld]
character-set-server = utf8
default-character-set = utf8
user = mysql
port = 3306
socket = /var/run/mysqld/mysqld.sock
pid-file = /var/run/mysqld/mysqld.pid
log-error = /var/log/mysql/mysqld.err
basedir = /usr
datadir = /var/lib/mysql
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
language = /usr/share/mysql/english

# security:
# using "localhost" in connects uses sockets by default
# skip-networking
bind-address = 127.0.0.1

log-bin
server-id = 1

# point the following paths to different dedicated disks
tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# you need the debug USE flag enabled to use the following directives,
# if needed, uncomment them, start the server and issue
# #tail -f /tmp/mysqld.sql /tmp/mysqld.trace
# this will show you *exactly* what's happening in your server ;)

#log = /tmp/mysqld.sql
#gdb
#debug = d:t:i:o,/tmp/mysqld.trace
#one-thread

# uncomment the following directives if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# the following is the InnoDB configuration
# if you wish to disable innodb instead
# uncomment just the next line
#skip-innodb
#
# the rest of the innodb config follows:
# don't eat too much memory, we're trying to be safe on 64Mb boxes
# you might want to bump this up a bit on boxes with more RAM
innodb_buffer_pool_size = 16M
# this is the default, increase it if you have lots of tables
innodb_additional_mem_pool_size = 2M
#
# i'd like to use /var/lib/mysql/innodb, but that is seen as a database :-(
# and upstream wants things to be under /var/lib/mysql/, so that's the route
# we have to take for the moment
#innodb_data_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
#innodb_log_group_home_dir = /var/lib/mysql/
# you may wish to change this size to be more suitable for your system
# the max is there to avoid run-away growth on your machine
innodb_data_file_path = ibdata1:10M:autoextend:max:128M
# we keep this at around 25% of of innodb_buffer_pool_size
# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_p
ool_size)
innodb_log_file_size = 5M
# this is the default, increase it if you have very large transactions going on
innodb_log_buffer_size = 8M
# this is the default and won't hurt you
# you shouldn't need to tweak it
set-variable = innodb_log_files_in_group=2
# see the innodb config docs, the other options are not always safe
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_file_per_table

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
# uncomment the next directive if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
_________________
AMD FX6100 CPU, 16 GiB RAM, OCZ Vertex 3 SSD
ASRock 970 Extreme3 motherboard with S/PDIF audio
Galaxy-NVidia GeForce 8800GT video card, Cyber Power CP550HG USB UPS


Last edited by bjlockie on Wed Jun 23, 2010 1:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Mon Jun 21, 2010 3:13 am    Post subject: Reply with quote

out of curiosity, have you checked `ps` and confirmed that it isn't running?

I ask because I'm having such an issue right now, whereby it actually *does* start up successfully, pid sock and all that are created without issue, but the init script reports failure. Which sucks, because anything that depends on mysql will try and start it, fail, etc, so I had to adjust every bloody init script that uses it.

It *does* start for me, everything can connect, no issues. But for some odd reason - I don't know if it's taking too long or what - the init script doesnt seem to realize that indeed it is started successfully. Am on 5.1.46 under hardened-*
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Mon Jun 21, 2010 11:59 pm    Post subject: Reply with quote

cach0rr0 wrote:
out of curiosity, have you checked `ps` and confirmed that it isn't running?

I ask because I'm having such an issue right now, whereby it actually *does* start up successfully, pid sock and all that are created without issue, but the init script reports failure. Which sucks, because anything that depends on mysql will try and start it, fail, etc, so I had to adjust every bloody init script that uses it.

It *does* start for me, everything can connect, no issues. But for some odd reason - I don't know if it's taking too long or what - the init script doesnt seem to realize that indeed it is started successfully. Am on 5.1.46 under hardened-*


It"s not running.
_________________
AMD FX6100 CPU, 16 GiB RAM, OCZ Vertex 3 SSD
ASRock 970 Extreme3 motherboard with S/PDIF audio
Galaxy-NVidia GeForce 8800GT video card, Cyber Power CP550HG USB UPS
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2285
Location: Adendorf, Germany

PostPosted: Tue Jun 22, 2010 1:13 pm    Post subject: Reply with quote

And what does the log say why mysql isn't starting? ( /var/log/mysql/mysqld.err )
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Tue Jun 22, 2010 10:11 pm    Post subject: Reply with quote

Yamakuzure wrote:
And what does the log say why mysql isn't starting? ( /var/log/mysql/mysqld.err )


$ sudo more /var/log/mysql/mysqld.err

100622 18:09:18 [Warning] No argument was provided to --log-bin, and --log-bin-i
ndex was not used; so replication may break when this MySQL server acts as a mas
ter and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid th
is problem.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 [Warning] /usr/sbin/mysqld: Option '--set-variable' is deprecate
d. Use --variable-name=value instead.
100622 18:09:18 InnoDB: Started; log sequence number 0 44233
100622 18:09:18 [ERROR] Can't start server: Bind on TCP/IP port: Address already
in use
100622 18:09:18 [ERROR] Do you already have another mysqld server running on por
t: 3306 ?
100622 18:09:18 [ERROR] Aborting

100622 18:09:18 InnoDB: Starting shutdown...
100622 18:09:23 InnoDB: Shutdown completed; log sequence number 0 44233
100622 18:09:23 [Note] /usr/sbin/mysqld: Shutdown complete

$ sudo netstat -a | grep 3306
unix 3 [ ] STREAM CONNECTED 2330646 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 2330642
_________________
AMD FX6100 CPU, 16 GiB RAM, OCZ Vertex 3 SSD
ASRock 970 Extreme3 motherboard with S/PDIF audio
Galaxy-NVidia GeForce 8800GT video card, Cyber Power CP550HG USB UPS
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Jun 23, 2010 12:32 am    Post subject: Reply with quote

just something to point out, you've omitted a necessary switch in your netstat test

I point this out because you posted "netstat -a |grep 3306" as being evidentiary that nothing is listening on 3306 already - it isn't. Need the n switch.

Code:

bauer hooks # netstat -a |grep 3306

bauer hooks # netstat -an |grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     
tcp        0      0 x.x.x.91:3306      x.x.x.92:55018     ESTABLISHED
tcp        0      0 x.x.x.91:3306      x.x.x.92:37213     ESTABLISHED
tcp        0      0 x.x.x.91:3306      x.x.x.92:40278     ESTABLISHED
tcp        0      0 x.x.x.91:3306      x.x.x.92:43935     ESTABLISHED
tcp        0      0 x.x.x.91:3306      x.x.x.92:51589     ESTABLISHED
tcp        0      0 x.x.x.91:3306      x.x.x.92:52969     ESTABLISHED


all the better, use -anp which shows something like:

Code:

tcp        0      0 x.x.x.91:3306      x.x.x.92:52969     ESTABLISHED 3648/mysqld

_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Wed Jun 23, 2010 3:11 am    Post subject: Reply with quote

cach0rr0 wrote:
just something to point out, you've omitted a necessary switch in your netstat test

I point this out because you posted "netstat -a |grep 3306" as being evidentiary that nothing is listening on 3306 already - it isn't. Need the n switch.


$ sudo netstat -anp | grep 3306
unix 3 [ ] STREAM CONNECTED 2330646 2178/X @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 2330642 23619/wish
_________________
AMD FX6100 CPU, 16 GiB RAM, OCZ Vertex 3 SSD
ASRock 970 Extreme3 motherboard with S/PDIF audio
Galaxy-NVidia GeForce 8800GT video card, Cyber Power CP550HG USB UPS
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Wed Jun 23, 2010 3:33 am    Post subject: Reply with quote

hrm...so the addrinuse nonsense is a red herring

check user/group ownership of?

Code:

# ls -alh /var/run/mysqld

_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Wed Jun 23, 2010 1:06 pm    Post subject: Reply with quote

cach0rr0 wrote:
hrm...so the addrinuse nonsense is a red herring

check user/group ownership of?

Code:

# ls -alh /var/run/mysqld


I did an update and now it starts.
I must have had an old library or something
_________________
AMD FX6100 CPU, 16 GiB RAM, OCZ Vertex 3 SSD
ASRock 970 Extreme3 motherboard with S/PDIF audio
Galaxy-NVidia GeForce 8800GT video card, Cyber Power CP550HG USB UPS
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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