Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I fix this and start mysql-server?

After /etc/init.d/mysql start or service mysql start I get the message start: "Job failed to start" And after # mysqld I get this:

mysqld
121123 11:33:33 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
121123 11:33:33 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Unknown error 1146
121123 11:33:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121123 11:33:33 InnoDB: The InnoDB memory heap is disabled
121123 11:33:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121123 11:33:33 InnoDB: Compressed tables use zlib 1.2.3.4
121123 11:33:33 InnoDB: Initializing buffer pool, size = 128.0M
121123 11:33:33 InnoDB: Completed initialization of buffer pool
121123 11:33:33 InnoDB: highest supported file format is Barracuda.
121123 11:33:33  InnoDB: Waiting for the background threads to start
121123 11:33:34 InnoDB: 1.1.8 started; log sequence number 1595675
121123 11:33:34 [ERROR] Aborting
121123 11:33:34  InnoDB: Starting shutdown...
121123 11:33:35  InnoDB: Shutdown completed; log sequence number 1595675
121123 11:33:35 [Note]

I try to do what mysql say me to do:

mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

And yes, /var/run/mysql is empty:

mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

And this is my file /etc/mysql/my.cnf

# cat /etc/mysql/my.cnf |grep sock
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket      = /var/run/mysqld/mysqld.sock
socket      = /var/run/mysqld/mysqld.sock
socket      = /var/run/mysqld/mysqld.sock

Then I try to reinstall mysql from cero:

  apt-get purge mysql-client mysql-common mysql-server
  rm -R /var/lib/mysql
  rm -R /etc/mysql
  rm -R /var/run/mysqld
  userdel mysql
  apt-get install mysql-server mysql-client

Then, after typing my root password for mysql I get this error:

 | Unable to set password for the MySQL "root" user                              │  
 │                                                                               │  
 │ An error occurred while setting the password for the MySQL administrative     │  
 │ user. This may have happened because the account already has a password, or   │  
 │ because of a communication problem with the MySQL server.                     │  
 │                                                                               │  
 │ You should check the account's password after the package installation.       │  
 │                                                                               │  
 │ Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more   │  
 │ information.

And again I can't start mysql getting the same messages.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Probably you're running into a circular dependency of MySQL not being able to start and running the Debian configuration scripts in an attempt to fix that requires MySQL to be running.

Try to re-initialize your data directory 'offline' using mysql_install_db.

share|improve this answer
    
I GOT IT. I tried mysql_install_db --basedir /etc/mysql and I get Could not find errmsg.sys Then I decide to copy from other linux machine this file (and some others that where missed): scp /usr/share/mysql/english/* root@machine:/usr/share/mysql/english scp /usr/share/mysql/*.sql root@machine:/usr/share/mysql/ And when I run once more: ´mysql_install_db --basedir /etc/mysql´ I got: Filling help tables... OK Then I run: mysql_safe And it worked (everything as root, ofc) –  Freefri Nov 23 '12 at 14:44
    
@Freefri If those files were actually missing, then I guess something is wrong with the packages or something prevented proper installation of the mysql-server-core-5.1 package. Those were regular Debian packages from the main repository? –  gertvdijk Nov 23 '12 at 14:47
    
I've intall mysql-server that I think it installs mysql-server-core-5.5 from Ubuntu's 12.10 repository. Somthing went wrong in the installation and it didn't finish properly. The installation returned an error –  Freefri Nov 23 '12 at 15:06
add comment

First of all you should not have 3 socket files in your my.cnf

try the following:

dpkg-reconfigure mysql-server

You will be asked(promped) to set a password for the root user. Good luck

share|improve this answer
    
dpkg-reconfigure mysql-server won't help as that requires MySQL to be running. See the error in the question. –  gertvdijk Nov 23 '12 at 11:07
    
with dpkg-reconfigure mysql-server I get mysql-server broken package. Remember that my installation failed (An error occurred while setting the password for the MySQL administrative) –  Freefri Nov 23 '12 at 13:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.