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了。报错不要管,直接运行下面一句。

4.

                                     confluence

confluence连接数据库,配置参数:

vim  /etc/my.cnf

[mysqld]
character_set_server=utf8
collation_server=utf8_bin


>set global transaction isolation level read committed;

Confluence 不支持数据库排序规则 “utf8_general_ci"。 您需要使用 “utf8_bin"

ALTER DATABASE Confluence CHARACTER SET utf8 COLLATE utf8_bin;

 

 

 

 

5.插入的mysql语句过大,会出现MySQL server has gone away
则需要设置配置文件

vim  /etc/my.cnf

[mysqld]
max_allowed_packet = 10M(也可以设置自己需要的大小) 
max_allowed_packet 参数的作用是,用来控制其通信缓冲区的最大长度。

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

R助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值