目前分類:mysql (2)

瀏覽方式: 標題列表 簡短摘要
[新增]

$sql = "INSERT INTO table_name(col1,col2,......coln) VALUES($var1,$var2,......$varn)";
$result = $db->exec($sql);

[修改]

$sql = "UPDATE dbname SET col1='$var1',col2='$var2',......coln='$varn' WHERE ......";
$result = $db->prepare($sql);
$result->execute();

Vega 發表在 痞客邦 留言(1) 人氣()

1.建帳號、新增使用者
mysql> grant all privileges on *.* to 'vega'@'localhost' identified by 'vega' with grant option;
mysql> grant all privileges on *.* to 'vega'@'%' identified by 'vega' with grant option;
更新權限
mysql>flush privileges;

2.改密碼
mysql>update user set Password=PASSWORD('new_pass') where user='root';

web root:

Vega 發表在 痞客邦 留言(0) 人氣()