当前位置: 动力学知识库 > 问答 > 编程问答 >

first time using phpmyadmin

问题描述:

I am getting nowhere setting up my first mysql database. Is there a good tutorial out there I can use?

here is my code on a separate page.php

<?php

$db_hostname='hosting website';

$db_database='xxxxxxxxx';

$db_username='a4999406';

$db_password='xxxxxx';

?>

here is the code on an html page i'm trying to use as a login page:

if(!$db_server) die("Unable to connect to MySQL: " . mysqu_error())

?>

i'm getting the following error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a4999406'@'10.1.1.47' (using password: YES) in /home/a4999406/public_html/willingLog.html on line 36

网友答案:

I would recommend reading over W3 school's tutorial first. After that head over to php.net - the site will become your go to bible.

网友答案:

W3Schools has great tutorials. Check out:

http://www.w3schools.com/php/php_mysql_connect.asp

Follow the tutorials in order from there and learn how to start building on your MySQL skills.

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
die('Could not connect: ' . mysql_error());
  }

// some code

mysql_close($con);
?>
网友答案:

I think I've got it figured out. on phpmyadmin using www.OOOwebhost.com for the database username you need to use the "MYSQL user" as opposed to the "Username" for the account. One is related to the other so it's very confusing; especially since the tutorial says to ask for a "username".

If this doesn't work, i'll come back and post.

Thanks to all who responded.

分享给朋友:
您可能感兴趣的文章:
随机阅读: