1.下载地址
[url]http://downloads.mysql.com/archives/community/[/url]
2.64位linux
Linux - Generic (glibc 2.5) (x86, 64-bit), RPM Bundle
3.解压后
rpm -ivh
MySQL-client-5.6.24-1.linux_glibc2.5.x86_64.rpm
MySQL-devel-5.6.24-1.linux_glibc2.5.x86_64.rpm
MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm
A random root password has been set. You will find it in '/root/.mysql_secret'.
4.更改密码
mysql -u root -p
5.ip
首先 use MySQL;
按照别人提供的方式update的时候,出现错误。
MySQL> update user set host='%' where user = 'root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
然后查看了下数据库的host信息如下:
MySQL> select host from user where user = 'root';
+-----------------------+
| host |
+-----------------------+
| % |
| 127.0.0.1 |
| localhost.localdomain |
+-----------------------+
3 rows in set (0.00 sec)
host已经有了%这个值,所以直接运行命令:
复制代码 代码如下:
MySQL>flush privileges;
[url]http://downloads.mysql.com/archives/community/[/url]
2.64位linux
Linux - Generic (glibc 2.5) (x86, 64-bit), RPM Bundle
3.解压后
rpm -ivh
MySQL-client-5.6.24-1.linux_glibc2.5.x86_64.rpm
MySQL-devel-5.6.24-1.linux_glibc2.5.x86_64.rpm
MySQL-server-5.6.24-1.linux_glibc2.5.x86_64.rpm
A random root password has been set. You will find it in '/root/.mysql_secret'.
4.更改密码
mysql -u root -p
5.ip
首先 use MySQL;
按照别人提供的方式update的时候,出现错误。
MySQL> update user set host='%' where user = 'root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
然后查看了下数据库的host信息如下:
MySQL> select host from user where user = 'root';
+-----------------------+
| host |
+-----------------------+
| % |
| 127.0.0.1 |
| localhost.localdomain |
+-----------------------+
3 rows in set (0.00 sec)
host已经有了%这个值,所以直接运行命令:
复制代码 代码如下:
MySQL>flush privileges;