ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Note: For MySQL 5.7+, please see the answer from Lahiru to this question. That contains more current information. For MySQL < 5.7: The default root password is blank (i.e., an empty string), not root. So you can just log in as: You should obviously change your root password after installation: In most cases you should … Read more

Cannot add or update a child row: a foreign key constraint fails

table #1: Field Type Null Key Default Extra UserID int(11) NO PRI NULL auto_increment Password varchar(20) NO Username varchar(25) NO Email varchar(60) NO table #2: Field Type Null Key Default Extra UserID int(11) NO MUL PostID int(11) NO PRI NULL auto_increment Title varchar(50) NO Summary varchar(500) NO Error: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot add or update a child … Read more

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Note: For MySQL 5.7+, please see the [answer from Lahiru] to this question. That contains more current information. For MySQL < 5.7: The default root password is blank (i.e., an empty string), not root. So you can just log in as: You should obviously change your root password after installation: In most cases you should … Read more

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Note: For MySQL 5.7+ please see answer from @Lahiru to this question. That contains more current information. For MySQL < 5.7: The default root password is blank (i.e. empty string) not root. So you can just login as: You should obviously change your root password after installation In most cases you should also set up individual user accounts before working extensively … Read more

How to use mysqli_query() in PHP?

I have to admit, mysqli_query() manual entry doesn’t contain a clean example on how to fetch multiple rows. May be it’s because the routine is so routine, known to PHP folks for decades: In case you want to print the column titles, you have to select your data into a nested array first and then use keys … Read more