Category: MySQL

Linux MySQL

Mysql root password change

1.Stop mysql service 2.then run this command mysqld_safe –skip-grant-tables & 3.mysql -u root 4.Run Below Command:- use mysql; update user set password=PASSWORD(“mynewpassword”) where User=’root’; flush privileges; quit 5.stop start mysql service  and you’re good to go 🙂 Reference Link : https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords

MySQL Php

SQL VS PHP (Object oriented connection)

HOW TO ESTABLISH THE CONNECTION WITH DATABASE $db = new mysqli(<HOST NAME>,<DB USER>,<DB PASS>,<DB NAME>); HOW TO EXECUTE QUERY $query = “YOUR QUERY”; $result = $db->query($query); HOW TO LIST YOUR QUERY RESULT while($row = $result->fetch_array(MYSQLI_ASSOC)){ echo “Hi ” .$row[‘Name’]. “, Your Email is” .$row[‘Email’]. ” and your phone number is ” .$row[‘Phone’] ; }

Back To Top