Jump to content
The Uniform Server Community
Sign in to follow this  
informa

¿Alguien me puede contestar en Español?

Recommended Posts

Perdon, pero mi inglés es malísimo.

Por eso agradeceria una contestación es Spanish.

He instalado el UniforServer, y el Apache me funciona perfectamente. Sin embargo, no consigo conectar con la Base de Datos.

Realizo la conexión así:

 

<?

$sql_host="localhost"; // Host

$sql_usuario="root"; // Usuario de Mysql, según la tabla "user" de mysql

$sql_pass="67457e226a15bd"; // contraseña de Mysql, según la tabla "user" de mysql

 

$sql_db="datos"; // Base de datos que se usará.

$sql_tabla="direcciones"; // Nombre de la tabla que contendrá los datos de los usuarios

 

$db_conexion= mysql_connect("$sql_host", "$sql_usuario", "$sql_pass") or die("No se pudo conectar a la Base de datos") or die(mysql_error());

mysql_select_db("$sql_db") or die(mysql_error());

?>

 

Me da un error, como que no se puede conectar a la Base de datos.

 

Si edito el htaccess, aparece lo siguiente:

-------------------------------------

# This file provides security to the server limiting access to the localhost only.

# Comment to deactivate.

 

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

 

# To disallow execution of cgi scripts in this directory comment next two lines.

 

AddHandler cgi-script .bat .exe .pl .cgi

Options +ExecCGI

 

# To unlock Admin Panel, comment the next 4 lines.

# Defaults: Username - admin; Password - userver

 

#AuthName "Uniform Server - Admin Panel 1.0 Alpha"

#AuthType Basic

#AuthUserFile /htpasswd/home/admin/www/.htpasswd

#Require valid-user

-----------------------------------------

 

Si intento conectar con :

 

<?

$sql_host="localhost"; // Host

$sql_usuario="Admin"; // Usuario de Mysql

$sql_pass="userver"; // contraseña de Mysql

 

$sql_db="datos"; // Base de datos que se usará.

$sql_tabla="user"; // Nombre de la tabla que contendrá los datos de los usuarios

 

$db_conexion= mysql_connect("$sql_host", "$sql_usuario", "$sql_pass") or die("No se pudo conectar a la Base de datos") or die(mysql_error());

mysql_select_db("$sql_db") or die(mysql_error());

?>

me sigue dando el mismo error.

 

¿Alguna ayuda?. Ya no sé como conectar con la base de datos.

Nota: Antes usaba EasyPHP y me funcionaba perfectamente.

Share this post


Link to post
Share on other sites

No como espanol....

 

Can you please try and use a free translanting tool as this computer does not have one....

 

Thanks so much.

 

Can anyone please help translate?

Share this post


Link to post
Share on other sites

I will try to translate:

I have installed the UniforServer, and the Apache works to me perfectly. Nevertheless, with himself not to connect with Base de Datos.

I make the connection thus:

 

<?

$sql_host="localhost"; // Host

$sql_usuario="root"; // Usuario de Mysql, según la tabla "user" de mysql

$sql_pass="67457e226a15bd"; // contraseña de Mysql, según la tabla "user" de mysql

 

$sql_db="datos"; // Base de datos que se usará.

$sql_tabla="direcciones"; // Nombre de la tabla que contendrá los datos de los usuarios

 

$link = mysql_connect($sql_host, $sql_usuario,$sql_pass) or die("It was not possible to be connected to Base of data") or die(mysql_error());

mysql_select_db($sql_db, $link) or die(mysql_error());

?>

 

It gives an error me, because it is not possible to be connected to Base of data:

 

"Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in W:\www\entrar.php on line 21

It was not possible to be connected to Base of data"

 

--------------------------------------------------------

 

If I publish htaccess, appears the following thing:

 

# This file provides security to the server limiting access to the localhost only.

# Comment to deactivate.

 

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

 

# To disallow execution of cgi scripts in this directory comment next two lines.

 

AddHandler cgi-script .bat .exe .pl .cgi

Options +ExecCGI

 

# To unlock Admin Panel, comment the next 4 lines.

# Defaults: Username - admin; Password - userver

 

#AuthName "Uniform Server - Admin Panel 1.0 Alpha"

#AuthType Basic

#AuthUserFile /htpasswd/home/admin/www/.htpasswd

#Require valid-user

-----------------------------------------

 

If I make this connection, also it gives error me:

 

<?

$sql_host="localhost"; // Host

$sql_usuario="Admin"; // Usuario de Mysql

$sql_pass="userver"; // contraseña de Mysql

 

$sql_db="datos"; // Base de datos que se usará.

$sql_tabla="user"; // Nombre de la tabla que contendrá los datos de los usuarios

 

connect with Base de Datos.

I make the connection thus:

 

<?

$sql_host="localhost"; // Host

$sql_usuario="root"; // Usuario de Mysql, según la tabla "user" de mysql

$sql_pass="67457e226a15bd"; // contraseña de Mysql, según la tabla "user" de mysql

 

$sql_db="datos"; // Base de datos que se usará.

$sql_tabla="direcciones"; // Nombre de la tabla que contendrá los datos de los usuarios

 

$link = mysql_connect($sql_host, $sql_usuario,$sql_pass) or die("No se pudo conectar a la Base de datos") or die(mysql_error());

mysql_select_db($sql_db, $link) or die(mysql_error());

?>

 

!Help!. No longer I know as to connect with the data base.

Note: Before EasyPHP used and it worked to me perfectly.

Share this post


Link to post
Share on other sites

Have you started mySQL? (I don't know about other WAMP distributions, but by default, Uniform Server doesn't start mySQL when you click on Server_Start.bat)

 

If you have, maybe you should try using "127.0.0.1" instead of "localhost".

If not, you can start it via the admin panel or by executing "Server_Start.bat w mysql".

Share this post


Link to post
Share on other sites

Have you started mySQL?

 

Yes. I have starded mySQL from the Admin Panel.

 

I am going to prove with 127.0.0.1.

 

Thanks.

Share this post


Link to post
Share on other sites

It does not work with

 

Does lack algun Driver?

 

It does not work with 127.0.0.1

 

Does lack algun Driver for windows XP?

Share this post


Link to post
Share on other sites

Can you access mySQL with phpMyAdmin in the Admin Panel?

Share this post


Link to post
Share on other sites

Yes. I can create DB, even insert registries, etc.

 

But I cannot make connection.

 

I feel much, because UniformServer is very easy to use.

Share this post


Link to post
Share on other sites

I'm out of ideas, maybe you should try downgrading to PHP4?

Share this post


Link to post
Share on other sites

If you can connect using apanel you have no problem!

 

UniServer 3,3

Defaults

name=root

password=root

 

example code:

 

MySQL Test

 

MySQL test

 

<?php

mysql_connect("localhost", "root", "root");

if (mysql_select_db("phpmyadmin")){

echo "CAN connect to database";

}

else{

echo "CAN NOT connect to database";

}

 

?>

 

 

Hope that helps :(

Share this post


Link to post
Share on other sites

Thank you very much Ric.

Already I connect with password "root".

I have one doubts: in PhpMyAdmin, in DB "mysql", table "user", the USER="root" and the PASSWORD="67457e22ã1a15bd". Porqué connects to me with Password="root"?

Share this post


Link to post
Share on other sites

Now I see what's wrong :)

Why didn't I realize that you had the wrong password in $sql_pass earlier :(

 

"67457e22ã1a15bd" is "root" encrypted, you shouldn't use the encrypted password to connect to mySQL :D

Edited by MrX

Share this post


Link to post
Share on other sites

Internal password:

The MySQL password 67457e226a1a15bd contained in the table user is not the external password.

When privileges were set for user root the password was entered in as text “root” MySQL converted this into that long number for internal use.

 

External password:

From PHP $dbuser = 'root' is sent to your MySQL database where it is converted into a number and matched against the internal number (67457e226a1a15bd). Access is allowed because the numbers match.

 

From PHP if $dbuser = '67457e226a1a15bd' this number (text) is sent to MySQL converted into a number that will not match against the internal number for root. Access is denied because the numbers do not match.

 

Online:

 

When you are on line MySQL listens for any requests and accepts any with user=root and password=root these are the default settings.

 

To prevent external access to root you need to change the root password in MySQL.

 

Run apanel: http://localhost/apanel/

Click on: phpMyAdmin

 

Click on: Privileges

 

To the right of root click on Edit privileges

Scroll down to: Change password

 

Tick the radio button: Password

Enter your password

Enter your password again

Click on Go.

 

Doing this will also prevent access using apanel. You need to change the password contained in the file mysql_password

Located in folder: \diskw\home\admin\www

To match the one you set in MySQL privileges.

Share this post


Link to post
Share on other sites

:(

 

Ok, Ok!

 

This it is my problem.

Now, Uniforserver works perfectly.

I did not have the news that MySQL encripta the Password (root=67457e226a1a15bd)

Thank you very much to Ric and MrX

 

:D :) :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...