Help - Search - Members - Calendar
Full Version: ¿Alguien me puede contestar en Español?
The Uniform Server BBoard > Support > Uniform Server - Windows > MySQL
informa
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.
olajideolaolorun
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?
informa
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.
MrX
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".
informa
QUOTE(MrX @ Jun 24 2006, 02:58 AM) *

Have you started mySQL?


Yes. I have starded mySQL from the Admin Panel.

I am going to prove with 127.0.0.1.

Thanks.
informa
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?
MrX
Can you access mySQL with phpMyAdmin in the Admin Panel?
informa
Yes. I can create DB, even insert registries, etc.

But I cannot make connection.

I feel much, because UniformServer is very easy to use.
MrX
I'm out of ideas, maybe you should try downgrading to PHP4?
informa
You one talks about, for example, to the version Uniform Server 2.8?
Ric
If you can connect using apanel you have no problem!

UniServer 3,3
Defaults
name=root
password=root

example code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MySQL Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>MySQL test</p>

<?php
mysql_connect("localhost", "root", "root");
if (mysql_select_db("phpmyadmin")){
echo "CAN connect to database";
}
else{
echo "CAN NOT connect to database";
}

?>

</body>
</html>

Hope that helps smile.gif
informa
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"?
MrX
Now I see what's wrong smile.gif
Why didn't I realize that you had the wrong password in $sql_pass earlier mellow.gif

"67457e22ã1a15bd" is "root" encrypted, you shouldn't use the encrypted password to connect to mySQL biggrin.gif
Ric
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.
informa
biggrin.gif

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

biggrin.gif biggrin.gif biggrin.gif
MrX
No problem smile.gif
olajideolaolorun
I was just about to say that...

Thanks Ric.... smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.