This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1.Convert the Collation of a Database | |
ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci; | |
# 2.Convert the Collation of all Tables | |
SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA, '.', TABLE_NAME,' COLLATE utf8_general_ci;') | |
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='DBNAME' AND TABLE_TYPE = 'BASE TABLE'; | |
# 3.Convert the Collation of Table Columns | |
SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') AS mySQL | |
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "DBNAME" AND TABLE_TYPE="BASE TABLE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Audio preloader | |
$(window).ready(function(){ | |
var audio_preload = 0; | |
function launchApp(launch){ | |
audio_preload++; | |
if ( audio_preload == 3 || launch == 1) { // set 3 to # of your files | |
start(); // set this function to your start function | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Infinite scroll | |
$(document).ready(function(){ | |
$('#Loader').on('inview', function(event, isInView) { | |
if (isInView) { | |
var nextPage = parseInt($('#pageno').val())+1; | |
//Filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Discord = require("discord.js"); | |
const fs = require('fs'); | |
module.exports = class mute { | |
constructor(){ | |
this.name = 'mute', | |
this.alias = ['tempmute'], | |
this.usage = 'mute'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO table (id,Col1,Col2) VALUES (1,1,1),(2,2,3),(3,9,3),(4,10,12) | |
ON DUPLICATE KEY UPDATE Col1=VALUES(Col1),Col2=VALUES(Col2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE tablename AUTO_INCREMENT = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT order_id,product_name,qty | |
FROM orders | |
WHERE foo = 'bar' | |
INTO OUTFILE '/var/lib/mysql-files/orders.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import MySQLdb | |
# Connect | |
db = MySQLdb.connect(host="localhost", | |
user="appuser", | |
passwd="", | |
db="onco") | |
cursor = db.cursor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id, MAX(rev) | |
FROM YourTable | |
GROUP BY id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
WHERE table_schema = "$DB_NAME" | |
AND table_name = "$TABLE_NAME"; |
OlderNewer