Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Mysql problem
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
Kaliroxx
n00b
n00b


Joined: 30 Sep 2012
Posts: 9

PostPosted: Tue Jul 30, 2013 7:07 pm    Post subject: Gentoo Mysql problem Reply with quote

Hi, I hope you can help me.

I had a lot of old files in the directory /var/lib/mysql/ so I decided to delete them this way:

/etc/init.d/mysql stop
/etc/init.d/apache2 stop
/etc/init.d/nginx stop

rm /var/lib/mysql/mysqld

/etc/init.d/mysql start
-> Mysql Not started (0)

chown mysql /var/lib/mysql
/etc/init.d/mysql start
-> System hangs

nano /var/log/mysql/mysqld.err
shows
Quote:

130730 20:48:55 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a mas$
InnoDB: The InnoDB memory heap is disabled
InnoDB: use atomic builtins.
130730 20:48:55 InnoDB: Started; log sequence number 0 43965
^G/usr/sbin/mysqld: File './mysqld-bin.000267' not found (Errcode: 2)
130730 20:48:55 [ERROR] Failed to open log (file './mysqld-bin.000267', errno 2)
130730 20:48:55 [ERROR] Could not open log file
130730 20:48:55 [ERROR] Can't init tc log
130730 20:48:55 [ERROR] Aborting

130730 20:48:55 InnoDB: Starting shutdown...
130730 20:48:56 InnoDB: Shutdown completed; log sequence number 0 43965
130730 20:48:56 [Note] /usr/sbin/mysqld: Shutdown complete


Can you help me?
Back to top
View user's profile Send private message
Kaliroxx
n00b
n00b


Joined: 30 Sep 2012
Posts: 9

PostPosted: Wed Jul 31, 2013 10:58 am    Post subject: Reply with quote

I found http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html

Quote:
If you delete all the logs in /var/log/mysql but leave the old mysql-bin.index pointing to them, mysqld will not start because it cannot find the last log file in the index.

Rename /var/log/mysql/mysql-bin.index to say mysql-bin.index.bak and retry and a new mysql-bin.index file and log file mysql-bin.000001 will be created.


Is this the right for me? If yes, how can I "retry and a new mysql-bin.index file" ?

Update: In the folder I just see
Quote:

mysql # ls -1
mysql.err
mysql.log
mysqld.err
Back to top
View user's profile Send private message
jnicol
n00b
n00b


Joined: 29 Jan 2003
Posts: 73
Location: Seattle, WA

PostPosted: Mon Aug 05, 2013 6:22 pm    Post subject: Reply with quote

ugh, does gentoo really keep binlogs in /var/log/mysql?

If you're trying to do a new clean installation, delete everything in /var/lib/mysql and /var/log/mysql. If mysql server is already installed, you may need to run /usr/bin/mysql_install_db before starting it.
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Mon Aug 05, 2013 9:11 pm    Post subject: Reply with quote

jnicol wrote:
ugh, does gentoo really keep binlogs in /var/log/mysql?

No, by default the bin logs go to /var/lib/mysql/

Kaliroxx wrote:
rm /var/lib/mysql/mysqld


I'm assuming you actually ran:

Code:
rm /var/lib/mysql/mysqld*


Kaliroxx wrote:
I found http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html

Quote:
If you delete all the logs in /var/log/mysql but leave the old mysql-bin.index pointing to them, mysqld will not start because it cannot find the last log file in the index.

Rename /var/log/mysql/mysql-bin.index to say mysql-bin.index.bak and retry and a new mysql-bin.index file and log file mysql-bin.000001 will be created.


Is this the right for me? If yes, how can I "retry and a new mysql-bin.index file" ?

Update: In the folder I just see
Quote:

mysql # ls -1
mysql.err
mysql.log
mysqld.err


That is nearly correct, except the bin logs are in /var/lib/mysql so if you follow the advice above but with /var/lib/mysql/mysql-bin.index instead of /var/log/mysql/mysql-bin.index.

If you don't want binary logging you should comment out the 'log-bin' line in your /etc/mysql/my.cnf
_________________
Search | Read | Answer | Report | Strip
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