1. 連線
$ mysql -u <username> -h <host-name> -pAccount Management
1. 新增帳號 (密碼可空白, i.e., 空字串)
$ GRANT ALL PRIVILEGES ON *.* TO <username>@<domainname> IDENTIFIED BY '<password>' WITH GRANT OPTION;
$ GRANT ALL PRIVILEGES ON *.* TO <username>@'%' IDENTIFIED BY '<password>';
As you see in the latest example we use '%' instead of localhost, which means that our user can use all the privileges from every host.
2. Modify password
2. Modify password
$ mysqladmin -u <user> -p <old-passwd> password <new-passwd>;or
$mysqladmin -u <user> password <new-passwd>;
New and delete database
1.. 新增database (i.e., 用``將database-name包起來可避免含有特殊字元的問題,如dash(i.e., - )) $ CREATE DATABASE `<database-name>`
2.. 刪除database
$ DROP DATABASE `<database-name>`
網誌管理員已經移除這則留言。
回覆刪除