PHP Owncloud [1045] SQLSTATE [HY000] [1045]拒绝访问用户'ownclouduser'@'localhost'(使用密码:YES)

I tried to change the design of my owncloud.

I've copied all the code into XAMPP htdocs and tried to open it.

I get always this error:

[1045] SQLSTATE[HY000] [1045] Access denied for user 'ownclouduser'@'localhost' (using password: YES)

I want to work first with xampp, because I don't want to work on the original code.

this code you see is connected to database .you have to know username database and password database and database name to connect on a right way

//this code need close
$con = mysql_connect($host,$username,$password)or die(mysql_error());
$sel = mysql_select_db($database_name);


//close code
mysql_close($con);

//OR
//it doesn't need close
$con = mysql_pconnect($host,$username,$password)or die(mysql_error());
$sel = mysql_select_db($database_name);

if you have an "_" in the db name you need to drop the _. example owncloud_db should be entered as ownclouddb in the setup screen of owncloud.