#1 VALIDATE PASSWORD PLUGIN can be used to test passwords… Press y|Y for Yes, any other key for No: N(不启用弱密码检查)
#2 Please set the password for root here… New password: (设置root密码) Re-enter new password: (重复输入)
#3 By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them… Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y(不启用匿名用户)
#4 Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network… Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (不允许root远程登陆)
#5 By default, MySQL comes with a database named 'test' that anyone can access… Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N
#6 Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (立刻刷新权限表)
All done!
接下来进入进入MySQL进行操作:
#最新版的MySQL安装之后无法使用密码进行登陆,需要sudo登录修改登录方式 lemon@ubuntu:~$ sudo mysql -uroot -p Enter password: (空密码) mysql> mysql>UPDATE mysql.user SET authentication_string=PASSWORD('LEMON'), plugin='mysql_native_password' WHERE user='root'; mysql> FLUSH PRIVILEGES; mysql>exit
发表评论
还没有评论,快来抢沙发吧!