下载rpm包;
rpm -qa | grep -i mysql //查看当前系统是否装过mysql
rpm -e MySQL-server //卸载MySQL 服务端
rpm -ivh MySQL-service.xx.xx.rpm //安装MySQL
一、mysql登录错误
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
解决办法:破解mysql密码
#> service mysqld stop
#>mysqld_safe --skip-grant-tables &
输入 mysql -uroot -p 回车进入
>use mysql;
> update user set password=PASSWORD("newpass")where user="root";
更改密码为 newpassord
> flush privileges; 更新权限
> quit 退出
service mysqld restart
mysql -uroot -p新密码进入
开放远程登录
mysql> grant all on *.* to root@'%' identified by '000000' with grant option;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
需要再次设置一次密码:
mysql> set password=PASSWORD("000000");
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on *.* to 'root'@'%' identified by '000000' with grant option;
Query OK, 0 rows affected (0.00 sec)