Jump to content

mySQL?


Asday

Recommended Posts

<?php

$sqlCon=mysql_connect("localhost", "asday", "***");
if (!$sqlCon)
{
die("Fark! " . mysql_error());
}
else
{
mysql_query("CREATE DATABASE people");
}
?>

 

outputs:

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'asday'@'localhost' (using password: YES) in C:\xampp\htdocs\SQL\index.php on line 3
Fark! Access denied for user 'asday'@'localhost' (using password: YES)

 

What's wrong?

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/
Share on other sites

1. Have you created a user and set a password for it?

2. Have you got the correct username and/or password?

3. Are the permissions set?

4. If you installed WAMP go into cPanel which gives you access to phpMyAdmin. From there you can check everything via a GUI which will make everything a lot easier.

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/#findComment-295304
Share on other sites

1. Have you created a user and set a password for it?

2. Have you got the correct username and/or password?

3. Are the permissions set?

4. If you installed WAMP go into cPanel which gives you access to phpMyAdmin. From there you can check everything via a GUI which will make everything a lot easier.

 

1)  Yes

2)  Yes

3)  Don't know

4)  Didn't install WAMP

 

(Going home now, so no PC)

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/#findComment-295495
Share on other sites

By default, the mysql root password is empty.

 

To check this out, open the command prompt and do the following:

 

cd c:\path\to\mysql\bin

mysql -u root

 

If this logs you in, then you need to do the following

GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

 

Also, make sure to update the root password:

 

UPDATE mysql.user SET password = PASSWORD('new_pass') where mysql.user = 'root';

 

Good luck

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/#findComment-297942
Share on other sites

By default, the mysql root password is empty.

 

To check this out, open the command prompt and do the following:

 

cd c:\path\to\mysql\bin

mysql -u root

 

If this logs you in, then you need to do the following

GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

 

Also, make sure to update the root password:

 

UPDATE mysql.user SET password = PASSWORD('new_pass') where mysql.user = 'root';

 

Good luck

 

Would that be Linux or windoze command prompt?

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/#findComment-301043
Share on other sites

If you're running Linux, mysql should be in the PATH by default.

 

so in that case, it would just be

mysql -u root

 

In windows, if not apart of the PATH, you must open a command prompt at c:\program files\mysql server 5.0\bin (or equivalent) and run the same command

mysql -u root

 

Link to comment
https://forums.phpfreaks.com/topic/59420-mysql/#findComment-301285
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.