2011年7月26日

LAMP安裝備忘(Linux Apache Mysql Php) on Debian

apt-get install apache2 mysql-server php5 php5-mysql

apache2設定

編輯 /etc/apache2/apache2.conf or httpd.conf
加上 EnableSendfile Off

編輯 /etc/apache2/apache2.conf
加上 ServerName 127.0.0.1

mysql設定

編輯 /etc/mysql/my.cnf
修改 bind-address = 127.0.0.1 => #bind-address = 127.0.0.1
[mysqld]之下加入(跟效能調校有關)
max_connect_errors = 1844674407370954751
connect_timeout = 20
skip-name-resolve
slave_net_timeout = 30


建帳號、新增使用者
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> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON dbname.* to 'vega'@'%' identified by 'vega';

更新權限
mysql>flush privileges;

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

MYSQL 5.7版已無Password欄位
update user set authentication_string=password('1111') where user='root';

看權限
SHOW GRANTS FOR 'vega'@'%';

沒有留言:

張貼留言