Indeed, its working with port 6033, Thanks.
Now im able to run the script to test, but i got so many errors, since i canot upload the file, so below you will see the sysbech script and its output:
Sysbench script as below:
cat sysbench-proxysql.sh
#!/bin/bash
Variables
SQL1_DB_HOST=“127.0.0.1” # Changed to localhost
SQL1_DB_PORT=“6033” # Port for ProxySQL
SQL1_DB_USER=“USER”
SQL1_DB_PASS=“PASSWORD”
SQL1_DB_NAME=“test”
Test the connection to the SQL1 MySQL database via ProxySQL
echo “Testing connection to SQL1 DB via ProxySQL…”
mysql -h $SQL1_DB_HOST -P $SQL1_DB_PORT -u $SQL1_DB_USER -p$SQL1_DB_PASS -e “SHOW DATABASES;” &> /dev/null
if [ $? -eq 0 ]; then
echo “Connection successful!”
# Preparing the SQL1 database for sysbench
echo "Preparing SQL1 DB for sysbench..."
sysbench oltp_read_write --db-driver=mysql --mysql-host=$SQL1_DB_HOST --mysql-port=$SQL1_DB_PORT --mysql-user=$SQL1_DB_USER --mysql-password=$SQL1_DB_PASS --mysql-db=$SQL1_DB_NAME prepare
# Running the test
echo "Running sysbench on SQL1 DB via ProxySQL..."
sysbench oltp_read_write --db-driver=mysql --mysql-host=$SQL1_DB_HOST --mysql-port=$SQL1_DB_PORT --mysql-user=$SQL1_DB_USER --mysql-password=$SQL1_DB_PASS --mysql-db=$SQL1_DB_NAME --threads=50 --time=60 run > Proxysql_results.txt
# Cleaning up after test
echo "Cleaning up SQL1 DB after sysbench test..."
sysbench oltp_read_write --db-driver=mysql --mysql-host=$SQL1_DB_HOST --mysql-port=$SQL1_DB_PORT --mysql-user=$SQL1_DB_USER --mysql-password=$SQL1_DB_PASS --mysql-db=$SQL1_DB_NAME cleanup
# Display results
echo "SQL1 DB Sysbench Test Results via ProxySQL:"
cat SQL1_results.txt
else
echo “Connection failed! Please check your database credentials, ProxySQL settings, and network settings.”
fi
Below are the errors:
./sysbench-proxysql.sh
Testing connection to SQL1 DB via ProxySQL…
Connection successful!
Preparing SQL1 DB for sysbench…
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)
Creating table ‘sbtest1’…
Inserting 10000 records into ‘sbtest1’
Creating a secondary index on ‘sbtest1’…
Running sysbench on SQL1 DB via ProxySQL…
Cleaning up SQL1 DB after sysbench test…
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)
Dropping table ‘sbtest1’…
SQL1 DB Sysbench Test Results via ProxySQL:
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)
Running the test with following options:
Number of threads: 600
Initializing random number generator from current time
Initializing worker threads…
Threads started!
FATAL: mysql_stmt_execute() returned error 1317 (Query execution was interrupted) for query ‘UPDATE sbtest1 SET c=? WHERE id=?’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:469: SQL error, errno = 1317, state = '70100': Query execution was interrupted FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_stmt_execute() returned error 1180 (Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT) for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1180, state = ‘HY000’: Got error 149 - ‘Lock deadlock; Retry transaction’ during COMMIT
FATAL: mysql_stmt_execute() returned error 1317 (Query execution was interrupted) for query ‘UPDATE sbtest1 SET c=? WHERE id=?’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:469: SQL error, errno = 1317, state = '70100': Query execution was interrupted FATAL: mysql_stmt_execute() returned error 1180 (Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT) for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1180, state = ‘HY000’: Got error 149 - ‘Lock deadlock; Retry transaction’ during COMMIT
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_stmt_execute() returned error 1062 (Duplicate entry '5038' for key 'sbtest1.PRIMARY') for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1062, state = ‘23000’: Duplicate entry ‘5038’ for key ‘sbtest1.PRIMARY’
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_stmt_execute() returned error 1180 (Got error 149 - ‘Lock deadlock; Retry transaction’ during COMMIT) for query ‘INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1180, state = 'HY000': Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_stmt_execute() returned error 1317 (Query execution was interrupted) for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1317, state = ‘70100’: Query execution was interrupted
FATAL: mysql_stmt_execute() returned error 1062 (Duplicate entry ‘5046’ for key ‘sbtest1.PRIMARY’) for query ‘INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1062, state = '23000': Duplicate entry '5046' for key 'sbtest1.PRIMARY' FATAL: mysql_stmt_execute() returned error 1062 (Duplicate entry '5007' for key 'sbtest1.PRIMARY') for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1062, state = ‘23000’: Duplicate entry ‘5007’ for key ‘sbtest1.PRIMARY’
FATAL: mysql_stmt_execute() returned error 1180 (Got error 149 - ‘Lock deadlock; Retry transaction’ during COMMIT) for query ‘UPDATE sbtest1 SET k=k+1 WHERE id=?’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 1180, state = 'HY000': Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT FATAL: mysql_stmt_execute() returned error 1180 (Got error 149 - 'Lock deadlock; Retry transaction' during COMMIT) for query 'INSERT INTO sbtest1 (id, k, c, pad) VALUES (?, ?, ?, ?)' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:488: SQL error, errno = 1180, state = ‘HY000’: Got error 149 - ‘Lock deadlock; Retry transaction’ during COMMIT
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query ‘BEGIN’
FATAL: thread_run' function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query FATAL: mysql_drv_query() returned error 2013 (Lost connection to MySQL server during query) for query 'BEGIN' FATAL:
thread_run’ function failed: /usr/share/sysbench/oltp_common.lua:405: SQL error, errno = 2013, state = ‘HY000’: Lost connection to MySQL server during query
Regards,
Mo