For the best skill gain, you will want to fail to mine the ore sometimes, about 10-15 failures (1QL) is the best skill gain. If you fail more, improve your pickaxe or downgrade an ore difficulty.
''Note: Never mine gold for skill, it is a waste of materials and time. You have less than the optimal skill gain %chance to get ore-QL > 1/2 skill.''