w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
InnoDB working, still showing "Database server does not support InnoDB storage engine message"
If I rememebr correctly WAMP Server comes with innodb disabled, but it is a simple job to activate it. Edit the my.ini ( use the wampmanager menus to edit it ) Look for this line, its roughly around line 90 - 100, you will see a set of paramteters all commented out. Remove the # so it is no longer a comment. You may have to do a little reasearch on what the params mean and then you may have to do some tweeking to get innodb working well, but just uncommenting them should activate innodb. # Uncomment the following if you are using InnoDB tables innodb_data_home_dir = D:/wamp/bin/mysql/mysql5.5.28/data/ innodb_data_file_path = ibdata1:64M:autoextend innodb_log_group_home_dir = D:/wamp/bin/mysql/mysql5.5.28/data/ # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of sett

Categories : Magento

What is the linux command line to check kernel space and User space Memory used
Try: sudo slabtop or sudo cat /proc/slabinfo These should give you enough information to estimate the total kernel memory consumption. You can read more info about kernel and userspace memory here.

Categories : Linux

How do I check for this odd space character - " " in Objective-C?
Try "p{Z}" for your regular expression. It's the unicode property for any kind of whitespace or invisible separator. See: NSRegularExpression and Unicode Regular Expressions. Just as a test of my answer, I constructed the following unit test. - (void)testPattern { NSString *string = @"xxxu00A0yyy"; NSString *pattern = @"\p{Z}"; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:NULL]; NSUInteger number = [regex numberOfMatchesInString:string options:0 range:NSMakeRange(0, [string length])]; STAssertEquals(number, 1U, @""); }

Categories : Objective C

How to check amount of cached disk space used on iPhone
No. You can never access the file system in general. And thus not the cache being used by other apps. If you re-ask the question as "Is there any way to tell how much disk space my app is using in the cache, the answer is yes. Walk the file system of your cache directory using NSFileManager and use [NSFileManager attributesOfItemAtPath:error:] to get the size of each file.

Categories : Iphone

Check whether a pointer points to a empty space on a int array
You should initize aux correctly (c doesn't fill arrays with zeros by default, that's where your strange values come from) and add a counter that counts the numbers of matches you found instead of using i < sizeA in that last loop.

Categories : C

Check/Uncheck checkbox with Space/Enter in gridview in listview - wpf
If you have a binding on the currently selected item, you can handle the PreviewKeyUp event on your ListView: <ListView PreviewKeyUp="OnGridKeyUp" SelectedItem="{Binding MySelectedItem}" SelectionMode="Single" ItemsSource="{Binding ItemsList}"> ... </ListView> and then handle this in code-behind: private void OnGridKeyUp(object sender, KeyEventArgs e) { if(vm.mySelectedItem != null && e.Key == Key.Space) { vm.MySelectedItem.IsChecked = !vm.MySelectedItem.IsChecked; e.Handled = true; //this is necessary because otherwise when the checkbox cell is selected, it will apply this keyup and also apply the default behavior for the checkbox } } This obviously requires you to have a handle on your viewmodel from your code behind. Th

Categories : C#

jQuery Validation - check if a string has a unicode or space character doesn't working
Try jQuery(function ($) { var validator = $('#register_form').validate({ rules: { username: { required: true, minlength: 4, checkUsername: true } }, messages: { username: { required: "No blank", minlength: "Enter atleast 4 words" } } }); $.validator.addMethod('checkUsername', function(value, element) { return this.optional(element) || (!/s/g.test(value) && !/[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙ]/.test(value)); }, "No space or unicode character");; }); Demo: Fiddle

Categories : Javascript

jQuery Validation - Add custom callback function, check if a string has a space doesn't working
You need to return true is the the value is true it should be $.validator.addMethod('checkUsername', function(value, element) { return this.optional(element) || !/s/g.test(value); }, "error"); Demo: Fiddle

Categories : Javascript

Mysql between dates and InnoDB
Well, you changed the database engine, now the null is handled in a different way. SELECT * FROM MY TABLE WHERE END_TIME BETWEEN '2013-01-01 AND ? valid query SELECT * FROM MY TABLE WHERE END_TIME BETWEEN '2013-01-01' AND null will always return 0 rowns rewrite your query to SELECT * FROM MY TABLE WHERE END_TIME BETWEEN ? AND now() or SELECT * FROM MY TABLE WHERE END_TIME >=0

Categories : Mysql

mysql innoDB Performance
Try change innodb_flush_log_at_trx_commit to 2. From documentation: You can achieve better performance by setting the value different from 1, but then you can lose up to one second worth of transactions in a crash.

Categories : Mysql

PHPmyadmin INNoDB Restore
Ok!!!!! If anyone faces this problem, Please kindly use this link. Follow the process as it was described. http://www.techhack.co.uk/2011/12/30/restore-mysql-database-from-frm-files/ In my own case, it worked for me perfectly. Im so much happy right now.

Categories : Mysql

Can we use Hibernate Search with MySQL 5.1 InnoDB in a JSF app
Hibernate Search uses Lucene as its full-text search backend, and you can hook it up to a MySQL InnoDB database with no problem. Essentially, your full-text search queries are run against the Lucene documents that Hibernate Search maintains, and you can still use CRUD operations on your current database. See also the Hibernate Search/Lucene diagram here.

Categories : Mysql

Updating auto_increment value in an InnoDB table
I know this is a late, but after asking this related question, I found out that certain parts of an sql statement need to be literals and can't be replaced by user_defined_variables. If you need to change such parts of an SQL statement you need to use prepared statements. So you need to do something like this: SET @`stmt_alter` := CONCAT('ALTER TABLE `Registration` AUTO_INCREMENT = ', @`maxId`); PREPARE `stmt` FROM @`stmt_alter`; EXECUTE `stmt`; DEALLOCATE PREPARE `stmt`;

Categories : Mysql

MySQL (innoDB) database replication. When and why?
I haven't yet seen a locked select (not counting FOR UPDATE) in InnoDB. So my guess is they either don't get locked at all or lock for a very short time during transaction commits. Replication and locking are unrelated in this case, replication is mostly used for load balancing reads and for backup purposes. The master and slave are two separate MySQL servers and you have to decide which one you will connect and run queries to. If you want to use it for load balancing reads your app has to make a decision for each query whether it should be run on the master or on a slave. Usually you would want to run as many as possible on a slave, but there are some limitations: If your query expects to read data from an uncommitted transaction it has to run on the master. Even under normal conditi

Categories : Mysql

Large INNODB Tables Locking Up
The GROUP BY is the culprit. Apparently MySQL decides to use a temporary table in this case (perhaps because the table has exceeded some limit) which is very inefficient. I ran into similar problems, but no clear solution. You could consider splitting your stats table into two tables, a 'daily' and a 'history' table. Run your query on the 'daily' table which only contains entries from the latest 24 hours or whatever your interval is, then clean up the table. To get the info into your permanent 'history' table, either write your stats into both tables from code, or copy them over from daily into history before cleanup.

Categories : Mysql

Optimizing innoDB but my inserts wait for each other
3,300 inserts a second is quite respectable, especially with a trigger. It's hard to know more about that without understanding the tables. What are you doing about commits? Are you doing all 10K inserts and then committing once? If so, other clients doing similar tasks are probably locked out until each client runs. That's a feature! On the other hand, if you're using autocommit you're making your MySQL server churn. The best strategy is to insert chunks of something like 100 or 500 rows, and then commit. You should attempt to solve this kind of lockout not with configuration settings, but by tuning your web php application to manage transactions carefully. You might want to consider using a MyISAM table if you don't need robust transaction semantics for this application. MyI

Categories : PHP

How do I lock on an InnoDB row that doesn't exist yet?
If there is an index on username (which should be the case, if not, add one, and pererrably a UNIQUE one), then issuing a SELECT * FROM user_table WHERE username = 'foo' FOR UPDATE; will prevent any concurrent transation from creating this user (as well as the "previous" and the "next" possible value in case of a non-unique index). If no suitable index is found (to meet the WHERE condition), then an efficient record-locking is impossible and the whole table becomes locked*. This lock will be held until the end of the transaction that issued the SELECT ... FOR UPDATE. Some very interesting information on this topic can be found in these manual pages. * I say efficient, because in fact a record lock is actually a lock on index records. When no suitable index is found, only the default cl

Categories : Mysql

Converting a program that was set to use MyISAM to INNODB instead
There are several differences between MyISAM and InnoDB, nicely described in this discussion: http://dba.stackexchange.com/questions/1/what-are-the-main-differences-between-innodb-and-myisam The only aspect which could prevent the use of InnoDB would be the full text search capabilities of MyISAM, which were introduced in InnoDB with version 5.6 of MySQL. So if your program does not make use of full text search, or if your MySQL version supports full text search with InnoDB, there is no real obstruction. Given the small size of the database, and assuming a small traffic as well, I would not expect any substantial difference in terms of performances.

Categories : Mysql

InnoDB Foreign Keys and Commit
No idea of what the error message might say or what you're trying to accomplish but ALTER TABLE is a DDL statement and those cannot be rollbacked in MySQL. The Statements That Cause an Implicit Commi manual chapter explains: The statements listed in this section (and any synonyms for them) implicitly end any transaction active in the current session, as if you had done a COMMIT before executing the statement. As of MySQL 5.5.3, most of these statements also cause an implicit commit after executing; [...] Data definition language (DDL) statements that define or modify database objects [...] ALTER TABLE, CREATE TABLE, and DROP TABLE do not commit a transaction if the TEMPORARY keyword is used. (This does not apply to other operations on temporary tables such as CREAT

Categories : Mysql

Symfony2 and Match Against, table InnoDB
You can add the engine option in the @ORM/Table definition: For annotions: <?php namespace MyBundleEntity; use DoctrineORMMapping as ORM; /** * MyEntity * * @ORMTable(name="my_entity", options={"engine"="MyISAM"}) * @ORMEntity(repositoryClass="MyBundleEntityRepositoryMyEntityRepository") */ class MyEntity { //... } Hope this helps

Categories : Symfony2

InnoDB query duration inconsistent
The updates are performed in-memory (in the buffer pool) unless innodb_flush_method is set to O_DIRECT - they are logged in the binary log (which is replayed in case of crash) and flushed to the disc once every second (by default). This means that one update in every second will be slower because of the disk I/O that happens at this time.

Categories : Mysql

data_length and index_length do not changed for innodb
Both these variables are just estimates. The cost of maintaining an exact number, to the byte, of your data length and index length is prohibitive, since with a concurrently accessed server this would have to mean serializing writes. InnoDB is a highly concurrent engine; it therefore chose the path of rough estimates. How rough? Very rough. A 50%-200% "mistake" is quite common; I've seen more.

Categories : Mysql

mysql innodb: delete takes seconds
Your EXPLAIN shows that your query is using the "index_merge" access type. So it has to search two indexes (these are shown in the keys field), find the relevant entries, and then find the intersection between the two results. This may be better than a non-indexed search, but it's usually better to create a single index with two columns, over (id, kid).

Categories : Mysql

MySQL Memory Engine vs InnoDB on RAMdisk
I suggest you use MyISAM. Create your table with appropriate indexes for your query. Then disable keys, load the table, and enable keys. I suggest you develop a discipline like this for your system. I've used a similar discipline very effectively. Keep two copies of the table. Call one table_active and the second one table_loading. When it's time to load a new copy of your data, use commands like this. ALTER TABLE table_loading DISABLE KEYS; /* do your insertions here, to table_loading */ /* consider using LOAD DATA INFILE if it makes sense. */ ALTER TABLE table_loading ENABLE KEYS; /* this will take a while */ /* at this point, suspend your software that's reading table_active */ RENAME TABLE table_active TO table_old; RENAME TABLE table_loading TO table_active; /* n

Categories : Mysql

Optimizing an InnoDB table and a problematic query
You shouldn't be JOINing on a VARCHAR column (Nickname); you should use the user ID to join those tables. That is definitely slowing the query down and is probably the biggest issue. It would also be easier to follow if you wrote all of the JOINs explicitly instead of at the end in the WHERE clause like this: SELECT Messages.ID AS MessageID, Messages.Message, Messages.TIMESTAMP, Messages.Nickname, Topics.ID AS TopicID, Topics.Title AS TopicTitle, Forums.Title AS ForumTitle FROM Messages JOIN FollowedNicknames ON Messages.Nickname = FollowedNicknames.Nickname AND FollowedNicknames.UserID = 'MYUSERID' JOIN Forums ON Forums.ID = FollowedNicknames.ForumID JOIN Subforums ON Subforums.ForumID = Forums.ID JOIN Topics ON Messages.TopicID =

Categories : Mysql

mysql transaction not working with innodb tables
ALTER TABLE is a DDL (Data Definition Language) statement; which is not transactional in MySQL innodb engine. INSERT is a DML statement (Data Manipulation Language), which is transactional. Because one statement isn't transactional and one is, the two shouldn't be combined in a transaction. Quoting from the MySQL manual: Some statements cannot be rolled back. In general, these include data definition language (DDL) statements, such as those that create or drop databases, those that create, drop, or alter tables or stored routines. You should design your transactions not to include such statements. If you issue a statement early in a transaction that cannot be rolled back, and then another statement later fails, the full effect of the transaction cannot be rolled back

Categories : PHP

MySQL innoDB index storage type not specified
All InnoDB indexes are B-trees where the index records are stored in the leaf pages of the tree. The default size of an index page is 16KB. When new records are inserted, InnoDB tries to leave 1/16 of the page free for future insertions and updates of the index records. Check these links Physical Structure of an Index Clustered and Secondary Indexes

Categories : Mysql

Confusion with new innodb memcached plugin for MYSQL?
As always the answer is "it depends". You can use the memcached plugin as a complete replacement of your existing standard memcached server. You would only need to tell the plugin which table you want to use to store the cached data by inserting a row into the innodb_memcache.containers table. In this case you would probably create a brand new table for your cache. In this scenario your application and existing database remains untouched. The benefit is that you now have a persistent memcached with as much space as your database has (instead of being limited by the amount of RAM on your memcached server) However, there is also another approach you can take, in which you access your actual MySQL data but exclusively through the Memcached protocol. In this scenario you completely remove t

Categories : Mysql

MySQL InnoDB: Best practice bulk insert
This manual page also suggests changing the innodb_autoinc_lock_mode. If you do not need the feature, disable binary logging. Increasing the size of some InnoDB buffers could help too (the innodb_buffer_pool_size in particular). I believe using a transaction is not desirable in this case. If a small number of consecutive changes need to be applied within the same transaction, these changes may be optimized by being consolidated in one single write. In your case, I believe you will only load your redo log uselessly. This leads me to another suggestion: try inserting a smaller number of rows at a time, like this: INSERT INTO destination SELECT * FROM source LIMIT 0, 10000; INSERT INTO destination SELECT * FROM source LIMIT 10000, 10000; -- and so on Finally, if you have a lot of memo

Categories : Mysql

InnoDB transactions: Lock wait timeout
You can achieve the benefits of autocommit = 0 while still not using long transactions. a) You can commit the transaction every X statements, assuming that you don't need to rollback the entire transaction b) instead of using autocommit = 0 you can use ALTER TABLE x DISABLE keys / ALTER TABLE x ENABLE keys before/after the import. This is the reason for the performance improvement of the operation - the non-unique indexes are not updated until the transaction finishes, and then are updated in bulk.

Categories : Mysql

MySQL (InnoDB) - How many joins makes sense?
The rule of thumb I've heard is that more than seven tables in a JOIN is too many. The key thing here is not the number of JOINs, but the proper ordering of the WHERE clauses. SQL is set-based, so if you execute the WHERE clause that excludes the maximum number of rows first you'll save work for subsequent filters. Indexing will affect performance, too. Make sure you have indexes on all columns in WHERE clauses. It goes without saying that every table must have a primary key, and that's what you should JOIN on. Sorry, this is stupid: WHERE invoices.invoiceId >=1 AND invoices.invoiceId <=1 If this is an example of what's auto-generated for you, I'd say you need a better generator.

Categories : Mysql

Does MOD(primarykey) on an InnoDB partitioned table cause fragmentation
When I set up the server I mistakenly thought the open files limit was higher, though in reality it's sitting at 1024. I've upped it to 16000 and rebooted the server, and it's running slightly quicker @ 3 seconds (I was assuming the file opening/closing was causing the system lock status). I also purged the bin logs. Still seems a bit slow though.

Categories : Mysql

MySQL InnoDB indexes slowing down sorts
In the slow case, MySQL is making an assumption that the index on STATUS will greatly limit the number of users it has to sort through. MySQL is wrong. Presumably most of your users are ACTIVE. MySQL is picking up 50k user rows, checking their ACCESS_ID, joining to MIGHT_FLOCK, sorting the results and taking the first 100 (out of 50k). In the fast case, you have told MySQL it can't use either index on USERS. MySQL is using its next-best index, it is taking the first 100 rows from MIGHT_FLOCK using the STREAK index (which is already sorted), then joining to USERS and picking up the user rows, then checking that your users are ACTIVE and have an ACCESS_ID at or above 8. This is much faster because only 100 rows are read from disk (x2 for the two tables). I would recommend: drop the index

Categories : Mysql

How to improve InnoDB's SELECT performance while INSERTing
I imagine you have already solved this nearly a year later :) but I thought I would chime in. According to MySQL's documentation on internal locking (as opposed to explicit, user-initiated locking): Table updates are given higher priority than table retrievals. Therefore, when a lock is released, the lock is made available to the requests in the write lock queue and then to the requests in the read lock queue. This ensures that updates to a table are not “starved” even if there is heavy SELECT activity for the table. However, if you have many updates for a table, SELECT statements wait until there are no more updates. So it sounds like your SELECT is getting queued up until your inserts/updates finish (or at least there's a pause.) Information on altering that priority can be f

Categories : Mysql

UNIX:Create array from space delimited string while ignoring space in quotes
This is bash specific, may work with ksh/zsh inp='ROLE_NAME="Business Manager" ROLE_ID=67686' set -- $inp arr=() while (( $# > 0 )); do word=$1 shift # count the number of quotes tmp=${word//[^"]/} if (( ${#tmp}%2 == 1 )); then # if the word has an odd number of quotes, join it with the next # word, re-set the positional parameters and keep looping word+=" $1" shift set -- "$word" "$@" else # this word has zero or an even number of quotes. # add it to the array and continue with the next word arr+=("$word") fi done for i in ${!arr[@]}; do printf "%d %s " $i "${arr[i]}"; done 0 ROLE_NAME="Business Manager" 1 ROLE_ID=67686 This specifically breaks words on arbitrary whitespace but joins

Categories : Shell

We would like to register a user if space is available or put on waiting list if space is full. Any ideas how to approach this?
Maybe I'm missing something, but it doesn't seem that complicated to me. This answer only uses the SQL pieces that matter to preserve legibility, since I'm mainly referring to queries and not the VB. First, you do what you were already doing--check to see if they're already signed up/on the waiting list. SELECT Count(*) FROM ( SELECT * FROM tblTrainings UNION SELECT * FROM waitingList ) AS t WHERE Username = XXX AND CourseID = XXX AND LocationID = XXX AND dateID = XXX /* Tells you whether the person is signed up already, whether for the course itself or the waiting list. */ SELECT Count(*) FROM tblTrainings WHERE CourseID = XXX AND LocationID = XXX AND dateID = XXX -- This will give you the number of people in the course. Then, once you have that, you can decide whether to add th

Categories : Asp Net

javascript regex replace all doublequotes in string unless the doublequote is followed by space or comma space
A way: rebuild the json string: var str = '{"description":"This is my 12" pizza I ordered.","value":"1"}'; var regex = /"(.*?)"(?=s*([,:])s*"|(}))/g; var result = '{'; var arr = regex.exec(str); while (arr != null) { result += '"' + arr[1].replace(/\?"/g, '\"') + '"'; if (arr[2]) result += arr[2]; if (arr[3]) result += arr[3]; arr = regex.exec(str); } console.log(result);

Categories : Javascript

Adding empty rows or space in fo:table inly if there's enough space for next data
As a workaround, you can add 'padding-bottom' to each row except the last row in the table. You may end up with row 5 of your example being moved to the second page, but you can at least be sure that there's no extra space at the top of the page.

Categories : Xml

How to capitalize each word after a space leaving the rest of it as is and preserve the space in the end if it exists
Use re.sub: >>> import re >>> re.sub(r'[a-z]', lambda m: m.group().upper(), 'home swe eeeet home') 'Home Swe Eeeet Home' >>> re.sub(r'[a-z]', lambda m: m.group().upper(), 'heLLo OoO ooo ') 'HeLLo OoO Ooo ' re.sub(pattern, repl, string, count=0, flags=0) Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. If the pattern isn’t found, string is returned unchanged. repl can be a string or a function. If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. [a-z] match any lowercase character([a-z]) after the word boundary (). The lambda function

Categories : Python

Windows batch file to get C: drive total space and free space available
cut 9 digits of the size by bytes to get the size in GB: @echo off & setlocal ENABLEDELAYEDEXPANSION SET "volume=C:" FOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO ( SET "diskfree=!disktotal!" SET "disktotal=!diskavail!" SET "diskavail=%%j" ) FOR /f "tokens=1,2" %%i IN ("%disktotal% %diskavail%") DO SET "disktotal=%%i"& SET "diskavail=%%j" (ECHO(Information for volume %volume% ECHO(total %disktotal:~0,-9% GB ECHO(avail. %diskavail:~0,-9% GB)>size.txt TYPE size.txt cmd can calculate only with numbers up to 2^31-1   (2,147,483,647 ~ 2.000001 Gigabytes)

Categories : Windows



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.