How to send SMS from MySQL 8 and newer versions

This comprehensive guide empowers you to leverage the combined strength of Ozeki NG SMS Gateway and MySQL 8. Ozeki NG SMS Gateway is renowned for its robust features and user-friendly approach, making this integration a breeze. In approximately 20 minutes, you will be equipped to send SMS messages directly from your MySQL database. Our in-depth guide offers a combination of clear video tutorials, detailed written explanations, step-by-step lists, and even the required code strings to streamline the process. Let's get started!

Video 1: How to install MySQL 8 on Windows

The first video teaches you to download MySQL Workbench then takes you through the standard installation process. You will learn to set up accounts and roles, as well as server file permissions, and how you can connect to your server. To finish it off, it shows you how you can create a schema for your database.

Download url: https://dev.mysql.com/downloads/windows/installer/8.0.html

  1. Download MySQL 8 from the link above or from MySQL's website
  2. Open the installation wizard
  3. Follow the steps of the installation
  4. Open MySQL Workbench
  5. Configure MySQL connection
  6. Create new schema
  7. Create database

Video 2: How to install the MySQL client connector

The second video starts by downloading the ODBC driver. After downloading the right version for you, it takes you through the steps of a typical installation. After that, it shows you how you can add a new user data source and select your desired driver for it in ODBC Data Source administrator.

Download url: https://dev.mysql.com/downloads/connector/odbc/

  1. Download ODBC from MySQL's website
  2. Open installer
  3. Follow the steps of the installation
  4. Open ODBC Data Source Administrator
  5. Add desired driver for the data source

Video 3: Create SMS tables using MySQL Workbench

The third video is about creating SMS tables. It starts by opening MySQL Workbench, then creating a new query, copying and pasting the code below.

MySQL create table script:

CREATE TABLE ozekimessagein (
  	id int(11) NOT NULL auto_increment,
  	sender varchar(255) default NULL,
  	receiver varchar(255) default NULL,
  	msg text default NULL,
  	senttime varchar(100) default NULL,
  	receivedtime varchar(100) default NULL,
  	operator varchar(100) default NULL,
  	msgtype varchar(160) default NULL,
  	reference varchar(100) default NULL,
  	PRIMARY KEY (id)
  	) charset=utf8; 
  	
ALTER TABLE ozekimessagein ADD INDEX (id);
CREATE TABLE ozekimessageout (
  	id int(11) NOT NULL auto_increment,
  	sender varchar(255) default NULL,
  	receiver varchar(255) default NULL,
  	msg text default NULL,
  	senttime varchar(100) default NULL,
  	receivedtime varchar(100) default NULL,
  	reference varchar(100) default NULL,
  	status varchar(20) default NULL,
  	msgtype varchar(160) default NULL,
  	operator varchar(100) default NULL,
  	errormsg varchar(250) default NULL,
  	PRIMARY KEY (id)
  	) charset=utf8;
  	
ALTER TABLE ozekimessageout ADD INDEX (id);

After that, the video shows executing the script to create the SMS tables.

  1. Open MySQL Workbench
  2. Create new query using the code above
  3. Execute script

Video 4: Configure Ozeki NG SMS Gatetway to connect to MySQL 8

The fourth video is all about configuring Ozeki NG SMS Gateway. First, you will learn to create a database application, and name it. Then it shows you how you can specify the database connection string (found below).

MySQL ODBC connection string:

Driver={MySQL ODBC 8.2 Unicode Driver};Server=127.0.0.1;Database=test;User=test;Password=test;Option=4;

After that, you will be taught to modify this string so you can enter your own login credentials for the database. Upon a successful connection, the video teaches you to check events related to the connection.

  1. Open Ozeki NG SMS Gateway
  2. Install new database application
  3. Configure new database application
  4. Copy and paste the string above to the corresponding textbox
  5. Check for results

Video 5: Send a test SMS using MySQL Workbench

The fifth and final video in this article goes over testing the system you have set up while following along. First, it deletes the previous query, then copies and pastes the string below.

INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('+36201234567','Hello World','send');

Once that is done, it shows you how you can execute the script. Then it goes onto showing how you can check whether your test SMS has been sent or not inside Ozeki NG SMS Gateway.

  1. Open MySQL Workbench
  2. Remove previous query's text
  3. Copy and paste the string above
  4. Execute script
  5. Check for results

Conclusion

That covers everything for this tutorial, you may take a moment to catch your breath now. You have learned to install MySQL Workspace, the ODBC driver, harmonize them with Ozeki NG SMS Gateway and even sent out your first test SMS. This solution is great because it allows you to send out SMS messages in bulk very efficiently.

Put this knowledge into action – download Ozeki NG SMS Gateway and get started today!

More information