mysql

Post

Posts tagged as "mysql"

2 comments   |   MySQL
Disable innodb in mysql 5.5.x

Disable innodb in mysql 5.5.x

if skip-innodb didn’t help you, try to add this into yours my.cnf ignore_builtin_innodb default_storage_engine=MyISAM

2 comments   |   Linux, MySQL
MySQL error InnoDB: Unable to lock ./ibdata1, error: 11

MySQL error InnoDB: Unable to lock ./ibdata1, error: 11

Mysql error “InnoDB: Unable to lock ./ibdata1, error: 11″ You need to create copies of original files (ibdata1, ib_logfile0, ib_logfile1… – error may be associated with many files, but the solution is the same). mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1

Comments   |   SQL
MySQL char to int

MySQL char to int

If the query returns a text type, but we need to obtain the numerical values of type, you can just add *1 to column you need to be int(or numeric.) Example: We have column category, in this column data has next format: 1,2,34,14,4, type of column – char, but we need get the first number and sort table by it. SELECT  SUBSTRING(category,1,LOCATE(',',category)-1) ...

Comments   |   SQL
Use MAX() with INSERT query

Use MAX() with INSERT query

Hi, today I ran into a problem - I had to use the MAX() function while Inserting data into database. I write a simple query: INSERT INTO `table` (row1,row2) VALUES(`sample`,MAX(row2)+1) And I got an error #1111 – Invalid use of group function So I start to think and find the right way to compose my query: INSERT INTO `table` (row1,row2) VALUES(`sample`,(SELECT ...