[Risolto] Impossibile avviare Mysql server

Salve ragazzi sto provando a metter su un server LAMP. Ho provato a installare mysql seguendo la guida del wiki ma al momento di avviare il server ottengo il seguente errore

luca@localhost etc$ sudo systemctl start mysqld.service Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.

Vado a controllare

luca@localhost etc$ systemctl status mysqld.service
mysqld.service - MySQL database server
          Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
          Active: failed (Result: exit-code) since dom 2013-05-05 23:13:47 CEST; 35s ago
         Process: 6701 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE)
         Process: 6700 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
         Process: 6675 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n (code=exited, status=0/SUCCESS)

Per finire provo a impostare la password di root del server e mi becco un bel

luca@localhost etc$ mysql -p root
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Praticamente quest’errore riappare ogni volta che tento di interagione con un tool di mysql. In rete ce ne sono a bizzeffe di questi errori ma in genere riguardavano persone che avevano un file /etc/my.conf personalizzato, a me non c’è proprio, come il file mysql.sock; quest’ultimo ho provato a rimpiazzarlo con un file fittizzio ma non ha funzionato, l’errore era uguale con un 113 al posto del 2.

Qulache idea?

Il mysql.sock è solo di “servizio”, non creare dei file in quella directory. Ci fai vedere:

$ rpm -qa | grep mysql

Hai settato la password di amministratore per mysql?

Ma per configurare la password di admin “root”, hai utilizzato il comando mysqladmin con questa sintassi?

 mysqladmin -u <utente> -p  password <password>

In più potresti postare il contenuto del file /var/log/mysqld.log, che ci può fornire dettagli in più sul tuo problema?

Si ho provato a impostare la password come dici tu. Ecco:

luca@localhost ~$ rpm -qa | grep mysql
php-mysql-5.4.14-1.fc18.x86_64
mysql-libs-5.5.31-1.fc18.x86_64
mysql-server-5.5.31-1.fc18.x86_64
qt-mysql-4.8.4-14.fc18.x86_64
mysql-5.5.31-1.fc18.x86_64
akonadi-mysql-1.9.1-1.fc18.x86_64
mysql-embedded-5.5.31-1.fc18.x86_64

Il file mysqld.log è vuoto, il contenuto è in mysqld.log.rpmsave, probabilmente dopo i vari tentativi di reinstallazione avrà salvato la i log precedenti

luca@localhost log$ sudo cat mysqld.log.rpmsave 
130505 22:47:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130505 22:47:11 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130505 22:47:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130505 22:47:11 InnoDB: The InnoDB memory heap is disabled
130505 22:47:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130505 22:47:11 InnoDB: Compressed tables use zlib 1.2.7
130505 22:47:11 InnoDB: Using Linux native AIO
130505 22:47:11 InnoDB: Initializing buffer pool, size = 128.0M
130505 22:47:11 InnoDB: Completed initialization of buffer pool
130505 22:47:11 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 48941
130505 22:47:11  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1595675
130505 22:47:11  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 
InnoDB: Apply batch completed
130505 22:47:11  InnoDB: Waiting for the background threads to start
130505 22:47:12 InnoDB: 5.5.31 started; log sequence number 1595675
130505 22:47:12 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130505 22:47:12 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130505 22:47:12 [Note] Server socket created on IP: '0.0.0.0'.
130505 22:47:12 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130505 22:47:12 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130505 22:47:12 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Cosa strana: ora non trova il servizio mysql quando provo ad avviarlo da systemctl. Eppure il pacchetto è installato.

Vi ringrazio

Ciao

Non trova alcune tabelle myisam del database mysql… puoi postare il contenuto della file /etc/my.cnf e il contenuto della directory /var/lib/mysql.

Il database sembra che tenti di importate un db copiato a mano da un precedente database.

Il servizio non è mysql ma mysqld se non erro.

luca@localhost mysql$ls 
ibdata1  ib_logfile0  ib_logfile1  localhost.localdomain.err  mysql  performance_schema  test  

Il file my.cnf non c’è. Comunque hai ragione è mysqld anche se non lo suggerisce.

Mi risulta strano che non sia presente il file /etc/my.cnf perché dovrebbe essere stato installato con il pacchetto mysql-libs. Secondo me durante la fase di installazione è mancato il lancio dello comando “mysql_install_db”, che ti dovrebbe generare l’alberatura iniziale.

Se vuoi provare e noi hai database importati all’interno della tua installa mysql i seguenti comandi.

# systemctl stop mysqld.service
# mysql_install_db --user=mysql
# systemctl start mysqld.service
# systemctl status mysqld.service
# mysqladmin -u root password <pwd>
# mysql -u root -p
# systemctl enable mysqld.service

Io ho avuto lo stesso problema dopo un aggiornamento e ho risolto aggiungendo (creando) il file /etc/hostname sul quale ho scritto “localhost” come specificato http://forums.fedoraforum.org/showthread.php?t=286956.
Viene anche suggerito di modificare il file /etc/httpd/conf/httpd.conf ma non è stato necessario nel mio caso.
Spero che il problema sia lo stesso.

Per le modifiche dell’hostname delle ultime versioni di fedora anzichè creare il file manualmente /etc/hostname, conviene sfruttare il comando hostnamectl, che permette di demandare al sistema operativo la modifica dei file (potrebbero essercene degli altri).

Per modificare l’hostname bastano i seguenti comandi:

# hostnamectl set-hostname <hostname>
# hostnamectl status

Cello ricevo un errore nell’installare il db

[root@localhost luca]# mysql_install_db --user=mysql
Installing MySQL system tables...
130508 10:44:17 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
130508 10:44:17 [ERROR] Aborting

130508 10:44:17 [Note] 

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/libexec/mysqld --skip-grant &

and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.
                                                                                  
Please consult the MySQL manual section                                           
'Problems running mysql_install_db', and the manual section that                  
describes problems on your OS.  Another information source are the                
MySQL email archives available at http://lists.mysql.com/.                        
                                                                                  
Please check all of the above before mailing us!  And remember, if                
you do mail us, you MUST use the /usr/bin/mysqlbug script!                        
                                                                                  [/code] 


Ho controllato in quella cartella ci trovo questa roba:
[code] [root@localhost mysql]# ls
ibdata1      localhost.localdomain                           mysql
ib_logfile0  localhost.localdomain?"127.0.0.1?localhost.err  performance_schema
ib_logfile1  localhost.localdomain.err                       test

Da notare quel file con un nome assurdo.

Flogger ho controllato tutti i file e le modifiche proposte ci sono già, tranne quella del servername in httpd.conf che ho aggiunto dopo ma non ha cambiato niente.

edit penso di aver capito il problema…

edit bis Si era creato un problema con httpd, dopo qualche modifica avevo impostato male il nome dell’host e quindi non partiva ma ora ho risolto. Comunque mysql continua a non partire anche se provo a installare da il db da root il processo va a buon termine

[root@localhost httpd]# mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

Il problema è che quando provo a settare la password mi da il solito problema:

[root@localhost httpd]# /usr/bin/mysql_secure_installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Se il server non è su, non puoi cambiare la password.

Qualcosa non va, dai log risulta che non riesce a trovare vari file come host.frm, plugin.frm che in realtà esistono e stanno in /var/lib/mysql/mysql

luca@localhost log$ sudo cat mysqld.log
130508 11:04:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 11:04:50 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 11:04:50 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:04:50 InnoDB: The InnoDB memory heap is disabled
130508 11:04:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:04:50 InnoDB: Compressed tables use zlib 1.2.7
130508 11:04:50 InnoDB: Using Linux native AIO
130508 11:04:50 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:04:50 InnoDB: Completed initialization of buffer pool
130508 11:04:50 InnoDB: highest supported file format is Barracuda.
130508 11:04:51  InnoDB: Waiting for the background threads to start
130508 11:04:52 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:04:52 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:04:52 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:04:52 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:04:52 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:04:52 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:04:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130508 11:05:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql                                                                                   
130508 11:05:51 [Note] Plugin 'FEDERATED' is disabled.                                                                                                                  
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)                                                                                                  
130508 11:05:51 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:05:51 InnoDB: The InnoDB memory heap is disabled
130508 11:05:51 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:05:51 InnoDB: Compressed tables use zlib 1.2.7
130508 11:05:51 InnoDB: Using Linux native AIO
130508 11:05:51 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:05:51 InnoDB: Completed initialization of buffer pool
130508 11:05:51 InnoDB: highest supported file format is Barracuda.
130508 11:05:51  InnoDB: Waiting for the background threads to start
130508 11:05:52 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:05:52 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:05:52 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:05:52 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:05:52 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:05:52 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:05:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130508 11:05:58 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 11:05:58 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 11:05:58 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:05:58 InnoDB: The InnoDB memory heap is disabled
130508 11:05:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:05:58 InnoDB: Compressed tables use zlib 1.2.7
130508 11:05:58 InnoDB: Using Linux native AIO
130508 11:05:58 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:05:58 InnoDB: Completed initialization of buffer pool
130508 11:05:58 InnoDB: highest supported file format is Barracuda.
130508 11:05:58  InnoDB: Waiting for the background threads to start
130508 11:05:59 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:05:59 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:06:00 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:06:00 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:06:00 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:06:00 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:06:00 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130508 11:06:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 11:06:03 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 11:06:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:06:03 InnoDB: The InnoDB memory heap is disabled
130508 11:06:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:06:03 InnoDB: Compressed tables use zlib 1.2.7
130508 11:06:03 InnoDB: Using Linux native AIO
130508 11:06:03 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:06:03 InnoDB: Completed initialization of buffer pool
130508 11:06:03 InnoDB: highest supported file format is Barracuda.
130508 11:06:04  InnoDB: Waiting for the background threads to start
130508 11:06:05 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:06:05 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:06:05 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:06:05 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:06:05 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:06:05 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:06:05 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130508 11:22:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 11:22:45 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 11:22:45 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:22:45 InnoDB: The InnoDB memory heap is disabled
130508 11:22:45 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:22:45 InnoDB: Compressed tables use zlib 1.2.7
130508 11:22:45 InnoDB: Using Linux native AIO
130508 11:22:45 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:22:45 InnoDB: Completed initialization of buffer pool
130508 11:22:45 InnoDB: highest supported file format is Barracuda.
130508 11:22:45  InnoDB: Waiting for the background threads to start
130508 11:22:46 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:22:46 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:22:46 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:22:46 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:22:46 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:22:46 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:22:46 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130508 11:43:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 11:43:13 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 11:43:13 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 11:43:13 InnoDB: The InnoDB memory heap is disabled
130508 11:43:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 11:43:13 InnoDB: Compressed tables use zlib 1.2.7
130508 11:43:13 InnoDB: Using Linux native AIO
130508 11:43:13 InnoDB: Initializing buffer pool, size = 128.0M
130508 11:43:13 InnoDB: Completed initialization of buffer pool
130508 11:43:13 InnoDB: highest supported file format is Barracuda.
130508 11:43:13  InnoDB: Waiting for the background threads to start
130508 11:43:14 InnoDB: 5.5.31 started; log sequence number 1595675
130508 11:43:14 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 11:43:14 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 11:43:14 [Note] Server socket created on IP: '0.0.0.0'.
130508 11:43:14 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:43:14 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 11:43:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Non è che non ha i permessi di accedervi? Devo garantire qualche permesso particolare all’utente mysql?

Usa path molto strani per richiamare i file. Ti chiedo se puoi girarmi questi due comandi:

# ps -ef | grep mysql
# rpm -ql `rpm -qa | grep mysql-libs`

Ecco

[root@localhost luca]# ps -ef | grep mysql
root      1820  1765  0 14:57 pts/1    00:00:00 grep --color=auto mysql

[root@localhost luca]# rpm -ql 'rpm -qa | grep mysql-libs'
il pacchetto rpm -qa | grep mysql-libs non è stato installato
[root@localhost luca]# rpm -ql `rpm -qa | grep mysql-libs`
/etc/ld.so.conf.d/mysql-x86_64.conf
/etc/my.cnf
/usr/lib64/mysql
/usr/lib64/mysql/libmysqlclient.so.18
/usr/lib64/mysql/libmysqlclient.so.18.0.0
/usr/share/doc/mysql-libs-5.5.31
/usr/share/doc/mysql-libs-5.5.31/COPYING
/usr/share/doc/mysql-libs-5.5.31/README
/usr/share/doc/mysql-libs-5.5.31/README.mysql-license
/usr/share/mysql
/usr/share/mysql/charsets
/usr/share/mysql/charsets/Index.xml
/usr/share/mysql/charsets/README
/usr/share/mysql/charsets/armscii8.xml
/usr/share/mysql/charsets/ascii.xml
/usr/share/mysql/charsets/cp1250.xml
/usr/share/mysql/charsets/cp1251.xml
/usr/share/mysql/charsets/cp1256.xml
/usr/share/mysql/charsets/cp1257.xml
/usr/share/mysql/charsets/cp850.xml
/usr/share/mysql/charsets/cp852.xml
/usr/share/mysql/charsets/cp866.xml
/usr/share/mysql/charsets/dec8.xml
/usr/share/mysql/charsets/geostd8.xml
/usr/share/mysql/charsets/greek.xml
/usr/share/mysql/charsets/hebrew.xml
/usr/share/mysql/charsets/hp8.xml
/usr/share/mysql/charsets/keybcs2.xml
/usr/share/mysql/charsets/koi8r.xml
/usr/share/mysql/charsets/koi8u.xml
/usr/share/mysql/charsets/latin1.xml
/usr/share/mysql/charsets/latin2.xml                                                                                                                                    
/usr/share/mysql/charsets/latin5.xml                                                                                                                                    
/usr/share/mysql/charsets/latin7.xml                                                                                                                                    
/usr/share/mysql/charsets/macce.xml
/usr/share/mysql/charsets/macroman.xml
/usr/share/mysql/charsets/swe7.xml
/usr/share/mysql/czech
/usr/share/mysql/czech/errmsg.sys
/usr/share/mysql/danish
/usr/share/mysql/danish/errmsg.sys
/usr/share/mysql/dutch
/usr/share/mysql/dutch/errmsg.sys
/usr/share/mysql/english
/usr/share/mysql/english/errmsg.sys
/usr/share/mysql/estonian
/usr/share/mysql/estonian/errmsg.sys
/usr/share/mysql/french
/usr/share/mysql/french/errmsg.sys
/usr/share/mysql/german
/usr/share/mysql/german/errmsg.sys
/usr/share/mysql/greek
/usr/share/mysql/greek/errmsg.sys
/usr/share/mysql/hungarian
/usr/share/mysql/hungarian/errmsg.sys
/usr/share/mysql/italian
/usr/share/mysql/italian/errmsg.sys
/usr/share/mysql/japanese
/usr/share/mysql/japanese/errmsg.sys
/usr/share/mysql/korean
/usr/share/mysql/korean/errmsg.sys
/usr/share/mysql/norwegian
/usr/share/mysql/norwegian-ny
/usr/share/mysql/norwegian-ny/errmsg.sys
/usr/share/mysql/norwegian/errmsg.sys
/usr/share/mysql/polish
/usr/share/mysql/polish/errmsg.sys
/usr/share/mysql/portuguese
/usr/share/mysql/portuguese/errmsg.sys
/usr/share/mysql/romanian
/usr/share/mysql/romanian/errmsg.sys
/usr/share/mysql/russian
/usr/share/mysql/russian/errmsg.sys
/usr/share/mysql/serbian
/usr/share/mysql/serbian/errmsg.sys
/usr/share/mysql/slovak
/usr/share/mysql/slovak/errmsg.sys
/usr/share/mysql/spanish
/usr/share/mysql/spanish/errmsg.sys
/usr/share/mysql/swedish
/usr/share/mysql/swedish/errmsg.sys
/usr/share/mysql/ukrainian
/usr/share/mysql/ukrainian/errmsg.sys
[root@localhost luca]# 

Il file /etc/my.cnf imposta i vari path come la basedir dove quindi trovare i database che danno errore.

E’ possibile provare a verificare e nel caso provare a crearlo manualmente con questo contenuto? Se il file esiste fare un backup in my.cnf.orig!!!

# vim /etc/my.cnf 
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# systemctl start mysqld.service

Niente, non riesce ad avviare e da i log risulta questo

130508 17:49:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130508 17:49:50 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130508 17:49:50 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130508 17:49:50 InnoDB: The InnoDB memory heap is disabled
130508 17:49:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130508 17:49:50 InnoDB: Compressed tables use zlib 1.2.7
130508 17:49:50 InnoDB: Using Linux native AIO
130508 17:49:50 InnoDB: Initializing buffer pool, size = 128.0M
130508 17:49:50 InnoDB: Completed initialization of buffer pool
130508 17:49:50 InnoDB: highest supported file format is Barracuda.
130508 17:49:50  InnoDB: Waiting for the background threads to start
130508 17:49:51 InnoDB: 5.5.31 started; log sequence number 1595675
130508 17:49:51 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130508 17:49:51 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130508 17:49:51 [Note] Server socket created on IP: '0.0.0.0'.
130508 17:49:51 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130508 17:49:51 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130508 17:49:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

A questo punto prova a lanciare il comando mysql_upgrade, in modo da invocare i comandi di check ad autorepair de database.

# mysql_upgrade --verbose
luca@localhost ~$ sudo mysql_upgrade --verbose
[sudo] password for luca:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

Niente di nuovo. Tutt’al più provo con postgresql

Se proviamo reinstallando tutti i pacchetti mysql, avendo l’accortezza di rimuovere tutto il contenuto della dirrctory /var/lib/mysql?

Ma prima lancia questi ultimi comandi:

# chown -R mysql:mysql /var/lib/mysql
# systemctl start mysqld.service

Bingo! Era quello il problema, non aveva i permessi per accedervi. Ora funziona, ti ringrazio moltissimo per la pazienza!