Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL does not start after fresh emerge
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
daemonflower
Apprentice
Apprentice


Joined: 17 Jul 2004
Posts: 290

PostPosted: Sun Sep 17, 2006 1:59 pm    Post subject: MySQL does not start after fresh emerge Reply with quote

I've had it with trying to update mysql from a prehistoric version, so I wiped my old databases, unemerged all installed versions of mysql and emerged it freshly again.

It does not start up though. After emerge mysql and emerge --config =dev-db/mysql-5.0.24-r1, /etc/init.d/mysql start gave the following error:
Code:
 * Service mysql starting
 my_print_defaults NOT found or not executable
 MySQL datadir is empty or invalid
 Please check your my.cnf : /etc/mysql-500/my.cnf                         [ !! ]
 * ERROR:  mysql failed to start
I followed the advice and found that emerge had created the folder /var/lib/mysql instead of /var/lib/mysql-500 as given in the config. After renaming the folder (rather than tampering with the pristine my.cnf) I got this error:
Code:
 I  * Service mysql starting
 my_print_defaults NOT found or not executable
/sbin/start-stop-daemon: stat /usr/sbin/mysqld-500: No such file or directory (No such file or directory)
 MySQL-500 NOT started (2)                                                [ !! ]
 * ERROR:  mysql failed to start
Renaming /usr/sbin/mysqld to mysqld-500 turned up this error:
Code:
 * Service mysql starting
 my_print_defaults NOT found or not executable
 MySQL-500 NOT started (1)                                                [ !! ]
 * ERROR:  mysql failed to start
without leaving any trace in either /var/log/mysql/mysqld.err or /var/log/mysql-500/mysqld.err (which is the logfile given in the my.cnf).

Now what I'd like to know is this:
  • Have I forgotten a step besides emerge --config?
  • Shouldn't the paths in the my.cnf match the paths on the file system in any case? IOW, is this a bug I should file?
  • How do I get mysql running?
Thanks...
Back to top
View user's profile Send private message
andersbk
n00b
n00b


Joined: 16 Aug 2003
Posts: 35

PostPosted: Sun Sep 17, 2006 2:29 pm    Post subject: Reply with quote

This might help you:

http://gentoo-wiki.com/HOWTO_MySQL

out.
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Sun Sep 17, 2006 2:45 pm    Post subject: Re: MySQL does not start after fresh emerge Reply with quote

do you have read the output of mySQL ebuild, at the end of emerge process?

emerge mysql --config
Back to top
View user's profile Send private message
daemonflower
Apprentice
Apprentice


Joined: 17 Jul 2004
Posts: 290

PostPosted: Sun Sep 17, 2006 2:56 pm    Post subject: Reply with quote

I hadn't read the MySQL Install Guide (hadn't found it), but what it says boils down to:
Code:
# emerge mysql
# emerge --config =dev-db/mysql-<your version here>
# /etc/init.d/mysql start
Which is exactly what I did.

At the end of the guide there is a mention of "eselect mysql". In my case, even if I rename the moved files back to their old (unversioned) names:
Code:
# eselect mysql list
Available MySQL versions:
  (none found)


EDIT: I unmerged and reemerged mysql, to start with a fresh install, and tried "emerge --config mysql" (without the version number) this time. Same thing.
Back to top
View user's profile Send private message
daemonflower
Apprentice
Apprentice


Joined: 17 Jul 2004
Posts: 290

PostPosted: Sun Sep 17, 2006 7:44 pm    Post subject: Reply with quote

I don't understand what I'm doing wrong. Surely I must do something wrong, or else bug reports would be all over the place. I've tried to emerge mysql 4.1.21 instead, with the same result. Then I removed everything remotely resembling old configs and databases, with still the same result.

I have come a little further now, with some manual work (but that is not how it is supposed to be).
Code:
cd /etc/
mv mysql mysql-500; sudo ln -s mysql-500 mysql
cd /var/lib
mv mysql mysql-500; sudo ln -s mysql-500 mysql
cd /usr/sbin
mv mysqld mysqld-500; sudo ln -s mysqld-500 mysqld
at least lets me start mysqld. Connecting to the server with the mysql command does not work yet, I'll have to change some more names, apparently:
Code:
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I'll work on it.

Btw, here's my /etc/conf.d/mysql:
Code:
mysql_slot_500=()
and my my.cnf:
Code:
[client]
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

[mysqld_safe]
err-log                                         = /var/log/mysql/mysql.err

[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

bind-address                            = 127.0.0.1

log-bin
server-id                                       = 1

tmpdir                                          = /tmp/
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_data_file_path = ibdata1:10M:autoextend:max:128M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
set-variable = innodb_log_files_in_group=2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet                      = 16M

[mysql]

[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
Except for removing the comments, I haven't touched either of them.

EDIT: an additional
Code:
cd /var/run/mysqld
sudo ln -s mysqld-500.pid mysqld.pid
sudo ln -s mysqld-500.sock mysqld.sock
seems to have solved the problem. I can now use mysql to connect.
Back to top
View user's profile Send private message
khantheripper
n00b
n00b


Joined: 21 Sep 2006
Posts: 4

PostPosted: Thu Sep 21, 2006 7:53 pm    Post subject: Me too. Reply with quote

Quote:
Surely I must do something wrong, or else bug reports would be all over the place.


I also just emerged version 4.1.2, and when I typed "mysql", I also got this message:

Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

_________________
"If you want it easy, get a Mac. If you want control and to save your money, get Linux. If you want it somewhere in between, and you don't mind viruses, get Windows."
Back to top
View user's profile Send private message
khantheripper
n00b
n00b


Joined: 21 Sep 2006
Posts: 4

PostPosted: Wed Sep 27, 2006 2:35 pm    Post subject: Solved for me Reply with quote

:D As it turns out, I just had to execute the following, to set the (MySQL) root password and start the server:
Code:
emerge --config =dev-db/mysql-4.1.19

Now the problem is solved for me.
_________________
"If you want it easy, get a Mac. If you want control and to save your money, get Linux. If you want it somewhere in between, and you don't mind viruses, get Windows."
Back to top
View user's profile Send private message
Muddy
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jan 2003
Posts: 144
Location: U.S.

PostPosted: Mon Oct 02, 2006 1:16 pm    Post subject: Reply with quote

I tried that and here is what I ended up with

Code:

Configuring pkg...

 * MySQL DATADIR is /var/lib/mysql
 * Previous datadir found, it's YOUR job to change
 * ownership and take care of it
 * Creating the mysql database and setting proper
 * permissions on it ...
 * Insert a password for the mysql 'root' user
 * Avoid ["'\_%] characters in the password
    >
 * Retype the password
    >

!!! ERROR: dev-db/mysql-4.1.21 failed.
Call stack:
  ebuild.sh, line 1527:   Called pkg_config
  ebuild.sh, line 1255:   Called mysql_pkg_config
  mysql.eclass, line 619:   Called die

!!! MySQL databases not installed
!!! If you need support, post the topmost build error, and the call stack if relevant.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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