use mysql; update user set Host='%' where User='root'; (注:有一说是) GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; flush privileges; # 清缓存
# 确认root的host是否是“%” select host,user from user;
修改数据库
以wordpress修改网址为例(将siteurl字段值设置为
1 2 3 4 5 6 7 8 9
mysql -uroot -pJJ..** use wordpress0; select * from wp_options where option_name='siteurl';
update wp_options set option_value='http://blog.latelee.org' where option_name='siteurl';
select * from wp_options where option_name='home';
update wp_options set option_value='http://blog.latelee.org' where option_name='home';
查看数据库有哪些表:
1
show talbes;
查看数据库有哪些字段:
1 2 3
desc wp_comments; 或 describe wp_comments;
清空某一个表:
1 2
delete * from wp_comments; truncate table wp_comments; # 注:测试时发现此语句无法执行
恢复禅道admin密码为123456
1 2 3
use zentao; select * from zt_user where account='admin'; update zt_user set password='e10adc3949ba59abbe56e057f20f883e' where account='admin';