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 参数的作用是,用来控制其通信缓冲区的最大长度。