Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dbh->exec("CREATE DATABASE `$db` CHARACTER SET utf8 COLLATE utf8_bin;
- CREATE USER '$user'@'%' IDENTIFIED BY '$pass';
- GRANT USAGE ON *.* TO '$db'@'localhost' IDENTIFIED BY PASSWORD '*3D3B92F242033365AE5BC6A8E6FC3E1679F4140A';
- GRANT ALL PRIVILEGES ON `$username_$dbusername`.* TO '$user'@'localhost';")
- '*3D3B92F242033365AE5BC6A8E6FC3E1679F4140A'
- test1234
- $user='abc_dbuser';
- $db="abc_dbname";
- $pass='test1234';
- $dbusername="dbname";
- $username=get_current_user();
- try {
- $dbh = new PDO("mysql:host=$host", $root, $root_password);
- $dbh->exec("CREATE DATABASE `$db` CHARACTER SET utf8 COLLATE utf8_bin;
- CREATE USER '$user'@'%' IDENTIFIED BY '$pass';
- GRANT USAGE ON *.* TO '$db'@'localhost' IDENTIFIED BY PASSWORD '*3D3B92F242033365AE5BC6A8E6FC3E1679F4140A';
- GRANT ALL PRIVILEGES ON `$username_$dbusername`.* TO '$user'@'localhost';
- ")
- or die(print_r($dbh->errorInfo(), true));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement