Define user variables to use in a SQL that has an “in” statement in MySql Workbench

I am trying to use defined variables in MySql Workbench I am using version 6.3 of Workbench I am trying to run ad hoc queries that can have a value or multiple values:

If I have a single value, the query runs ok set @Zdept_Id=”548″ and then Select * from employees where dept_Id in (@ZDept_Id)

but if I want to execute this for multiple departments, the query only returns values for the first number

set @Zdept_Id=”548,221,1973,905″ and then Select * from employees where dept_Id in (@ZDept_Id)

Dept_Id is an integer.


PS. These are reports that I run once a month, so automating them is not an option due to cost/benefit.

Local MySQL database check for changes

Me and my friend had a website. Before closing website he dumped MySQL Database from phpmyadmin and stores it locally on his PC. Now he send me sql file. Is there a way to see if he didn’t change/add/remove lines,tables and variables and other stuff from *.sql file ? How he can modify the file so I can’t notice that file is modified ?

Long Running Transaction in MySQL

I have very Long Running Transactions in MySQL (RDS Aurora)

select * from information_schema.innodb_trx where trx_id = 45638005; +----------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+ | trx_id   | trx_state | trx_started         | trx_requested_lock_id | trx_wait_started | trx_weight | trx_mysql_thread_id | trx_query | trx_operation_state | trx_tables_in_use | trx_tables_locked | trx_lock_structs | trx_lock_memory_bytes | trx_rows_locked | trx_rows_modified | trx_concurrency_tickets | trx_isolation_level | trx_unique_checks | trx_foreign_key_checks | trx_last_foreign_key_error | trx_adaptive_hash_latched | trx_adaptive_hash_timeout | trx_is_read_only | trx_autocommit_non_locking | +----------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+ | 45638005 | RUNNING   | 2019-12-25 14:29:57 | NULL                  | NULL             |       1967 |                  20 | NULL      | NULL                |                 0 |                 0 |                2 |                   376 |               1 |              1965 |                       0 | REPEATABLE READ     |                 1 |                      1 | NULL                       |                         0 |                         0 |                0 |                          0 | +----------+-----------+---------------------+-----------------------+------------------+------------+---------------------+-----------+---------------------+-------------------+-------------------+------------------+-----------------------+-----------------+-------------------+-------------------------+---------------------+-------------------+------------------------+----------------------------+---------------------------+---------------------------+------------------+----------------------------+ 

My Application uses Apache Tomcat Connection Pool to get a Connection and Execute the Queries. I’m not explicitly starting any tranasction so I’m giving any COMMIT or ROLLBACK.

Can someone Explain what is the meaning of the above transaction, It shows transaction is running but trx_query is NULL

I checked the Queries executing using trx_mysql_thread_id in events_statements_history and events_statements_history_long and found there are multiple Queries. How is it possible that all the Queries are using Same Transaction, Even though i didn’t use any Transactions ??

Cannot connect web app to MySQL database

I’m not sure what I’m doing wrong. You can see in the bottom right corner that it says it cannot connect to the database. You can see MySQL Workbench open with the database created called smartertrack. I also included the error log for the SmarterTrack app, which says the connection string has not been initialized, but I don’t know what that means. The root password is correct, I have tested it over and over.


sysbench runs give different result for mysql database performance evaluation

i am trying to evaluate the performance of mysql database cluster , INNODB cluster (group replication) , so i use sysbench , i run multiple test using the lua scripts (read_write.lua / read_only.lua / bulk_insert.lua) , each test is run 100 runs for repetition (to give more accurate value) ,and took the mean of the result for each test with different number of threads, but i have a problem if i rerun the test on same servers with same sysbench variables and same values for mysql cluster configuration i have different result which make me confused , could any one advise of what could the problem please. noting that i am using 3 servers vms (on same datacenter vms ) with same specification for cluster , and one server as router on same vm , sysbench installed on different server also on same vm to not have network issues.

servers specification of cluster:

ram: 8G

cpu: 2cores , x86_64, 2593.906 MHz

sysbench version : 1.0.18-1

mysql version : 8.0.18

noting below is the same values on 3 servers of my.cnf file, for sure with different server id

my.cnf file on the 3 nodes:

sysbench command used for bulk insert

sysbench –mysql-host=router_IP –mysql-port=6446 –db-driver=mysql –mysql-user=root –mysql-password=** –mysql-db=test_cluster –threads=30 –events=100000 –time=60 /usr/share/sysbench/bulk_insert.lua run |cat > innodb.log

sysbench command used for read_only test

sysbench –mysql-host=router_IP –mysql-port=6447 –db-driver=mysql –mysql-user=root –mysql-password=** –mysql-db=test_cluster –tables=5 –table_size=2000000 –threads=30 /usr/share/sysbench/oltp_read_write.lua run |cat > innodb.log

Risk of getting MySQL database compromised while accessing it with a windows application

I want to make an windows software for clients that clients can register inside the software and it will store the registration to an online MySQL.

However when i googled “how to do this”, I found that to establish such a MySQL connection I should provide a sql user with the right to modify the sql database. And I would also provide that sql user’s password. (All these should be in my code)

This comes to a problem, if someone decompiled my application, he can get my code, and get my sql user and password, and he can see and do anything to my sql database.

Is there anyway to prevent this?

[]*shared Hosting @ only $6/year*AUTO SSL| Unlimited Web Space| MYSQL DAT

Hostpoco is a Simple, Easy, Trusted, Reliable Web Hosting Service..Just Sign up and be online within 2 minutes with our instant & free setup!

Hostpoco deals with cheap high resourced and hugely demanded web hosting services starting from $0.5 Per month. All our hosting plans comes with cpanel as control panel included with some smart features like no limit space, unmetered bandwidth, free auto ssl, free site builder, free migration service, free dedicated IP,own email address,single click installer and much more. Get a move on!


*shared Hosting plan for Beginner $0.5 /Monthly.

*shared Hosting plan for Pro $1 /Monthly.

*shared Hosting plan for Premium $2.5 /Monthly.

*shared Hosting plan for Elite $5 /Monthly.

For more details :…osting.php


shared Hosting Premium plan $2.5 /Monthly:
~Ten Domain Hosting
~Unlimited Web Space
~Unlimited Bandwidth
~Unlimited Email Accounts
~Unlimited Parked Domains
~9 Addon Domains
~Unlimited MySQL Databases
~Unlimited Sub Domains
~FREE cPanel Control Panel
~FREE AwStats
~FREE Virus Scanner
~DDOS Protection
~99.99% uptime
~Softacolous Supported
~ier 3 Technical Support Hosting Provider | Cheap Hosting Provider | Cheap cPanel Hosting | $1 Unlimited hosting | Fast SSD Hosting | Money back Hosting | Best Seller hosting | ideal free hosting | free web hosting 

Thank you.