当前位置:Gxlcms > 数据库问题 > MySQL安装使用的2个问题

MySQL安装使用的2个问题

时间:2021-07-01 10:21:17 帮助过:27人阅读


Database changed
mysql> UPDATE user SET Password=PASSWORD(‘root‘) where USER=‘root‘;
ERROR 1054 (42S22): Unknown column ‘Password‘ in ‘field list‘
mysql> update mysql.user set authentication_string=password(‘123qwe‘) where user=‘root‘ and Host=‘localhost‘;
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1

mysql> flush privilages;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ‘privilages‘ at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit;
Bye

D:\Mysql\mysql-5.7.16-winx64\bin>mysql -uroot -p123qwe; (这个时候这样输入会报错)
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

D:\Mysql\mysql-5.7.16-winx64\bin>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.16

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql>


登陆后如果不能执行任何语句
报错:
You must reset your password using ALTER USER statement before executing this statement.

安装完mysql 之后,登陆以后,不管运行任何命令,总是提示上面错误语句,就在登录后,
以此执行下面语句(红色字体自己输入最好,因为标点格式可能不对)

1: SET PASSWORD = PASSWORD(‘your new password‘);

2: ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;

3: flush privileges;

完成以上三步退出再登,使用新设置的密码(就是括号里的your new password)就行了.

 

MySQL安装使用的2个问题

标签:引号   new   cte   lag   monitor   安装使用   自己   localhost   access   

人气教程排行