Комментарии:
Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\New folder\mysql.php on line 3
mysql_error
how to solve this error???
/to connect mysql with php coding
<?php
$servername="localhost";
$username="root"; /write your username here
$password="**"; / write your password
$conn=new mysqli("$servername","$username","$password"); */Mysqli stands My scripted query language improved
if($conn->connect_error)
{
die("not connected".$conn->connect_error);
}
echo"connected successfully";
?>
For all who has problem:
<?php
$user = 'root';
$pass = ''; //your password
$db = 'proiectbd'; //here you write the name of your database
$db = new mysqli('localhost' ,$user , $pass , $db ) or die("Unable to connect");
echo "Great work"; //to see that it works
?>
this shit is not working!!
ОтветитьFatal error: Call to undefined function mysql_connect() in G:\XAMPP\htdocs\root\mysql.php on line 4
Help me anyone Please
Your accent sounds like you're from Liverpool.
Ответитьhi im using php v7.0.1 mysql_connent is not working please help me fatal error
Ответитьto everyone who's asking for more tutorials, he works at amazon, he's busy.
Ответитьmysql_connect("localhost", "root", "password")or die(mysql_error()); shows this error: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead.
Replace mysql_connect with PDO:
$username = 'root';
$password = 'password';
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
try {
$dbh = new PDO($dsn, $username, $password, $options);
} catch(PDOException $ex) {
echo "An Error Occured!" . $ex;
}
isn't it that you have "password123" as password for database? how come it worked in php as "password"?
ОтветитьGetting errors when connecting to db,
Access denied for user 'root'@'localhost'(using password: YES)
Hello everyone can u tell me which username & password can i entered here because when i enter the username root & password is blank or any other it show the error message like couldn't connect to the database.I am doing work on mac-book pro.Please help me
ОтветитьWhy did you stop making tutorials?
Ответитьits awesome and easy to understand .. thanks buddy
Ответитьhey! I wanna give you a very big thanks for these tutorials and i am also a big fan of your's as i also love web designing :)>
Ответитьwhat's wrong in my code can't insert data in to database
<?php
$connect = mysql_connect("localhost","root","root") or die(mysql_error());
mysql_select_db("accounts",$connect);
$sql = "
CREATE TABLE users3
{
ID int NOT NULL AUTO_INCREMENT,
Username VARCHAR(20),
Password VARCHAR?(20),
First VARCHAR(20),
Last VARCHAR(20)
)
";
echo $sql;
mysql_query($sql,$connect);
?>
cool..good lecture
ОтветитьHey! super thank you. You're such a good guy for conducting lectures like this. Thaaaaanks! I hope I could thank you personally.
ОтветитьExcellent job! You do an excellent job in explaining things. I am a slow learner, but I grasped tons from your tutorial. Thank you
ОтветитьGOOD MAN BRENNIE YOU LEGEND!!!!!!!!!!!!!
ОтветитьParse error: syntax error, unexpected ';' in C:\Users\Joren\Documents\Code\Websites\Xampp\htdocs\mysql.php on line 3
That is the error I get, can somebody help me?
When I write mysqli_connect with an 'i'.They said no privilege to create database.What to do
Ответитьwhen i give username and password it says " #1045 Cannot log in to the MySQL server" plz anyone can help me ?
Ответитьwhy this isn't working on me? I follow everything in this tutorial. I'm using XAMPP V3.2.1
ОтветитьGiving the following error while logging in( #1045 Cannot log in to the MySQL server)
ОтветитьPLEASE HELP ME
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mns\ControlPanel\Check.php on line 25
$link = mysql_connect($ServerName.":".$User.$Pass);
mysql_select_db($DBName,$link);
$sql = "Select * from Administration where username='$_username' and password='$_password' " ;
$result= mysql_query($sql,$link);
if (mysql_fetch_assoc($result)) //this is line 25
{
//goto main page
print ( Redirect('Main.php') );
If this doesn't work for anyone, try typing mysqli_connect with an 'i'. It worked for me then.
Ответитьhow many are u going to make this is awesome!
Ответитьyou sound diffrent
ОтветитьDude this totally awesome!!!
Ответитьplease help! I tried to create database but there was a sign saying no privilegies! and I couldnt open database.
Ответитьi know i will start earning some bucks learning php from you dude.. hats off.. thanks for sharing your valuable knowledge in simplest form.
ОтветитьHow to make a composite key of two foreign keys in xampp?
ОтветитьThis is the simplest tutorial i have ever seen
Ответитьthanks much! :D
ОтветитьYes, it's amazing isn't it! :D
Ответитьwhile testing your connection comment the top loine out i.e. // error_reporting(0); and save the file
Ответитьother connection methods are through PDO or mysqli, these are supposed to be more secure, i.e. error_reporting(0); $db_connection = mysqli_connect("localhost", "root", "YourPassword", "YourDatabase") or die(mysql_errors()); if (mysqli_connect_errno()) { echo "Error, call back later"; exit(); } else { echo "Connected"; }
ОтветитьIf you have problems remembering all your different passwords think about downloading and installing Keepass.
ОтветитьIf you download the latest version of Xampp when the app starts you can see which ports are used by each engine, these ports need to be free for it to run without problems, if you have other software running that uses any of these ports you will need to stop that software then start up Xampp.
Ответитьif it is xampp it uses port 80, do the same, find out the software using the port and stop it
ОтветитьYou may have other software using the port that mysql uses, the default is 3306, you need to find the software that is using it and stop it then start mysql
ОтветитьBy the looks of it the port maybe being used by some other software. Mysql uses port 3306, try to locate what software is using it, if it is just something that you have installed that you are not using then you can stop it and start mysql.
ОтветитьIf you lose/forget your password for phpmyadmin/xampp google find password in xampp to get instructions how to resolve without having to reinstall.
ОтветитьThe colleges block it for security reasons, you will not be able to get round it unless you hacked into the system which obviously I wouldn't suggest you try unless you want to cut your course short. You should download and install Xampp (On your own computer) and that installs all that Chris is going over at this point.
ОтветитьWhen I try to log into phpadmin I get the message "Cannot log in to the MySQL server" I went back and changed my password to make sure it is correct and restarted. I still cannot get into phpadmin. Can anyone help?
Ответитьhey i am facing some problem regarding sql services.. port 3306 is been blocked in my college.. so i could not start my sql.. please help as soon as possible.
Ответитьif i dont have UN and PW then what is the syntax ?
Ответитьi have entered my password and username but still it replies cannot log in to the Mysql seerver ????????
Ответитьi cant acces my php admin HELP
Ответить