
MySQL
文章平均质量分 59
saife
这个作者很懒,什么都没留下…
展开
-
Illegal mix of collations (utf8_tolower_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=
问题ERROR 1267 (HY000): Illegal mix of collations (utf8_tolower_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='在执行调用存储过程时候报错项目参数Linux版本Red Hat 7.5MySQL版本8.0.15分析存储过程...原创 2019-11-20 18:20:34 · 1408 阅读 · 0 评论 -
waiting for stored procedure metadata lock - MySQL
问题通过sqlyog打开已经创建的存储过程,修改再次执行可成功。连接未关闭,再次执行会执行一直等待中,查看processlist,看到有锁waiting for stored procedure metadata lock。分析通过select * from performance_schema.metadata_lock where object_name like '%p_%';可...原创 2019-11-20 10:32:16 · 889 阅读 · 0 评论 -
MySQL初始化失败error(mysqld --initialize / mysql_install_db) 没有创建系统数据库(prematurely with errno= 32)
问题在一个备份机上创建多个数据库实例,以此同步部分正式环境的数据库,用于备份等其他用途。mysql_install_db命令:/usr/local/mysql5710/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql5710 --datadir=/mysqldata/data/报错: 2016-04-12 06:24:58原创 2016-04-12 14:41:03 · 46270 阅读 · 2 评论 -
mysqldump: Got error: 1: Can't create/write to file '/data/export/test.txt' (Errcode: 13)
问题需要将数据已csv格式导出到/data/export/路径下,遇到问题: mysqldump: Got error: 1: Can’t create/write to file ‘/data/export/test.txt’ (Errcode: 13) when executing ‘SELECT INTO OUTFILE’分析环境 OS: Ubuntu 14.04 LTS MySQL:5原创 2016-04-07 15:22:43 · 4716 阅读 · 0 评论 -
Ubuntu安装inception错误处理make[2]: *** [sql/CMakeFiles/sql.dir/sql_yacc.cc.o] Error 1
问题make[2]: * [sql/CMakeFiles/sql.dir/sql_yacc.cc.o] Error 1 make[1]: * [sql/CMakeFiles/sql.dir/all] Error 2 make: * [all] Error 2分析inception version: 2.1.21ubuntu version: Ubuntu 14.04 LTS按照文档的提示原创 2016-03-17 16:18:01 · 13507 阅读 · 0 评论 -
MySQL锁;Lock wait timeout exceeded; try restarting transaction
问题Lock wait timeout exceeded; try restarting transaction分析设置autocommit=0,需要执行完sql,提交或者回滚,但没有及时操作;autocommit是session级别的。如set autocommit=0;select * from A where id=1 for update;...commit;#rollback 这原创 2015-10-11 15:49:38 · 1505 阅读 · 1 评论 -
Mysql 5.6.30 insert null (ERROR 1048 (23000): Column 'ctime' cannot be null)
问题对定义了ctime为not null的表,insert ctime null 在开发环境可以通过,但是部署上线出问题了,提示 ERROR 1048 (23000): Column ‘ctime’ cannot be null分析Dev env: Mysql 5.6.30 Online env: Mysql 5.7.10对比表结构 对比执行sql 考虑可配置参数解决方案表结构一原创 2016-08-05 16:42:10 · 6175 阅读 · 0 评论 -
Can't read dir of '.' (errno: 13)
Can’t read dir of ‘.’ (errno: 13)问题os:ubuntumysql version:Ver 14.14 Distrib 5.5.43 >show databases; ERROR 1018 (HY000): Can’t read dir of ‘.’ (errno: 13)解决方案1.数据路径权限 >chown -R mysql:mysql /pda原创 2015-09-19 10:57:06 · 9181 阅读 · 0 评论 -
关于MySQL的order by与group by的组合使用
group by会用吧?order by也会用吧?可是,同时使用的时候,结果却有了出入?那么,那么在你郁闷的时候,静下心来思考吧……在group by 和order by同时使用的时候,你的排序策略(即asc or desc)会直接影响结果和写法的因为1.group by 先于order by执行2.group by 的时候 会首先对结果进行排序 然后再分组的3.g原创 2013-05-09 13:28:43 · 1495 阅读 · 0 评论 -
MySql函数
DELIMITER $$DROP FUNCTION IF EXISTS test_fun1$$CREATE FUNCTION test_fun1 (df1 INT) RETURNS VARCHAR(20)DETERMINISTICCONTAINS SQLSQL SECURITY DEFINERCOMMENT '这是函数的描述'BEGINSET df1 = 13;INSERT转载 2013-04-02 19:57:56 · 683 阅读 · 0 评论 -
Mysql tee prompt pager
tee说明可以将之后在mysql的所有输入输出操作记录到filename中。方法一、配置文件在服务器上的/etc/my.cnf中的[client]加入 tee =/tmp/client_mysql.log即可.方法二、命令行1.mysql -uroot --tee=/tmp/client_mysql.log 2.这个类似于sqlplus的spool功能,可以将命令行转载 2013-02-27 14:44:40 · 618 阅读 · 0 评论 -
MySQL字段类型
MySQL数据库的表是一个二维表,由一个或多个数据列构成。每个数据列都有它的特定类型,该类型决定了MySQL如何看待该列数据,我们可以把整型数值存放到字符类型的列中,MySQL则会把它看成字符串来处理。MySQL中的列类型有三种:数值类、字符串类和日期/时间类。从大类来看列类型和数值类型一样,都是只有三种。但每种列类型都还可细分。下面对各种列类型进行详细介绍。数值类的数据列类型转载 2012-12-06 00:43:25 · 753 阅读 · 0 评论