mysql5.7 ubuntu 17安装
[root]sudo apt-get install mysql-server
过程中设置好root用户密码
[root]mysql -uroot -p
mysql>use user;
mysql>update user set host= '%' where user= 'root';
mysql> grant all on *.* to admin@'%' identified by 'root' with grant option;
mysql> quit;
[root] vi /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉 #bind-address = 127.0.0.1
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
表示root用户密码错误了
修改/etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
skip-grant-tables
[root]sudo /etc/init.d/mysql restart
[root]mysql
mysql>use user;
mysql>update user set authentication_string = password("root") where user= 'root';
mysql> flush privileges;
mysql> quit;
修改 sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
#skip-grant-tables
[root]sudo /etc/init.d/mysql restart
本文详细介绍了在Ubuntu17系统中安装MySQL5.7的过程,包括设置root用户密码、修改配置文件以允许远程访问、解决密码错误问题及重启服务的步骤。
1万+

被折叠的 条评论
为什么被折叠?



