php数据库操作

//连接
$host=‘127.0.0.1‘;
$user=‘root‘;
$pwd=‘root‘;
$conn=mysqli_connect($host,$user,$pwd);
if(!$conn){
    die(‘could not connect‘);
}
echo "success<br>";
//mysqli_close($conn);
//建库
//$sql="create database looklook ";
//$res=mysqli_query($conn,$sql);
//if(!$res){
//    die("fail:".mysqli_error($conn));
//}
//echo "db success";
//mysqli_close($conn);

//删库
//$sql="drop database looklook ";
//$res=mysqli_query($conn,$sql);
//if(!$res){
//    die("fail:".mysqli_error($conn));
//}
//echo "db success";
//mysqli_close($conn);


//选库
mysqli_select_db($conn,‘looklook‘);
mysqli_close($conn);

 

php数据库操作

上一篇:通过 ansible 部署二进制 mysql 8


下一篇:MySQL的中的全局锁、表级锁、行锁