Pagina de start a forumului Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc
Comunitatea PHP Romania
 

Conectare la MySQL pe alt server
Vezi mesajul original

 
       Pagina de start a forumului Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc -> Cod PHP
Subiectul anterior :: Subiectul următor  
Autor Mesaj
ovi2ut



Data înscrierii: 13/Sep/2002
Mesaje: 166
Locație: Middle of Nowhere

Trimis: Lun Mai 19, 2003 4:28 pm    Titlul subiectului: Conectare la MySQL pe alt server  

Cum pot sa ma conectez la o baza de date aflata pe alt server(adica serverul de mysql este diferit de cel de web) ?

Cand incerc sa ma conectez, apare eroarea

Host 'nume_host.ro' is not allowed to connect to this MySQL server

Este nevoie si de specificarea portului ?

Hostul poate fi dat ca adresa IP ?
Sus  
cristi



Data înscrierii: 26/Mai/2002
Mesaje: 270
Locație: Timisoara

Trimis: Lun Mai 19, 2003 9:02 pm    Titlul subiectului:  

http://www.mysql.com/doc/en/Access_denied.html

Citat: If you get the following error when you try to connect from a different host than the one on which the MySQL server is running, then there is no row in the user table that matches that host:
Host ... is not allowed to connect to this MySQL server
You can fix this by using the command-line tool mysql (on the server host!) to add a row to the user, db, or host table for the user/hostname combination from which you are trying to connect and then execute mysqladmin flush-privileges. If you are not running MySQL Version 3.22 and you don't know the IP number or hostname of the machine from which you are connecting, you should put an entry with '%' as the Host column value in the user table and restart mysqld with the --log option on the server machine. After trying to connect from the client machine, the information in the MySQL log will indicate how you really did connect. (Then replace the '%' in the user table entry with the actual hostname that shows up in the log. Otherwise, you'll have a system that is insecure.) Another reason for this error on Linux is that you are using a binary MySQL version that is compiled with a different glibc version than the one you are using. In this case you should either upgrade your OS/glibc or download the source MySQL version and compile this yourself. A source RPM is normally trivial to compile and install, so this isn't a big problem.
Sus  
ovi2ut



Data înscrierii: 13/Sep/2002
Mesaje: 166
Locație: Middle of Nowhere

Trimis: Mar Mai 20, 2003 8:04 am    Titlul subiectului:  

Am adaugat un nou user in baza de date, am trecut la host si adresa IP, si numele, am lasat si %, nu asta era problema.

De resetat serverul MySQL(cu mysqld --log) nu pot ...

Daca aveti alte idei cum as putea rezolva problema ...

(Versiunea de MySQL este 3.23.52 pe un server Solaris, iar PHP este 4.3 pe un IIS 5.1)
Sus  
Constantin



Data înscrierii: 20/Sep/2002
Mesaje: 236

Trimis: Mar Mai 20, 2003 11:02 am    Titlul subiectului:  

ovi2ut a scris: Am adaugat un nou user in baza de date, am trecut la host si adresa IP, si numele, am lasat si %, nu asta era problema.
Ai restartat serverul dupa modificarile astea?
Sus  
ovi2ut



Data înscrierii: 13/Sep/2002
Mesaje: 166
Locație: Middle of Nowhere

Trimis: Mar Mai 20, 2003 11:42 am    Titlul subiectului:  

Trebuie resetat serverul de MySQL dupa ce introduci un user nou ?
Sus  
Constantin



Data înscrierii: 20/Sep/2002
Mesaje: 236

Trimis: Mar Mai 20, 2003 11:52 am    Titlul subiectului:  

Depinde cum ai facut modificarile:

Din manualul de MySQL:
"When mysqld starts, all privileges are read into memory. Database, table, and column privileges take effect at once, and user-level privileges take effect the next time the user connects. Modifications to the grant tables that you perform using GRANT or REVOKE are noticed by the server immediately. If you modify the grant tables manually (using INSERT, UPDATE, etc.), you should execute a FLUSH PRIVILEGES statement or run mysqladmin flush-privileges to tell the server to reload the grant tables."
Sus  
ovi2ut



Data înscrierii: 13/Sep/2002
Mesaje: 166
Locație: Middle of Nowhere

Trimis: Mar Mai 20, 2003 1:09 pm    Titlul subiectului:  

Mersi mult, acum merge.
Sus  
PHPRomania Bot
Bot Member


Data înscrierii: 27/Dec/2007
Mesaje: 1
Locaţie: Server Google
Trimis: Mie Dec 26, 2007 7:01 pm   Titlul subiectului: Ad  

Sus  
 
       Pagina de start a forumului Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc -> Cod PHP
Pagina 1 din 1


Powered by phpBB 2.0.22 © 2001, 2002 phpBB Group
Varianta în limba română: Romanian phpBB online community