linux下的mysql常见问题解答

                                                  mysql

  1.

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec

解答:

mysql>show variables like ‘datadir%’;

mysql>show variables like '%secure%'; 命令显示文件目录

whereis my            //my: /etc/my.cnf

vim /etc/my.cnf

[mysqld]节点 下添加 secure_file_priv='',然后重启mysql服务。

2.

当你修改好root密码后,很有可能出现这种情况

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

解答:

whereis my            //my: /etc/my.cnf

vim /etc/my.cnf

  [mysqld]后面任意一行添加“skip-grant-tables”用来跳过密码验证的过程。

service mysqld restart

登录mysql系统

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

mysql> flush privileges;

mysql> exit;

3.

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

解答:

1)create user 'wli'@'%' identified by '123456';

2)flush privileges;

3)create user 'wli'@'%' identified by '123456';

就OK了。报错不要管,直接运行下面一句。














猜你喜欢

转载自blog.csdn.net/honey_babay/article/details/79792630