2

Sorry for my English;

I was trying to create db with rake in RoR application that has been configured for MySQL(gem installed, settings changed).
After that attempt mysql-server broke:
d@calister:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

mysqld is not running at all:
d@calister:~$ ps aux | grep mysql
d 3769 0.0 0.0 4368 832 pts/0 S+ 18:03 0:00 grep --color=auto mysql

And also it doesn't seem it would like to run:
d@calister:~$ sudo service mysql start
start: Job failed to start

Any suggestions?
Thanks

EDIT:

d@calister:~$ sudo -u mysql mysqld
120520 18:45:11 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
120520 18:45:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
120520 18:45:11 InnoDB: The InnoDB memory heap is disabled
120520 18:45:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120520 18:45:11 InnoDB: Compressed tables use zlib 1.2.3.4
120520 18:45:11 InnoDB: Initializing buffer pool, size = 128.0M
120520 18:45:11 InnoDB: Completed initialization of buffer pool
120520 18:45:11 InnoDB: highest supported file format is Barracuda.
120520 18:45:12  InnoDB: Waiting for the background threads to start
120520 18:45:13 InnoDB: 1.1.8 started; log sequence number 1589459
120520 18:45:13 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
9
  • related question -> askubuntu.com/questions/69380/…
    – hhlp
    May 20, 2012 at 15:19
  • first, just try sudo service mysql start or sudo service mysql restart, if this doesn' work, let's investigate further :P
    – vicd
    May 20, 2012 at 15:20
  • @hhlp, mysqld is not running in my case. Besides, grep socket /etc/my.cnf -> grep: /etc/my.cnf: No such file or directory
    – ted
    May 20, 2012 at 15:23
  • @vicd, ...start... is already in my post.
    – ted
    May 20, 2012 at 15:25
  • em, any thing wrong in your /var/log/mysql.log? try to post it out.
    – vicd
    May 20, 2012 at 15:52

1 Answer 1

2

try this command vi /etc/mysql/my.cnf and check your mysql configure file is well written, I mean make sure no port conflict or spelling errors.

if you're not sure how to configure it well, just reset it to the default.

HERE IS THE DEFAULT FILE, JUST FOR REFERENCE!!!!

[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock


[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]

user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

bind-address        = 127.0.0.1

key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8

myisam-recover         = BACKUP

query_cache_limit   = 1M
query_cache_size        = 16M


expire_logs_days    = 10
max_binlog_size         = 100M

[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[mysql]


[isamchk]
key_buffer      = 16M

!includedir /etc/mysql/conf.d/
6
  • i just remove all comment in conf file to save the post space, just have a try to see if there's a configuration issue in your case.
    – vicd
    May 20, 2012 at 16:25
  • Haven't checked my.cnf for errors, i may upload it for you. But I assume everything is fine there. The thing i miss -- mysql.host table.
    – ted
    May 20, 2012 at 16:35
  • trying to upgrade it returned -- no mysql.host table found. Having no idea how to restore it i've reinstalled mysql-server with no lost of existing dbs. As a result everything is working fine now. Thanks for your help.
    – ted
    May 20, 2012 at 16:56
  • ok, let's assume it's fine with your configuration file, but if you have time just have a try. from the logs you provided, you may lost a table "mysql.plugin", have you upgraded your mysql? the table "mysql.plugin" seems likely be newly added in mysql 5.1. If yes, just try mysqld --datadir=/var/data/ --user=mysql --skip-grant-tables to ignore table checking during start progress, to if this works? I got go, let's investigate it next day. Hope you're in lucky :D
    – vicd
    May 20, 2012 at 16:56
  • well, re-installation is like the Weapons of Mass Destruction, :P, anyway it works fine for you, but maybe it lacks some fun with investigation, :D
    – vicd
    May 20, 2012 at 17:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .