MSSQL: MYSQL:
Casting string to bigint for MSSQL & MYSQL
MSSQL: MYSQL:
MYSQL Row_number usage and example
Imagine data as below:- category_id item_name 1 Item A1 1 Item A2 1 Item A2 2 Item B1 2 Item B1 2 Item B2 3 Item C1 3 Item C2 In this query: Now, let’s see the result of executing this modified query on our sample data: category_id item_name displayOrder 1 Item A1 1 1 […]
XAMPP DB Crash fix
It is possible, I found out a solution: Install new xampp Copy your old database folder from xampp\mysql\data\databasefolder to Paste in your running xampp folder C:\xampp\mysql\data After that stop mysql and apache service then backup your running xampp files ib_logfile0,ib_logfile1 and ibdata1 and store in safe place Then Copy same file (ib_logfile0,ib_logfile1 and ibdata1) from […]
MYSQL search through whole database for a certain string.
The code above will generate a procedure called get_table(SEARCH_STRING) , that will accept 1 parameter which is your string. It will search through the whole database server besides these db(information_schema,test,mysql). But if you would like to search only in a certain DB you may use the second block. $ call get_table(‘STRING’); ## FIRST BLOCK ## […]
Building your own SMTP server
https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql/#dovecot
Mysql DB allowing old user from different IP with same grants
Firstly, We have to create a new user from different ip , so we have to run the below command. The first “Select” query is to get all column in user table and the thing we wanna replace is the Host ( the ip that client is going to connect from ). #User Table #To […]
Mysql Procedure creation
Procedure Creation Example MariaDB [stress]> DELIMITER ;; MariaDB [stress]> CREATE PROCEDURE ABC() -> BEGIN -> WHILE 1 -> DO -> SELECT COUNT(*) FROM stresstable; -> DO SLEEP(1); -> END WHILE; -> END;; MariaDB [stress]> DELIMITER ; MariaDB [stress]> CALL ABC(); Procedure Listing $ SHOW PROCEDURE STATUS; OR $ SELECT ROUTINE_SCHEMA,ROUTINE_NAME FROM information_schema.routines where routine_type = […]
MysqlDump without locking Tables
# dumping data without lock table mysqldump -u[USER] -p[PASS] –skip-lock-tables –single-transaction –flush-logs –hex-blob –master-data=2 –max_allowed_packet=1G globe_sdp > globe_sdp_v2.sql
Server & Sql Monitoring (PMM-Server)
Hi, i’ve recently created a pmm-server ( monitoring system for server & mysql ). A pmm-server act as a server and client can connect to pmm-server to look on their information by using the command pmm-admin. For more info Click in this link https://www.percona.com/doc/percona-monitoring-and-management/deploy/server/index.html Setup SMTP server For this example you can refer to […]