Guest User

Untitled

a guest
Aug 28th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. $server = "localhost";
  2. $username = "xyz";
  3. $password = "passw0rd";
  4. $sdosmsDB = "test";
  5.  
  6. $conn = new PDO("mysql:host=$server; dbname=$sdosmsDB", $username, $password);
  7. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  8. $conn->exec("SET CHARACTER SET utf8");
  9.  
  10. } catch(PDOException $e) {
  11.  
  12. die( 'Database Connection failed: ' . $e->getMessage());
  13.  
  14. }
  15.  
  16. CREATE USER xyz@localhost IDENTIFIED WITH mysql_native_password BY 'passw0rd'
Add Comment
Please, Sign In to add comment