MySQL 用户问题
添加远程访问用户:
以root用户登录#mysql -u root -p
插入新用户,host:%;user:lxx;pssword:lxx,host为服务器,%为任意服务器
命令:mysql>insert into mysql.user (host,user,password) values('%','lxx',PASSWORD('lxx'));
授予权限mysql>grant all on *.* to lxx@'%' identified by 'lxx';其中*.*为所有数据库;
刷新权限mysql>flush previleges;
root用户密码错误修改:
命令:
/etc/init.d/mysqld stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;mysql> quit
重启MySQL即可