Advertisement
Guest User

Untitled

a guest
Jun 9th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. conexao
  2. <?php
  3. $host = 'localhost';
  4. $user = 'tvwebsit_root';
  5. $pass = 'senhadatv';
  6. $db = 'tvwebsit_db';
  7.  
  8. try {
  9. if(isset($pdo)){
  10. $pdo = new PDO("mysql:host=$host;dbname=$db",$user,$pass);
  11. echo 'Conexao efetuada com sucesso!';
  12. }else{
  13. echo 'Nao foi possivel conectar ao banco de dados';
  14. }
  15. }catch(PDOException $e){
  16. echo $e->getMessage();
  17. }
  18. ?>
  19.  
  20. erro SQLSTATE[42000] [1044] Access denied for user 'tvwebsit_root'@'localhost' to database 'tvwebsit_db'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement