Pagina 1 di 1
Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 11:41
da mitia64
Salve a tutti,
sto cercando di usare mysql ma ho alcuni problemi.
Premetto che sto cercando di usare mysql su slackware 13.1 (32bit) installato su un notebook Asus.
La versione di mysql e' gia' presente su Linux (infatti upgradepkg mysql-5.1.46...txz mi risponde che la versione del
software e' gia' installata).
Eseguo quindi i comandi :
- mysql_install_db che mi restituisce un warning su '--skip-locking' che risulta obsoleto ..
quindi mi chiede il inserire la password di root con il comando 'mysqladmin'
ma non da conferma di nulla
- eseguo il comando 'mysqladmin -u root password <mypwd>' che ritorna le
sequenti righe di errore :
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error : 'Cant connect to local MySQL server through socket '/var/run/mysql.sock' (2)'
Check that mysql is running and that the socket: '/VAR/RUN/MYSQL/MYSQL.SOCK' EXIST!
Qualcuno mi puo' aiutare.
Grazie
mitia
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 11:52
da Ansa89
Hai avviato il servizio "mysql"?
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 13:24
da mitia64
Grazie Ansa89.
Ho controllato ed in effetti il processo demone mysql non e' attivo (ps -ef | grep mysql).
HO provato quindi a farlo partire con il comando :
>mysql_safe&
quello che trovo nel file di log /val/lib/mysql<hostname>.err sono le seguenti righe :
mysql_safe Starting mysql daemon with database from /var/lib/mysql
[Warning] '--skip-locking' is deprecated and will be remove in a future release. Please use '--skip-external-loking' instead.
/usr/libexec/mysqld: File '.mysql-bin.index' not found (ErrCode: 13)
{ERROR] Aborting
{note] /usr/libexec/mysqld: Shutdown complete
mysql_safe mysqld from pid file /var/lib/mysql/|<hostname>.pid ended
Mi puoi aiutare.
Grazie
mitia
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 13:59
da Ansa89
Perché usi "mysql_safe" invece dell'apposito script "/etc/rc.d/rc.mysqld"?
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 14:19
da mitia64
Ciao Ansa89.
Ho disinstallato mysql con il comando
>removepkg -keep mysql-5.1.46-i486-2.txz
ho installato nuovamente mysql con il comando
>upgradepkg --install-new mysql-5.1.46-i486-2.txz
- ho controllato la presenza di tutti i package
(dal sito
http://pkgs.org/slackware-13.1/slackwar ... html#howto)
- ho ricercato il comando rc.mysqld nella directory /etc/rc.d (non era eseguibile --> chmod +x /etc/rc.d/rc.mysqld)
- ho eseguito il comando /etc/rc.d/rc.mysqld start
nel file di log ottendo esattamente gli stessi errori riportati precedentemente.
Grazie
mitia
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 14:22
da tgmx
Dal file /etc/rc.d/rc.mysqld :
Codice: Seleziona tutto
....
....
# To start MySQL automatically at boot, be sure this script is executable:
# chmod 755 /etc/rc.d/rc.mysqld
# Before you can run MySQL, you must have a database. To install an initial
# database, do this as root:
#
# mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user. This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
#
# To increase system security, consider using "mysql_secure_installation"
# as well. For more information on this tool, please read:
# man mysql_secure_installation
# To allow outside connections to the database comment out the next line.
# If you don't need incoming network connections, then leave the line
# uncommented to improve system security.
#SKIP="--skip-networking"
....
....
Re: Problemi con l'utilizzo di MySQL
Inviato: gio 23 ago 2012, 14:44
da mitia64
Grazie tgmx e Ansa89.
Ho trovato la soluzione al link
http://accadielle.it/soluzioni/archives ... de-13.html
problema di owner/gruppo delle directory /var/lib/mysql e /var/run/mysql
sono bastati i due comandi :
>chown -R mysql:mysql /var/lib/mysql
>chown -R mysql:mysql /var/run/mysql
e il comando /etc/rc.d/rc.mysqld start e partito correttamente.
Grazie a Tutti
Saluti
mitia