Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 15
  1. #1

    Accedere al database dall'esterno

    ciao,

    ho installato su un server (non un hosting) apache, mysql, phpmyadmin etc.
    ho caricato le pagine web che ho creato in locale ma sul server non girano quando si tratta di interagine con il db, infatti ricevo il messaggio (che ho impostato) che non riesce ad eseguire la query.
    Ho dato le impostazioni nel file di configurazione relative al server, in particolare il $Db["server"] = "ip_del_server";
    invece di localhost ma non funziona.
    Credo che apache o mysql va configurato per essere accessibile dall'esterno, qualcunos a dirmi cosa devo configurare?
    grazie.
    PeppePegasus

  2. #2

  3. #3
    ciao,

    ho seguito la guida nel modificare il file di config, mentre per i permessi ho utilizzato phpmyadmin.
    però credo che il problema sia lo stop e il riavvio, infatti se do i comandi:

    codice:
    recsyserver@recsyserver:/$ /etc/init.d/mysql stop
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql stop
    
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) utility, e.g. stop mysql
    stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.489" (uid=1000 pid=14888 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    
    recsyserver@recsyserver:/$ /etc/init.d/mysql restart
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql restart
    
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) and then start(8) utilities,
    e.g. stop mysql ; start mysql. The restart(8) utility is also available.
    stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.493" (uid=1000 pid=14900 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    forse non avviene lo stop e il riavvio e quindi non mi prende le modifiche!
    suggerimenti?
    grazie.
    PeppePegasus

  4. #4
    ubuntu usa "upstart" quindi :


    sudo service mysql stop

    sudo service mysql restart

  5. #5
    ciao,

    ho provato come dici:

    recsyserver@recsyserver:~$ sudo service mysql stop
    [sudo] password for recsyserver:
    stop: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

    e poi

    recsyserver@recsyserver:~$ sudo service mysql restart
    stop: Unknown job: mysql
    start: Unknown job: mysql

    ma mi pare non abbia fermato e riavviato nulla.
    infatti la situazione non cambia!
    grazie.
    PeppePegasus

  6. #6
    - su che sistema sei?

    - la rete funziona?

    - che pacchetti mysql hai? dpkg -l | grep mysql

    - hai i pacchetti aggiornati?

    - vedi se gira? ps aux|grep mysql





    p.s.
    simile
    http://ubuntuforums.org/archive/inde...t-1514195.html

  7. #7
    ciao,

    rispondo alle tue domande. Il sistema è:
    Linux version 3.2.0-40-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #64-Ubuntu SMP Mon Mar 25 21:22:10 UTC 2013

    la rete funziona, si tratta di un server remoto (no hosting)

    pacchetti installati:
    ii libdbd-mysql-perl 4.020-1build2 Perl5 database interface to the MySQL database
    ii libmysqlclient18 5.5.31-0ubuntu0.12.04.1 MySQL database client library
    ii mysql-client 5.5.31-0ubuntu0.12.04.1 MySQL database client (metapackage depending on the latest version)
    ii mysql-client-5.5 5.5.31-0ubuntu0.12.04.1 MySQL database client binaries
    ii mysql-client-core-5.5 5.5.29-0ubuntu0.12.04.2 MySQL database core client binaries
    ii mysql-common 5.5.31-0ubuntu0.12.04.1 MySQL database common files, e.g. /etc/mysql/my.cnf
    rc mysql-navigator 1.4.2-14 GUI client program for MySQL database server
    ii mysql-server 5.5.31-0ubuntu0.12.04.1 MySQL database server (metapackage depending on the latest version)
    ii mysql-server-5.5 5.5.31-0ubuntu0.12.04.1 MySQL database server binaries and system database setup
    ii mysql-server-core-5.5 5.5.31-0ubuntu0.12.04.1 MySQL database server binaries
    ii mysql-workbench-data 5.2.38+dfsg-3 MySQL Workbench -- architecture independent data
    ii php5-mysql 5.3.10-1ubuntu3.6 MySQL module for php5
    ii python-mysql.connector 0.3.2-1 pure Python implementation of MySQL Client/Server protocol

    se gira

    1000 6134 0.0 0.0 149672 6712 pts/4 T May11 0:00 gksudo vi /etc/mysql/my.cnf
    root 6135 0.0 0.0 62192 1936 ? Ss May11 0:00 /usr/bin/sudo -H -S -p GNOME_SUDO_PASS -u root -- vi /etc/mysql/my.cnf
    root 6136 0.0 0.0 27204 1684 ? S May11 0:00 vi /etc/mysql/my.cnf
    1000 6148 0.0 0.0 149672 6716 pts/4 T May11 0:00 gksudo vi /etc/mysql/my.cnf
    root 6149 0.0 0.0 62192 1936 ? Ss May11 0:00 /usr/bin/sudo -H -S -p GNOME_SUDO_PASS -u root -- vi /etc/mysql/my.cnf
    root 6150 0.0 0.0 27144 1788 ? S May11 0:00 vi /etc/mysql/my.cnf
    1000 18518 0.0 0.0 13640 912 pts/7 S+ 22:22 0:00 grep --color=auto mysql
    1000 28567 0.0 0.0 16552 1380 ? S May07 0:00 /bin/bash /usr/lib/mysql-workbench/bin/mysql-workbench
    1000 28569 0.0 0.0 4400 616 ? S May07 0:00 /bin/sh /usr/bin/catchsegv /usr/lib/mysql-workbench/bin/mysql-workbench-bin
    1000 28571 0.0 0.1 456484 61384 ? SL May07 1:53 /usr/lib/mysql-workbench/bin/mysql-workbench-bin
    cataldo 30763 0.3 0.0 10170984 0 ? Sl Apr26 113:52 /usr/lib/jvm/default-java/bin/java -Dfile.encoding=UTF-8 -classpath /home/cataldo/NetBeansProjects/eVSM/lib/derbyclient.jar:/home/cataldo/NetBeansProjects/eVSM/lib/log4j-1.2.15.jar:/home/cataldo/NetBeansProjects/eVSM/lib/lucene-core-3.0.3.jar:/home/cataldo/NetBeansProjects/eVSM/lib/lucene-demos-3.0.3.jar:/home/cataldo/NetBeansProjects/eVSM/lib/mysql-connector-java-5.1.13-bin.jar:/home/cataldo/NetBeansProjects/eVSM/build/classes it.uniba.di.swap.eVSM.context.experiment.Main

    si è aggiunto un nuovo problema: non riesco ad accedere da phphmyadmin come utente root e se provo a farlo da riga di comando ricevo l'errore:

    mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    è un vero casino..spero mi potete aiutare ad uscirne.
    grazie.
    ciao
    PeppePegasus

  8. #8
    provato con le soluzioni dei link?

    primo errore:
    renamed /etc/init.d/mysql.conf to /etc/init.d/mysql.conf.bak
    and then reran apt-get upgrade


    secondo errore:


    tra i processi ne vedo doppi

    che guida hai seguito?
    http://wiki.ubuntu-it.org/Server/MySql

  9. #9
    ciao,

    ho seguito il link segnalato ma mi pare di capire che il problema è stato risolto reinstallando mysql. non posso disinstallare e reinstallare perchè ci sono altri database non miei!
    Per quanto detto nella pagina:
    http://howterrorisminindia.blogspot...t-to-local.html
    se do il comando
    ps aux | grep mysqld
    1000 21965 0.0 0.0 13636 916 pts/2 S+ 10:35 0:00 grep --color=auto mysqld
    che non mi sembra abbia nulla a che fare con quanto descritto.
    Per la configurazione dall'esterno si ho seguito la guida di ubuntu che hai citato.
    Ah mi sono ricordado che settando i permessi da phpmyadmin ho impostato come ip quello del server mentre dovevo mettere *.*.*.* per far accettare tutte le connessioni, può essere questo il problema?
    grazie.
    PeppePegasus

  10. #10
    ciao,

    ho risolto! ho reimpostato nel file my.conf il bind-adress 127.0.0.0, riavviato e alemno riesco ad entrare in phpmyadmin.
    Quando apro una pagina che cerca di interagire con il database però mi da errore nell'eseguire la query e ho avuto modo di appurare che non viene selezionato il database (No database selected) nonostante i dati siano esistenti e la stessa configurazione in locale funziona, c'è qualche problema di configurazione ma non so dove. I dati di accesso al database sono configurati così:

    Codice PHP:
    $Db["usr"] = "root";
    $Db["pwd"] = "mypwd"// server
    $Db["name"] = "dbname";
    $Db["server"] = "localhost"//server oppure l'ip del server NON funziona 
    grazie.
    PeppePegasus

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.