Tag Info

New answers tagged

0

I think Rick James is on the right track, the many 30k table handles are jamming memory. In MySQL 5.5, InnoDB uses the system tablespace, which places all table data in a single OS file. This means that individual internal table data allocation, as well as handle management, happens inside MySQL (which is to say, completely in RAM as you have no swap ...


1

This script creates all databases accordingly to the names of the files: PW=your password here for i in *.sql; do db=$(echo $i|sed s/.sql$//;); echo $db ...; mysql -u root -p$PW -e "create database $db"; mysql $db -u root -p$PW < $i; done


0

Wrap the selects into parentheses (SELECT DISTINCT CONCAT (MONTH(`Date`),'-',YEAR(`Date`)) from wp_result_plugin WHERE Bet=2 AND month(`Date`) = EXTRACT(month FROM (NOW())) ORDER BY MONTH(`Date`) ASC ) UNION (SELECT DISTINCT CONCAT (MONTH(`Date`),'-',YEAR(`Date`)) from wp_result_plugin WHERE Bet=2 AND month(`Date`) ORDER BY MONTH(`Date`) ASC)


0

If your table has multiple Indexes you should consider using FORCE INDEX to tell MySQL which Index should be used. Sometimes MySQL uses the wrong one and this results in a full table scan.


0

It turns out that the ubuntu mysql package uses apparmor. I found a blog entry describing my scenario and the steps to fix it, summarized below: Here's the gotcha: Ubuntu comes with AppArmor. AppArmor's security model is to bind access control attributes to programs rather than to users. In my /etc/apparmor.d/usr.sbin.mysqld file I've made these ...


1

update mytable set myfield1 = replace(replace(replace(replace(replace(myfield1, '…' ,'-'), '?' ,'|'),'”' , '"'),'‘' , '`'),'?' ,'"');


0

You will be able to do it like this: select jsn_extract(reading, '$.key_fiyat') from table where key_il = 33; in the new version of MySQL( http://mysqlserverteam.com/mysql-5-7-lab-release-json-functions-part-2-querying-json-data/). For now it's just a lab release though.


2

The values seem to be Unix timestamps, stored as strings. You can use the special datetime functions that MySQL has for conversions: SELECT * FROM representative WHERE DATE_ADD(FROM_UNIXTIME(lastLoginTimestamp), INTERVAL 7 DAY) >= NOW() ; but it won't be very good for efficiency. Much more efficient, if there is an index on the column, to do it the ...


1

select from_unixtime("1427162434"); the rest you will figure out but consider formatting the historical data and just change the type and test. Can't believe that the dates are pushed to the DB as chars.


1

The database server that you are accessing using phpmyadmin and the mysql monitor (command line client) are different. If you look at the versions, phpmyadmin is accessing a 5.5.1-m2-community version, while you are accessing 5.6.17-community on the command line. Either you are accessing a remote server or you have two separate installations of mysql on the ...


0

I have resolved the issue, just thought to sharing in case it helps other in future in case face similar issue. This is something have to do with apparmor and you don't qualify proper permission, I have only qualify following in /etc/apparmor.d/usr.sbin.mysqld /home/ebsbkdrive/mysql_repl_data/* rw but was lacking read permission on folder itself ...


0

For those who still stumble upon this like I did, it's worth checking to make sure the attempted GRANT does not already exist: SHOW GRANTS FOR username; In my case, the error was not actually because there was a permission error, but because the GRANT already existed.


1

Your first HUGE mistake (as @ypercube pointed out) is not using a DATETIME type for a date-time type variable. TIMEs are not VARCHARs and doing this will mess up your queries, make your app non-portable and will confuse the optimiser. The other HUGE problem is MySQL. It doesn't perform this sort of query properly. Your query is ambiguous - PostgreSQL for ...


1

It turned out to be an issue with our Proxy Server, blocking downloads from percona.com Running sudo apt-get update revealed that every connection to percona.com 'failed', and so I got that added to the approved list, and after that it installed fine.



Top 50 recent answers are included